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

What powers are shared between the President and Congress on the foreign affairs powers?
In the figure below, m∠LMP = 100°. screenshot What is the value of x? a. 61 b. 39 c. 23 d. 17
Jim is putting carpet in his basement. The length of his basement is 12 yards. How many feet is the length of his basement?
menstruation is a normal process in the life of every woman.As a boy or a girl do you appreciate it?​
what is proof?where/when/how was it created?How is it used?​
examples of expression​
the tempature was 80.F and then fell 20.F
help help help Step 1: Look at the video click on the link below (Links to an external site.) The Story of Silk Roads (Links to an external site.) Step 2: Now t
I’m posting too many Solve each equation 51/2=d +1/4 what is d?
Momentum is mass times velocity, so another way to think of momentum is ____ in motion. inertia weight acceleration velocity