1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paladinen [302]
3 years ago
15

Write a program that reads three whole numbers and displays the average of the three number. Sample Run #: java Average3 Interac

tive Session.
1. Enter the first integer: 8
2. Enter the second integer: 10
3. Enter the third integer: 18
The average of 8, 10, and 18 = 12.0.
Computers and Technology
1 answer:
Maksim231197 [3]3 years ago
4 0

Answer:

The program to this question as follows:

Program:

import java.util.*; //import package

class Average //defining class Average

{

public static void main(String[] args) //defining main method

{

int a1,b2,c3;//defining integer variable

float avg; //defining float variable

Scanner obz=new Scanner(System.in); //creating scanner class object

System.out.print("input first number: "); //print message

a1=obz.nextInt(); //input value by user

System.out.print("input second number: "); //print message

b2=obz.nextInt(); //input value by user

System.out.print("input third number: "); //print message

c3=obz.nextInt(); //input value by user

avg=a1+b2+c3/3; //calculating average

System.out.print("The average of "+a1+","+b2+",and "+ c3+"="+ avg);//print value    

}

}

Output:

input first number: 8

input second number: 10

input third number: 18

The average of 8,10,and 18=24.0

Explanation:

In the above code, a class "Average" is defined inside this class the main function is declared in this method three integer variable "a1, b2, and a3" is declared, which input the value from the user side. in this method, a float variable avg is defined that calculates its average value.

  • In the next step, a scanner class object is created, that uses the above integer variable values.  
  • In the "avg" variable add all integer variables then divide its value by 3. At the print, method is used that prints avg variable value.
You might be interested in
What word describes a violation of copyright laws? What rights do copyright holders have over their work of art
lesya [120]

breech

malefaction

misdoing

offence

transgression

8 0
3 years ago
Read 2 more answers
What is the different between information and data
Scorpion4ik [409]

Answer:

Information is the act of imparting knowledge and data is the recorded observation that are usually presented in a structured format

6 0
3 years ago
U
beks73 [17]
8wmX si2 jkkajmid di e2 2i2
3 0
3 years ago
This operating system was used by individual computers and required users to type commands.
In-s [12.5K]

Answer:

MS-DOS is your answer

Explanation:

6 0
3 years ago
To find the ____, the net present value of the system is calculated by combining the net present value of the costs of the syste
Diano4ka-milaya [45]

Answer: c) Return on investment (ROI)

Explanation:

Return on investment (ROI)  is defined as term that measures the performance of single investment efficiency or numerous investment plans. It evaluates and assess plan of investment in form of ratio or percentage.

  • Return of investment(ROI) plan is calculated through dividing the return of investment by investment cost.
  • Other options are incorrect because cash return on capital invested ,carried forward(CF) and BI (business intelligence) are not used for calculating the investment plan through cost and benefit.Thus, the correct option is option(c)
8 0
3 years ago
Other questions:
  • Find the cell address of first column and last row some one pls answer :'(​
    9·1 answer
  • An _________ is a phrase formed from the first letters of words in a set phrase or series of words a. Acronymic sentence c. Basi
    7·2 answers
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • Your computer has gradually slowed down. What's the most likely reason?
    8·1 answer
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • The decimal number 3 is ___ in binary the 2s column plus the 1s column.
    11·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • A _____ can be used to create and test prototypes, develop interfaces, and simulate factory layouts and assembly lines, without
    10·1 answer
  • What should be entered to make the loop print
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!