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
Are the blank space around the edges of the page
Law Incorporation [45]

Answer:

The blank space around the edges of a sheet of paper — as with the page of a book — that surrounds the text is called the margin.

8 0
2 years ago
Algebraic concepts that include certain words and phrases and
Veseljchak [2.6K]

Answer:

Boolean Operators

Explanation:

When performing a boolean search, boolean operators allow users to combine keywords with operators (or modifiers) such as AND, NOT and OR to further produce more relevant results.

The boolean operators AND and OR are used to include certain words and phrases during the search while the  boolean operator NOT is used to exclude certain words and phrases.

6 0
3 years ago
How do individuals differ in terms of their ability to process information?
Alla [95]
Oh that is easy first they differ the therms of their ability and that helps them process the information ( sorry for doing that lol)
5 0
3 years ago
In this task, you will perform normalization on a crude table so that it could be stored as a relational database.
ryzh [129]

Answer:

Check the explanation

Explanation:

(1.) The functional dependencies based on assumptions are as follows:-

Trip determines which staff was there in the trip, the car used for the trip, the quantity of fuel used in the trip, the fill up time and the total paid of the trip.

Service station refers to its address

Car details consist of the details of license plate, odometer reading and the fuel type used in the car

fuel type and the fill up time will help to determine the cost of the fuel at that time

cost of the fuel and the quantity of fuel used will determine the total paid

From the above assumptions the functional dependencies are as follows:-

Trip ID -> Staff Name, Car Details, Service Station, Quantity, Fill Up Time, Total Paid

Service Station -> Station Address,

Car Details -> License Plate, Odometer reading, Fuel Type

Fuel Type, Fill up Time -> Cost per litre

Cost per Litre, Quantity -> Total Paid

(2.) Initially the relation is as follows:-

R (Trip ID, Staff Name, Car Details, License Plate, Odometer Reading, Service Station, Station Address, Fill up Time, Fuel type, Quantity, Cost per Litre, Total Paid)

For 1 NF there should not be composite attributes,in the above relation Staff Name and Station Address are composite attributes therefore it will be decomposed as follows:-

R (Trip ID, Staff First Name,Staff Last Name, Car Details, License Plate, Odometer Reading, Service Station, Street, City, State, Zip Code, Fill up Time, Fuel type, Quantity, Cost per Litre, Total Paid)

For 2 NF there should not be partial dependency that is non prime attribute should not dependent upon any 1 prime attribute of candidate key, since in the given relation there is only 1 candidate key which is only Trip ID, therefore the relation is already in 2 NF.

For 3 NF there should not be transitive dependency that is non prime attribute should not dependent upon the other non prime attribute, if it is present then the relation will be decomposed into sub relations, the given relation is not in 3 NF therefore it will be decomposed as follows:-

R1 (Trip ID, Staff First Name, Staff Last Name, Car Details, Service Station, Quantity, Fill up time, Total paid)

R2 (Service Station, Street, City, State, Zip Code)

R3 (Car Details, License Plate, Odometer reading, Fuel Type)

R4 (Fuel Type, Fill up Time, Cost per litre)

R5 (Cost per Litre, Quantity, Total Paid)

(3.) After the 3 NF we add the primary and foreign key constraints as follows:-

R1 (Trip ID, Staff First Name, Staff Last Name, Car Details, Service Station, Quantity, Fill up time, Total paid)

R2 (Service Station, Street, City, State, Zip Code)

R3 (Car Details, License Plate, Odometer reading, Fuel Type)

R4 (Fuel Type, Fill up Time, Cost per litre)

R5 (Cost per Litre, Quantity, Total Paid)

In the above relational schema the primary keys are represented with bold and foreign keys by italic

(4.) The ER diagram of the above relational schema using crow's foot notation are as shown in the attached image below:-

5 0
3 years ago
Identify science and technology policies that could be adapted or implemented in the Philippines?​
mina [271]

Answer:

In the Philippines, universities dominate the research arena. So you have scientists who make research for the sake of research.

The private sector may or may not adopt the research. If a research in UP finds a molecule that may kill cancer, we are not sure whether that research will be adopted or not.

We are not sure if that research will be continued to actual creation of a medicine of cancer. This is because our scientists are working in universities and not in actual pharma companies.

In other countries, the scientists build their own companies. So their research go from drug development to actual manufacturing and marketing of medicines.

So when they start a research, you know that in the next 5 to 10 years, these scientists will produce drugs which the public can benefit from.

This is why the Philippine research is not thriving as it should. Our government should support our start ups.

When scientists are given grants for research, they should also be given grants to start their company. Unfortunately, start up grant is not a function of the DOST. It is of the DTI.    

Explanation:

6 0
2 years ago
Other questions:
  • You use a(n) ____ variation when a use case is less specific than others, and you want to be able to substitute the more specifi
    8·1 answer
  • The negotiators past relationship will affect current behavior if the parties
    12·1 answer
  • What is the output of the following function if the array nums contains the values 1 2 3 4 5 int backwards(int nums[]) { for (x
    15·1 answer
  • In a Windows environment, __________ is a powerful tool that enables security administrators to share user and group definitions
    10·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • What is one of the first power tools you’ll need as electrician
    15·1 answer
  • Image
    9·1 answer
  • What is an insertion point?
    6·1 answer
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • ____ is an example of a set of prewritten classes that allows you to access data stored in a database.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!