yayalovebree
24.06.2020 •
Computers and Technology
Write a Java program that reads from the user four grades between 0 and 100. The program the, on separate ines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Make sure to properly label your output. Use escape characters to line up the outputs after the labels.
Solved
Show answers
More tips
- A Animals and plants 10 Tips for Growing Delicious and High-Quality Tomatoes in Your Garden...
- H Health and Medicine Tick Traps: How to Remove Them Safely and Effectively...
- F Family and Home How to Keep Your Home Warm: Tips and Tricks...
- C Computers and Internet How Much Does an iPhone Cost in America?...
- S Style and Beauty Discover the Art of Nail Design: How Do You Paint Your Nails?...
- F Food and Cooking Discover How to Properly Prepare Dough for Rasstegai...
- F Family and Home Ways to Attract Wealth into Your Home...
- G Goods and services Stock center - a modern way of optimizing logistics...
- F Family and Home How to Teach Your Child to Read?...
- F Food and Cooking How to properly cook shrimp: tips from professionals...
Answers on questions: Computers and Technology
- M Mathematics 2. In 1990, there were 1,200 cell phone subscribers in a small-town of Stephenville. The number of subscribers increased by 75% per year after 1990. How many cell phone subscribers...
- B Biology What should I do when my family makes fun of me because i have Entomophobia (fear of any insect) everytime i go outside and see a cicada or ladybug or something like that they said...
- P Physics Please help quick please it due soon...
- H History Enlightenment-era political philosophers such as Hobbes, Locke, Rousseau, and Montesquieu 1. rejected governmental policies that allowed the expansion of property rights 2. adhered...
- H Health Write down the qualities of good water...
- B Business What can a loud voice and fast-talking pace imply in nonverbal communication? A loud voice and fast-talking pace can imply in a person....
- E English JUST GIVE ME HATE JUST GIVE ME HATE JUST GIVE ME HATE JUST GIVE ME HATE JUST GIVE ME HATE JUST GIVE ME HATE JUST GIVE ME HATE...
- A Arts If u want to talk ig talk now cause today s my last day so hmf- T^T ao yeah...
- M Mathematics Im not good with math okay??...
- E English Type the correct answer in the box. Spell all words correctly. In the long run, are countries economy will be hurt by this. What is the second misspelled word in this sentence?...
Ответ:
import java.util.*;
public class Grade {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double[] grades = new double[4];
for (int i=0; i<4; i++){
System.out.print("Enter a grade: ");
grades[i] = input.nextDouble();
}
double lowest = grades[0];
double highest = grades[0];
double total = 0;
for (int i=0; i<4; i++){
System.out.println("Grade " + (i+1) + " is: " + grades[i]);
if(grades[i] >= highest)
highest = grades[i];
if(grades[i] <= lowest)
lowest = grades[i];
total += grades[i];
}
double average = total/4;
System.out.println("The highest grade is: " + highest);
System.out.println("The lowest grade is: " + lowest);
System.out.println("The average is: " + average);
}
}
Explanation:
Ask the user for the grades and put them in the grades array using a for loop
Create another for loop. Inside the loop, print the grades. Find highest and lowest grades in the grades array using if-structure. Also, add each grade to the total.
When the loop is done, calculate the average, divide the total by 4.
Print the highest grade, lowest grade and average.
Ответ:
educational attainment: 35 percent of the job openings will require at least a bachelor's degree, 30 percent of the job openings will require some college or an associate's degree and 36 percent of the job openings will not require education beyond high school.: