Question: In Java, please put comments. Thank you Assignment 3 (HAS TWO Questions/programs) Question 1 ( 75 points ) Decision or Selection Structures and Loops (Decision

In Java, please put comments. Thank you  In Java, please put comments. Thank you Assignment 3 (HAS TWO
Questions/programs) Question 1 ( 75 points ) Decision or Selection Structures and
Loops (Decision Tree: If else if else loop) The fines for Speeding

Assignment 3 (HAS TWO Questions/programs) Question 1 ( 75 points ) Decision or Selection Structures and Loops (Decision Tree: If else if else loop) The fines for Speeding in one of the counties in Florida is given in the following table. Use if else if else decision structure. in court If the driver is driving greater than or equal to 35mph over the speed limit, fine is calculated as $0.00 and Court Mandatory message should be displayed as shown in the table above. Write a JAVA method to calculate the speeding fine speedFineCalcFirstname called from main. The variables in the program should be named as shown below and should be input by the user: speedLimitFirstname //(Speed Limit of the zone as an int) speedFirstname // (Speed of the vehicle as an int) driv_teenFirstname // ( A string data type) The question here is whether the Driver is a Teenager. The acceptable values are the following: teen, t, no or n. Prompt the user to enter only these four values as entry. If any other value is entered by the user tell the user that the input is invalid and use a while loop to make sure that the correct input is used. If the driver is a teenager (driv_teen value is teen or t ) whatever fine calculated from the above table is tripled ( 3 times the fine from the table above ). The program also should display the following message for each of the above cases as shown in the table below: (10) Display also should specify whether you are a Teenager or not. Your function should calculate the fine and also should do the display. Function should not calculate any fine if the driver is driving within the speed limit with a message. "You are a good Driver." Fines should be calculated using an if - else if - else decision structure and make it more efficient by not repeating code as much as possible. Display Message should be displayed using a Switch - Case decision structure. (Following are examples which you can use for testing. Please do not code for these values. Program should be always general.) \#Case 1: When Driver is not a teenager Speed Limit: 45 Vehicle speed: 57 Teen Driver: no Total Fine Calculated =$89.00 Display: Please reduce your speed ! \#Case 2: When Driver is Teenager Speed Limit: 45 Vehicle speed: 57 Teen Driver: teen Total Fine Calculated =$$267.00 Display: Please reduce your speed ! \#Case 3 : When Teenager is driving and a different vehicle speed Speed Limit: 45 Vehicle speed: 49 Teen Driver: t Total Fine Calculated =$118.50 Display: You can do better as a Driver ! \#Case 4: When Teenager is driving and a different vehicle speed Speed Limit: 45 Vehicle speed: 85 Teen Driver: t Total Fine Calculated =$0.00 Court Mandatory - Fine decided in court \#Case 3: When Teenager is driving and a different vehicle speed Speed Limit: 45 Vehicle speed: 49 Teen Driver: t Total Fine Calculated =$118.50 Display: You can do better as a Driver ! \#Case 4: When Teenager is driving and a different vehicle speed Speed Limit: 45 Vehicle speed: 85 Teen Driver: t Total Fine Calculated =$0.00 Court Mandatory - Fine decided in court Display: Fine has to be calculated by court. !! Question 2: ( 25 points) Write a program in JAVA nestedFirstname using nested loops that asks the user to enter a value for the number of rows to display. It should then display that many rows of pound signs, with one pound sign in the first row, two in the second row, and so on. For each row, the pound sign are succeeded by the number of dollar signs(\$) needed to make all the rows display a total number of characters equal to the number of rows user entered. A sample run would look like this: Enter number of rows: 5 #$$ \#\#\$\$\$ \#\#\#\$\$\$ \#\#\#\#NS \#\#\#\#\#\# This function is also called from the same main. 15 points is awarded for the header, comments, proper code indentation and efficiency of the code ( less repetition of code ) Submit the java program in one zip file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!