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

I don’t think I’m doing the top correctly. Could you help 7-10?
how many sections of music does binary from have?​
8x -5(x - 1) = 4(x + 2) solve for x, and show work please.
5x−2y=305, x, minus, 2, y, equals, 30 Complete the missing value in the solution to the equation. (8,(8,left parenthesis, 8, comma ))right parenthesis
help please this is hard
ANSWER THIS QUESTION FAST AND I WILL GIVE YOU BRAINLEST1.The graph shows two lines, M and N. How many solutions are there for the pair of equations for lines M
What are the main causes of deforestation? Check all that apply!! A) air pollution B) mining C) cattle ranching D) water pollution E) logging
How do I convert 5pie over 12 into degrees
What is the slope of the line?
How to know about year of artifact