These function prototypes lack parameters

Assignment Help Basic Computer Science
Reference no: EM13166946

Write a program that emulates the behavior of a bus. The bus must have a schedule ( a finite number of times for it to stop) and a certain capacity (number of passengers). In this program the bus has two states: stopped and going. Over time, events take place, such as stopping the bus ( for which the bus must already be going ), loading passengers, unloading passengers, or starting the bus. For each event, the current state of the bus must change accordingly. Each time the bus stops, it must load and unload passengers. The number of passengers that will be unloaded at every bus stop must be generated randomly. The number of passengers waiting for the bus at each stop is also generated randomly. The bus should load as many waiting passengers as possible without exceeding the bus capacity. Write a program that implements this model, with the following operation:

void stop_bus();   /* Stop the bus   */

void start_bus();   /* Start the bus   */

void load_pass(); /* Load passengers */

void unload_pass(); /* Unload passengers */

Note: These function prototypes lack parameters; add whatever parameters you feel are necessary so that the program works without global variables. The program's output should reflect the bus's actions by reporting each change in state, along with the number of passengers loaded and unloaded.

Reference no: EM13166946

Questions Cloud

Write a function to circulate a list : Write a function to circulate a list. The function takes two paramaters, the first defines how many elements of the list to circulate, and the second is the list. The output should be the circulated list.
How is this applied to changing the coding? : when writing a linear cipher using n = 27, if a = ?, b = ? and c = 7, if ac = 1(mod27) how is this applied to changing the coding?
The integers should be printed in order with addresses : The integers should be printed in order with addresses from main. When the steps of the function order have been completed the smallest value will be stored in a, the middle in b, and the largest in c.
Write a function create audio colla() : Write a function createAudioCollage() that will create an audio collage.
These function prototypes lack parameters : These function prototypes lack parameters; add whatever parameters you feel are necessary so that the program works without global variables. The program's output should reflect the bus's actions by reporting each change in state, along with the n..
The minimal spanning tree algorithm : discuss the minimal spanning tree algorithm. Describe the advantages and disadvantages of this algorithm. List the circumstances best suited for the minimal spanning tree algorithm.
Each has a string for their name : Create a class in C++ that holds robot warriors. Each has a string for their name, a number of hitpoints (an float), armor (a defensive modifier(an int)), and weaponry (an offensive multiplier(another int)). You will create 5 robots with a random ..
Select distinct cmdclient : SELECT DISTINCT CMDclient.'Client Code SCA' as GuestCode, CMDextras.ArrivalDate as arr, CMDextras.DepartureDate as dep, CMDapr.FirstName as fname, CMDapr.Surname as lname
Find the value of (((a+b+)+c)+d) : find the value of (((a+b+)+c)+d) that would be computed in a floating point number system that has a mantissa approximately equivalent in precisions to 17 decimal digits. a = 99.0, b = 1.0*10^30, c=1.0*10^30, d = -98.0

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Human and nature dynamics (handy) model

This paper is centered around some results obtained from the Human and Nature Dynamics (HANDY) model. This model is equation 3 in their paper.

  Explain legal reasons for not performing examination

Legal reasons for not performing examination on suspect's computer, but sometimes you have to compromise. If we make compromise, is it acceptable by court?

  Class polygon which draws a hexagon for a set of numbers

Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).

  Degree of security in time-shared machine dedicated machine

Write down two such problems? Can we make sure same degree of security in time-shared machine as in dedicated machine?

  Describing fields and options with user account set-up

Describe the fields and options associated with user account set-up.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Preceding principles for probabilistic conditional

Which of the preceding principles are valid for this probabilistic conditional? Explain why or why not. Discuss the main difference that you found in your answers.

  Values for the items in the risk register

Recommend reasonable values for items in risk register for this asset and threat, and give justifications for your choices.

  Report steps necessary evidence and protect company

Jonathan Simpson owns a construction company. Write a one-page report detailing the steps Jonathan and you need to take to obtain the necessary evidence and protect the company.

  Writing java code by using netbeans

Write a java code using netbeans for the following program. Write a program that asks the user to enter five test scores.

  How assembly language program is created-debugged-editors

Explain how the assembly language program is created and debugged by using system tools like editors, assemblers.

  Create the data model segment for business rules

The FlyRight Aircraft Maintenance (FRAM) division of FlyRight Company (FRC) does all maintenance for FRC's aircraft. Create the data model segment which reflects the following business rules.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd