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
Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
expeople1 [14]

Answer:

D. Attention getters

Explanation:

Based on the answers provided within the question it can be said that in both a speaking outline and a preparation outline you should include attention getters. These are important to include in both because it needs to be practiced and perfected in order to catch the audiences attention and hook them on to what you are saying.

4 0
3 years ago
What is one problem caused by spending too much time studying at your computer? A. It increases stress and negatively affects yo
nignag [31]

Answer:

A - It increases stress and negatively affects your sleep.

Hope that helps. x

4 0
2 years ago
Personal Web Page Generator Write a program that asks the user for his or her name, then asks the user to enter a sentence that
Fudgin [204]

Answer:

see explaination

Explanation:

The following code is in python 3.5 and above:

# Create a main method

def main():

# Accept name from the user

name = input("Enter your name: ")

# Accept describe yourself from the user.

describe = input("Describe yourself: ")

# Create a file object

f = open('person.html','w')

# Creat a string to store the html script.

message = """<html>

<head>

</head>

<body>

<center>

<h1>"""+name+"""</h1>

</center>

<hr/>"""+describe+"""<hr/>

</body>

</html>"""

f.write(message)

f.close()

main()

7 0
3 years ago
Help!!!
Butoxors [25]

Answer:

ummmm try the inequality protragathron theorum

Explanation:

ok

3 0
3 years ago
The gene form of a trait is called a(n) ​
Rom4ik [11]

Answer:

alleles

Explanation:

7 0
3 years ago
Other questions:
  • Which sentences in the passage show the preventive measures to avoid data breach?
    9·1 answer
  • Raeball was a lovin doll. And she spoke her mind as she stood tall. She made you special and loved. You're missed by so many. An
    10·2 answers
  • Which searching method requires that the list be sorted?
    5·1 answer
  • What is the internet?
    5·2 answers
  • To make IPv4 addresses a little easier for human beings to understand, the 32-bit binary addresses are represented by dotted dec
    9·1 answer
  • The introduction of new information technology has a: A. dampening effect on the discourse of business ethics. B. waterfall effe
    14·1 answer
  • If your TV was showing a flat black or blue screen, or had "snow", what steps would you take to fix it?
    13·1 answer
  • What part of the meat help you identify the less tender cuts​
    13·1 answer
  • H e l p ASAP plz <br> and thanks
    9·1 answer
  • Resource _____ let you view, manage, and automate tasks on multiple aws resources at a time.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!