Question
In Java Write a program that takes as input a single character and will print both the input letter grade and the appropriate comment to
In Java
-
Write a program that takes as input a single character and will print both the input letter grade and the appropriate comment to the screen according to the table. You need to handle both uppercase and lowercase letters.
Letter Grade | Comment |
A | Superior |
B | Good |
C | Average |
D | Just Passing |
F | Failure |
Any Other Grade | ERROR |
-
The following rules illustrate traditional economic policy theory in terms of regulating a governments economy.
-
If the annual growth rate is less than 1%:
-
-
If inflation is less than 3%, recommended economic policy is:
Increase welfare spending, reduce personal taxes, and decrease discount rate.
-
Otherwise, recommended economic policy is:
Reduce business taxes.
-
If the annual growth rate is greater than 4%:
-
If inflation is less than 1%, recommended economic policy is:
Increase personal and business taxes, and decrease discount rate.
-
If inflation is greater than 3%, recommended economic policy is:
Increase discount rate.
Write a program that applies these economic policy practices. More specifically, read in growthRate and inflation values and output the recommended economic policy for the given economic situation. If there is no recommended economic policy for the given economic situation, then output No change in economic policy.
-
(This problem 3a and 3b - is a stretch goal for those who finish early and want to challenge themselves. This problem is completely optional, so feel free to skip it.)
If you follow too close behind another car and that other car stops suddenly, you will not be able to stop in time, and you will crash into the rear of that other car. The following formula gives the distance between you and the car in front which allows you to stop safely:
-
Write a program which determines whether a vehicles tailgating distance is safe. The program should read in the speed of the vehicle and the vehicles tailgating distance. The program should then calculate the distance that would be required to stop the vehicle.
If the stopping distance is less than the tailgating distance, your program should print No problem. If the stopping distance equals the tailgating distance, your program should print Minor wreck. If the stopping distance is greater than the tailgating distance, your program should print Major wreck!.
Your program should mimic the sample session output:
Enter your speed (in mph): 60.0
Enter your tailgate distance (in feet): 240.0
Major wreck!
-
Note that the tailgating distance comparison uses equality for comparison. Since the probability of two real numbers being exactly equal is zero, if you use floating point numbers there will never be an input that produces a minor wreck. Modify the program so that it allows a range of uncertainty of plus or minus 20 feet, within which the result will be a minor wreck. Use a constant such as RANGE_OF_UNCERTAINTY.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started