omarion83 omarion83
  • 02-04-2022
  • Computers and Technology
contestada


Write a program that asks the user to type 5 integers
and writes the average of the 5 integers. This
program can use only 2 variables.

Respuesta :

nunoz
nunoz nunoz
  • 03-04-2022

import Java.util*

public class Average{
public static void main(String [] args){

int sum = 0;
int numbers = 0;

for(int i = 0; i < 5; i++){
Scanner sc = new Scanner(System.in);
System.out.println(“Please enter your integers: “);
numbers = sc.nextInt();

sum += numbers;
}
System.out.println(“The average is: “ + sum/5)”
}
}
Answer Link

Otras preguntas

22/100 in simplest form?
12/2 as a whole number or mixed number
What is 28.09 to the nearest tenths
Which causes athlete’s foot?
write the ratio as a fraction in simplest form6ft to 4yd
The least common multiple of two numbers is 60, and one of the numbers is 7 less than the other number . What are the numbers ? Justify your answer
If a person earns $19,850 per year , estimate that persons hourly salary ..please give me details and how you rounded
In an examination there are four multiple choice questions with 3 options each, of which one option is the correct answer. In how many ways can a student answer
Tom doesn't really want to give away blue marbles and would like to change the probability that he chooses a blue marble to 1/10.How many marbles that are not b
What is the biggest states when it comes to total area and the number of citizens? Thanks for your answer!