subject

There are two prompts below. for the first prompt, you will be implementing a stack and for the secondprompt you will be implementing a queue. you will be creating functions only.0 points if you do not do the following: 1. you must implement one prompt using an array (using a struct-refer to classcode) and the other using alinked list.2. all functions dealing with operations on the stack and queue (like push, pop, enqueue, is_full etc) shouldbe kept in the stack_queue7 files. these operations should be called in your functions created below. feelfree to modify operation functions given in class or create your own.3. all functions created for the prompts (four below) should be kept in the hw7 files. prompt 1 (40 points): jameel works at a restaurant where all servers put their tips into a tip jar for the night. at the end of thenight, each server gets two dollars for each hour they worked. a) function 1: create a function that allows users (servers in this case) to continuously enter tips made until eitherthe stack is at full capacity or the word done is entered (meaning the night is over). the tip jar shouldbe implemented as a stack. choose any parameters and return values you find necessary. a possible function run might look like: ***tip jar***enter tip: $15.95enter tip: $5.00enter tip: $10.50enter tip: doneb) function 2create a function that calculates the amount the user makes. choose any parameters and return values……you find necessary. a possible function run might look like: hello, how many hours did you work? 6ok, giving you $12.***tip jar (updated)***enter tip: $15.95enter tip: $3.50 /*notice the leftover money is put back in the tip jar*/prompt 2 (40 points): natalya works at an airline counter. all the customers she deals with for the day are kept in a file in theformat first name, last name, flight number (for example: jon, doe,3434). you may find it useful to create asample file to test your program. the list of all customers and their corresponding flight numbers shouldbe implemented as a queue. a) function 3create a function that reads in file info into a queue (assume that the number of lines in the file is….always less than the capacity of the queue). the first and last name should be held in a pointer called….full_name and the flight number should be held as an int. choose any parameters and return values you….find necessary. a possible function run might look like: --adding in customer info from file: jon doe – 3434jane doe – 3434bob doe – 8934bill doe – 1234don doe – 9393frank doe – 1234all customer info added. b) function 4create a function that allows the user to check which customers are taking a specific flight (the flight… you are checking should be a parameter to the function). the customers taking this flight……should be printed to screen and placed into a file (see below). choose any additional parameters and……return values you find necessary. a possible function run might look like: --passengers for 1234: bill doe is taking flight 1234. /*notice bill doe is handled first since we are dealing with a queue*/frank doe is taking flight 1234.(the output file should contain the same information printed to screen).do not forget to indent (10 points) and includecomments (10 points).

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, Geo777
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
image
Computers and Technology, 23.06.2019 05:20, reeeeeee32
What did creator markus “notch" persson initially call his game
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, kodak0531
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, ahmedeldyame
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
You know the right answer?
There are two prompts below. for the first prompt, you will be implementing a stack and for the seco...

Questions in other subjects:

Konu
Mathematics, 04.12.2020 18:10