EXPLAIN HOW YOUR PROGRAM WORKS Write a program using WHILE loops. Use indentation well. O Provide helpful comments in the code. O Use variable names that give an indication of their use. O Ensure all variables have minimal scope When your program works, test it and check it ticks all the above boxes then have it assessed by a demonstrator. If you are having problems or don't understand the requirements ask for help. Train Count Write a program that is to be used to investigate how late trains passing through a given station are. The trains are so dire that virtually all trains seem to be running late. It should use a while loop to repeatedly ask the user to name the destination of the train that just departed. It should stop when the special code XXX is entered, and then give the total minutes late of all trains departed and which train was most punctual (ie least late). For example, one run might be as follows.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.3: Preliminary Three: Software Development
Problem 7E: (Statistics) This is the formula for the standard normal deviate, z, used in statistical...
icon
Related questions
Question

JAVA

Write a literate version of the code
O EXPLAIN HOW YOUR PROGRAM WORKS
O Write a program using WHILE loops.
O Use indentation well.
O Provide helpful comments in the code.
O Use variable names that give an indication of their use.
O Ensure all variables have minimal scope
When your program works, test it and check it ticks all the above boxes then have it assessed by a
demonstrator. If you are having problems or don't understand the requirements ask for help.
Train Count Write a program that is to be used to investigate how late trains passing through a given
station are. The trains are so dire that virtually all trains seem to be running late. It should use a while loop to
repeatedly ask the user to name the destination of the train that just departed. It should stop when the special
code XXX is entered, and then give the total minutes late of all trains departed and which train was most
punctual (ie least late). For example, one run might be as follows.
What is the destination of the train that just departed? Liverpool
How many minutes late was it? 7
What is the destination of the train that just departed? Newcastle
How many minutes late was it? 1
What is the destination of the train that just departed? Southampton
How many minutes late was it? 5
What is the destination of the train that just departed? Taunton
How many minutes late was it? 3
What is the destination of the train that just departed? XXXX
The trains were in total 16 minutes late.
The most punctual train was to Newcastle. It was 1 minute late.
HINT: Have variables that store the most punctual train seen so far and its destination. If more than one train
is equally punctual you may choose either.
Make sure you comment your program with comments that give useful information, use indentation
consistently and that your variable names convey useful information.
Transcribed Image Text:Write a literate version of the code O EXPLAIN HOW YOUR PROGRAM WORKS O Write a program using WHILE loops. O Use indentation well. O Provide helpful comments in the code. O Use variable names that give an indication of their use. O Ensure all variables have minimal scope When your program works, test it and check it ticks all the above boxes then have it assessed by a demonstrator. If you are having problems or don't understand the requirements ask for help. Train Count Write a program that is to be used to investigate how late trains passing through a given station are. The trains are so dire that virtually all trains seem to be running late. It should use a while loop to repeatedly ask the user to name the destination of the train that just departed. It should stop when the special code XXX is entered, and then give the total minutes late of all trains departed and which train was most punctual (ie least late). For example, one run might be as follows. What is the destination of the train that just departed? Liverpool How many minutes late was it? 7 What is the destination of the train that just departed? Newcastle How many minutes late was it? 1 What is the destination of the train that just departed? Southampton How many minutes late was it? 5 What is the destination of the train that just departed? Taunton How many minutes late was it? 3 What is the destination of the train that just departed? XXXX The trains were in total 16 minutes late. The most punctual train was to Newcastle. It was 1 minute late. HINT: Have variables that store the most punctual train seen so far and its destination. If more than one train is equally punctual you may choose either. Make sure you comment your program with comments that give useful information, use indentation consistently and that your variable names convey useful information.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,