Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DR JAVA Write a program that includes the following while loops. Input radius (double) values and prints the diameter, circumference, and area of a circle.

DR JAVA

  1. Write a program that includes the following while loops.
    1. Input radius (double) values and prints the diameter, circumference, and area of a circle. The loop will stop executing when a 0 or negative value is entered. Declare a global constant for PI, where PI = 3.14159265. Be sure and echo the input and display all output to 3 decimal places.
    2. a second while loop that works as above, but instead asks the user if they want to enter radius (Y/N). What happens if you enter a negative radius?
    3. Input temperatures until 999 and print whether above or below freezing.
    4. Input temperatures until 999 and count number above and below freezing.
    5. Input temperatures until 999 and print the average temperature.
    6. Ask user if they want to enter a temperature and print whether above or below freezing.
    7. a while loop that repeatedly enters test scores (integer) (pick a sentinel) and counts the numbers of As, Bs, Cs, Ds, and Fs and also prints the average test score.

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

1. What are your creative strengths?

Answered: 1 week ago

Question

What metaphors might describe how we work together?

Answered: 1 week ago