Drivers are concerned with the mileage their automobiles get. One driver has kept track of several tankfuls of gasoline by recording the miles driven and gallons used for each tankful. Develop a C# application that will input the miles driven and gallons used for each tankful.

Apply the following procedure for solving ALL the TMA problems

  1. Read and analyze the problem statement.
  2. Formulate the algorithm using pseudocode and assume any required missed data reasonably.
  3. Write a C# application.
  4. Test, debug and execute the C# application.
  5. Run each problem twice with different data sets.
  6. Copy and paste your code from Visual Studio to the Answer Booklet (don’t put your code as a screenshot).
  7. Provide Screenshots for both the input and output of each data set.
  8. Your TMA Answer Booklet should be structured as follows:
    1. Problem # 1: (Gas Mileage Calculator)
  • Algorithm pseudocode
  • Complete problem’s application code (Copied)
  • Experiment number 1 (Screenshots of both input and output)
  • Experiment number 2 (Screenshots of both input and output)
  1. Problem # 2: (Airline Reservations System)
    • Algorithm pseudocode
    • Complete problem’s application code (Copied)
    • Experiment number 1 (Screenshots of both input and output)
    • Experiment number 2 (Screenshots of both input and output)

 

Distribution of Marks
Requirement Mark
Algorithm pseudocode 20%
Correct calculations formulas 20%
Testing using different data sets 20% (10% for each data set)
Valid report format 5%
Running application 35%

 

 

 

Problem # 1: (Gas Mileage Calculator) [25 marks]

 

Drivers are concerned with the mileage their automobiles get. One driver has kept track of several tankfuls of gasoline by recording the miles driven and gallons used for each tankful. Develop a C# application that will input the miles driven and gallons used for each tankful. The application should calculate and display the miles per gallon obtained for each tankful and display the total combined miles per gallon obtained for all tankfuls up to this point. Additionally, the application should categorize and display the consumption rate of gasoline as follows:

  • Low, if the total miles per gallon is greater than 30.
  • Normal, if the total miles per gallon is between 20 and 30.
  • High, if the total miles per gallon is less than 20.

All averaging calculations should produce floating-point results. Display the results rounded to the nearest hundredth.

 

Sample I/O

 

Enter the gallons used (-1 to end): 20

Enter the miles driven: 200

The miles/gallon for this tank is: 10.00

This is equivalent to :

 

Enter the gallons used (-1 to end): 5

Enter the miles driven: 120

The miles/gallon for this tank is: 24.00

 

Enter the gallons used (-1 to end): 10.50

Enter the miles driven: 150

The miles/gallon for this tank is: 14.28

 

Enter the gallons used (-1 to end):  -1

 

The overall average miles/gallon is: 13.23

The overall consumption rate is : High

 

 

 

 

Problem # 2: (Airline Reservations System) [35 marks]

 

A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You’re to write an application to assign seats on each flight of the airline’s only plane (the capacity of the plane is 10 seats of the same class). The flight ticket costs 500 $. Use a one-dimensional array of type Boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. The user can choose his seat number (from 1 to 10) if it is available. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your application should never assign a seat that has already been assigned. The baggage allowance is a single bag of 10 kg. Each extra kg is charged with 5 $. However, the weight of the bag should never exceed 20 kg. The reservation request of the customer should be rejected if his chosen seat number is not available and/or his baggage exceeds 20 kg and justified rejection message(s) should be alerted to the customer. Otherwise, a confirmation message that contains the customer’s seat number, extra weight fees, and total fees is alerted. The reservation process should continuously run for other customers until the user of the application explicitly ends it. At the end of the application, a summary of the number of reserved seats with total income should be alerted to the user.

 

Sample I/O

 

Enter seat number (-1 to end): 1

Enter the weight of the bag: 15

 

Reservation is confirmed for seat no. 1

Fees of extra weight: 25 $

Total fees: 525 $

 

Enter seat number (-1 to end): 2

Enter the weight of the bag: 10

 

Reservation is confirmed for seat no. 2

Fees of extra weight: 0 $

Total fees: 500 $

 

Enter seat number (-1 to end): 1

Reservation cancelled due to unavailable seat number

 

Enter seat number (-1 to end): 3

Enter the weight of the bag: 25

 

Reservation cancelled due to unallowed baggage weight

 

Enter seat number (-1 to end): -1

 

The flight has 2 reserved seats with total income 1025 $

 

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!