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

While performing a stunt, Danger Dog rides his motorcycle off the edge of a cliff with a velocity of 32 m/s. If the cliff is 45 m high, how far from the base of
The graph shows the amount of petrol used, in litres, against distance travelled in miles. How many litres of petrol are used to travel 39 miles?
what are human resources?​
Tanong:1. Paano makatutulong ang "One Million Voice for Peace in the Philippines" sa pagsulong ng kapayapaan?​
Can someone help me please!
An example of a rectangular Prism can be: A globe or ball O Fish tank o Bowl Can​
¿Qué es el tiempo en el teatro?​
prove the following identity showing all steps:[tex]\frac{cos(x+30)-sin(x+60)}{sin(x)cos(x)} =-sec(x)[/tex]please help fast
The Declaration of Independence was meant to: a. build a lasting relationship with England as one big empire b. sever all governmental ties with England so that
Roland, Inc. provides residential painting services for three home building companies, Alpha, Beta, and Gamma, and it uses a job costing system for determining