Calculate the passage of time

Assignment Help Computer Engineering
Reference no: EM132101310

There are plenty of examples of this project where the user is prompted to enter the time. However, this one wants the times READ from a .txt FILE and a formatted output .txt file. Any help would be great as I cannot figure reading data in and pushing it out.

Your task is to write a program that simulates a parking meter within the parking deck. The program will start by reading in the time from a file that a car arrives in the parking deck. Next it will read in the time the car left the parking deck. You should then calculate the time that has passed between issuing the time ticket and the time the car left. Lastly, you will use this information to determine how much the person needs to pay upon leaving the deck. The rates are in the table below. Please read through all of the notes below!

You should write a single function for each of the following things:

Reading in the arrival times and departure times from a file

Calculate the passage of time

Determine how much the driver needs to pay

Print out the information for each driver in a report format, including his Run number, arrival and departure times, time in the deck, and how much he owes. Be sure to include the exceptions of a Lost Ticket, Special Parking Pass, and Error (over 12 hour stay).

Column Headings to be printed once at the beginning of the program - see format below.

Notes:

Time should be handled in the 24 hour format for simplicity. In addition, you should have the user input the hours, then input the minutes as two separate variables. Please have the user enter hours ranging from 0 to 23, and minutes ranging from 0 to 59.

You may assume that the parking deck is open 24/7 for simplicity. You do not need to worry about times the deck closes for this project.

If the driver has a special parking pass, the program will read in the time of 99 for the hour and 99 for the minutes when entering the deck. This should be used as a code for the system to know that this person has a special parking pass.

If the drive has lost their ticket, the program will enter the input of 55 for the hour and 55 for the minutes when exiting the deck. This will prompt the system to handle the payments without a ticketing stub.

Please make sure that the output is attractive and informative. It should include, but is not limited to: the time the ticket was issued the time the ticket was entered back into the machine (time the driver exited the deck.) You should also include the amount of time that transpired while the driver was in the deck and the amount of money the driver has to pay. Please use proper formatting techniques for output (fixed and set precision, remember we are talking about money.) Use the output format given below in Running.

Rate Table:

Time in Parking Deck

Rate in Dollars ($)

Less than or equal to 30 minutes

3.00

30 Minutes <= 1 Hour

5.00

1 Hour <= 2 Hours )

10.00

2 Hours <= 3 Hours )

15.00

3 Hours <= 4 Hours )

30.00

Each half hour over four hours and <= 12 hrs

30.00 + 5.00 per additional half hour or part thereof

12 Hours < 24 Hours )

Error prints out, see notes above.

Lost ticket

110.00

Special Parking Pass

5.00

Running:

Please run the following sets of data, using this format for the output:


Entrance Hour

Entrance Minute

Exit Hour

Exit Minute

Total Minutes or Hours and Minutes

Price for Parking

Run 1

00

00

00

30



Run 2

05

45

07

00



Run 3

06

32

09

54



Run 4

09

15

12

15



Run 5

09

32

14

35



Run 6

08

00

10

30



Run 7

08

45

55

55

LOST TKT


Run 8

99

99

99

99

SPECIAL


Run 9

9

10

23

30


ERROR

Run 10 Extra Credit

17

0

4

0



Submitting:

Face-to-face students; please include this document at the front of your project folder. This should be followed by the algorithm for your program, source code, and your output. Lastly, please include your signed Academic Honesty Promise. Please print all of these and clamp them into your project folder. Turn it in on the due date.

Online students should submit the algorithm, the source code, the output, your signed Academic Honesty Promise, and the input data file. All of this should be in a zipped folder.

Extra Credit (5 points):

What happens if you were to arrive at 5:00 PM and leave at 4:00 AM? Would your program still run this correctly? Make sure that you can account for this sort of issue. Add data to test this situation.

Reference no: EM132101310

Questions Cloud

Describe the role and components of the pmo : Describe the role and components of the PMO and why it is critical to the success of the project.
Assign the access keys to the text box and buttons : Write a short summary of the following assignment noting where applicable any VB.NET features that were highlighted by this program.
How many blocks are accessed in order to perform : Consider a RAID level 5 organization comprising five disks, with the parity for sets of four blocks on four disks stored on the fifth disk.
Provide the number of iterations used in your calculation : Provide the number of iterations used in your calculation and the relative error between the graphical estimate and the obtained solution .
Calculate the passage of time : Print out the information for each driver in a report format, including his Run number, arrival and departure times, time in the deck.
Represents a product term in the function : Represents a product term in the function and pull a line from each rectangle to specify the corresponding term.
Write a program to find a cluster editing solution : Write a program to find a cluster editing solution of size k or less on a (not necessarily connected) undirected, unweighted graph.
Write a program that reads student scores : Write a program that reads student scores, gets the best score (BestScore), and then assigns letter grades.
Design an information website : Design an information website that presents an overview of the uses, technologies, benefits, and concerns of augmented reality.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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