42.9k views
1 vote
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. 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.
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?
Input temperatures until 999 and print whether above or below freezing.
Input temperatures until 999 and count number above and below freezing.
Input temperatures until 999 and print the average temperature.
Ask user if they want to enter a temperature and print whether above or below freezing.
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.

User Sekomer
by
3.6k points

1 Answer

3 votes

Answer:

Step-by-step explanation:

The following code is all written in Java. It is a very long program that contains methods for all of the requested while loops in the question. Each one is called inside the main method itself. A part of the output is shown in the attached picture below due to the output being so long. Due to technical difficulties, I have attached the code as a txt file below.

DR JAVA Write a program that includes the following while loops. Input radius (double-example-1
User Michal Olszowski
by
3.8k points