Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Visual Studio 2019 Question #1: Speed System Program (6 pts) In this question, you will write a program that determines the penalty of a

Using Visual Studio 2019

image text in transcribedimage text in transcribedimage text in transcribed

Question #1: Speed System Program (6 pts) In this question, you will write a program that determines the penalty of a driver who is speeding on highway with the speed limit of 100km/h based on Ontario Courts. Your program should follow the following rules: Prompt the user to enter name, id and score and validates the information. The student name should be entered as LastName, FirstName (separated by comma). Please note the whole name should be saved in one string. The driver ID must have 7 digits. The driver's SPEED must greater than 0. If the user enter correct information, your program should display the fine based on the speed. When the fine is displayed, the output should be "FirstName LastName got SPEED. Based on the speed system, FirstName (ID) will pay X. Please note the calculation of X is based on the following rules: - A $2.50/km speeding fine for 1-19km/h over the speed limit. - A $3.75/km speeding fine for 20-29km/h over the speed limit. - A $6.00/km speeding fine for 30-49km/h over the speed limit. - 50+km/h over the speed limit comes with a court decided fine. Your program should be able to ask user for new input of driver's information for penalty until get the input Yes from the user. Display welcome & closing messages. The following are sample screen shots to illustrate the expected behavior of your program. Your program must display the same information with the same format. User input at the keyboard is marked with a red circle. Welcome to Speed System Program! Please enter your name (Lastname, Firstname seperated by comma): Liu, Tom Please enter your ID without any spaces (7 digits): 9090901 Please enter your speed: 110 Tom Liu got 110. Based on the speed system, Tom (9090901) will pay $25 Exit the program? (enter Yes to exit): No Please enter your name (Lastname, Firstname seperated by comma): Hans, Lucy Please enter your ID without any spaces (7 digits): 2314512 Please enter your speed: 125 Lucy Hans got 125. Based on the speed system, Lucy (2314512) will pay $93.75 Exit the program? (enter Yes to exit): No Please enter your name (Lastname, Firstname seperated by comma): Thame, Lin Please enter your ID without any spaces (7 digits): 2345678 Please enter your speed: 90 Lin Thame got 90. Based on the speed system, you do not need to pay any fine!! Exit the program? (enter Yes to exit): Yes Thank you for using Speed System Program! Welcome to Speed System Program! Please enter your name (Lastname, Firstname seperated by comma): Derek,Hulo Please enter your ID without any spaces (7 digits): 123 Please enter your ID without any spaces (7 digits): 1234567 Please enter your speed: 180 Hulo Derek got 180. Based on the speed system, the court will decide your fine!! Exit the program? (enter Yes to exit): No Please enter your name (Lastname, Firstname seperated by comma): Chen, Lily Please enter your ID without any spaces (7 digits): 2131412 Please enter your speed: 120 Lily Chen got 120. Based on the speed system, Lily (2131412) will pay $75 Exit the program?(enter Yes to exit): Yes Thank you for using Speed System Program! Figure 2 Sample output of Question#1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions