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

Miscommunication example of listening
. Expressed as a decimal, 2/11 would be ?​
2.1.2 Make use of the distance formula to determine the length of PQ​
What are the statutory requirements for a pour-over gift into a trust? a) No requirements b) Must be in writing c) Must be notarized d) Requires court approval
express x in terms of a and b x/a+1=b
If you were Jefferson’s editor, how would you rewrite the Declaration of Natural Rights part of the document for modern readers?
Find the difference quotient f(x+h)-f(x)/h, where h≠0, for the function below. f(x) = -4x² + 3x-5 Simplify your answer as much as possible.
What is the standard form for 6,570,000
Claims form a compound Poisson process with =2 and individual claim density function f(x)=e 2x + 23 e 3x ,(x>0) (i) Find p 1 (ii) If a safety loading of 80%
HELPPPPPPPPPP PLEASEEEEEEEE!!