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

  Program that allows a user to enter 10 item stock

Write a program that allows a user to enter 10 item stock numbers, prices, quantities in stock into three parallel arrays. Display all the data in report form - that is, aligned correctly in columns.

  How prototyping influences user centered design

Explain prototyping advantages and disadvantages of prototyping, how prototyping influences user centered design, presents critical review of two to three prototyping applications,

  Write a command to do an alphabetical sort on the third fiel

Write the command to run the file called 'process' assuming it is in your current directory, has execute permission, but that your current directory is not in the standard path command search list:

  Explain activities of business modeling discipline

Activities of business modeling discipline study the information needs of user, the ways in which those requirements are being.

  Compute the cost of sorting the relation in seconds

Suppose a flash storage device is used instead of disk, and it has a seek time of 1 microsecond and a transfer rate of 40 MB per second. Recompute the cost of sorting the relation in seconds with.

  Design a class named checkingaccount

Design a class named CheckingAccount that holds a checking account number, name of the account holder, and balance.include methods to set values for each data field and a method that displays all the account information. Create the class diagram a..

  Calculate interest earned in one year

Calculate the interest earned in 1 year given starting account balance B and annual interest rate I and supposing simple interst, that is no compounding.

  Explain daytime processing load

Assume daytime processing load consists of 60% CPU activityand 40% disk activity. Your customers are complaining that the system is slow. Which would you select to yield best performance improvement for least amount of money?

  Creating a hashing function

Suppose you are creating a hashing function to use for storing string data in hashtable. One Candidate hasing function would be to sum the ASCII or Unicode values for each character, and that result as the hashcode.

  Emerging market is using internet phone to replace pbx

Interesting emerging market is using Internet phone and company's high speed LAN to replace same company's PBX. Write a one page report on this issue.

  Evaluating average degree of a vertex for geometric graph

For random geometric graph, G(n, r), evaluate average degree of a vertex: at least distance r from boundary, on boundary (convex hull), and estimate time (big Oh) of determining all edges employing: all vertex pairs testing.

  A deck of playing cards in a card game

A deck of playing cards in a card game where cards may be drawn from, or discarded to, either the top or the bottom of the deck, but no access to cards in the middle of the deck is permitted.

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