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
A new company will have 40 workstations in one building sharing a single network. All users must be able to share ¬les and print
kobusy [5.1K]

Answer:

Domain Networking.

Explanation:

A domain in networking refers to any group of workstation,users,printers devices ,database servers and computers which share different type of data via resources of network.

Hence domain networking will be the best option for the company having 40 workstation in a single building sharing a single network.

6 0
3 years ago
; This program replaces the value in R0 with its absolute value. ; ; It does NOT modify any other registers! ; .ORIG x0200 START
olasank [31]

Using the knowledge in computational language in LC-3 Assembly it is possible to write a code that replaces the value in R0 with its absolute value

<h3>Writting the code </h3>

       .ORIG x0200

START

       AND R0, R0, #0  ; copy R0 to itself to set the condition codes based on R0;

                       ; i.e performing addition operation with Zero option to set the flags

       BRzp DONE       ; if R0 is NON-NEGATIVE, skip the negation (already correct);

                       ; Branch to DONE if number is poistive

       NOT R0, R0      ; R0 is negative, so negate it i.e taking 2's complement

       ADD R0, R0, #1  ; R0 = -R0 is performed successfully

DONE    BR START

       

       .END

See more about  LC-3 Assembly at brainly.com/question/12978370

#SPJ1

4 0
1 year ago
When you are given a set of tables and asked to create a database to store their data, the first step is to ________?
Vlad1618 [11]
Scan   the tables  to make a digital copy of them
6 0
3 years ago
Based on your prior knowledge, match each civilization to the region it occupied.<br>​
zhannawk [14.2K]

Answer: Inca- South America

Aztec - Meso America

Explanation:

7 0
3 years ago
Briefly describe the role of creativity and innovation to entrepreneurship​
prisoha [69]

Answer:

isia

Explanation:

Apooopooopeeepepe

8 0
2 years ago
Other questions:
  • A network technician has configured a point-to-point interface on a router. Once the fiber optic cables have been run, though, t
    12·1 answer
  • Malware that corrupts the target operating system in such a manner that a network defender can no longer trust the native OS is
    15·1 answer
  • How can a user preview the playback of an audio clip in PowerPoint? Use the drop-down menus to complete the statements.
    14·1 answer
  • Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Pleas
    11·1 answer
  • A technician has just installed a video card in a PC. The video card is not working, althoughit was working fine on the test ben
    6·1 answer
  • In C++ write a program that prints out PI as a type double and a type float EXACTLY as shown below. Your program should have ONE
    13·1 answer
  • 50 POINTS!!!!!!!!!!!<br><br> Give at least two examples of how the transport layer is used.
    13·2 answers
  • After reading his e-mail messages, Orlando became very frustrated. Many of the messages he received did not conform to netiquett
    6·1 answer
  • What does this mean? And how did I get it?
    12·2 answers
  • to provide for ecmascript compatibility in older browsers, you can use group of answer choices javascript shivs javascript shims
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!