Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

  1. 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

  1. The following rules illustrate traditional economic policy theory in terms of regulating a governments economy.

    1. 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.

  1. 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.

  1. (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:

  1. 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!

  1. 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

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

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago