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 role did the city of Wittenberg, Germany play during the Reformation? Why was it important during that time period?
I'll gib u brainliest if its correct!!!!1 and thanks and 5 star please help
Brainliest for correct answerWhat are 2 similarities of negative integers and complex numbers?
What is the unit rate for Mason's run and what does the unit rate mean in this situation?
although the university of georgia was chartered in 1787, in what year did the university actually begin holding classes?
Help pls i keep getting it wrong 9 divided by 38.79
1 The man cut down the tree.​
leftover parts of osteons that have been partially resorbed are called
According to the video which tasks are common for Chefs and Head Cooks? Check all that apply. -creating menu items -pricing menu items -washing dishes -serving
(10√2)(-√-90) Anyone know how to simplify that?