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
Airida [17]
3 years ago
6

The following code does not work as intended. It is meant to input two test grades and return the average in decimal format: int

test1 = scan.nextInt(); int test2 = scan.nextInt(); double average = (test1 + test2 )/2; System.out.println("Answer: " + average);
Computers and Technology
1 answer:
yuradex [85]3 years ago
6 0

Answer:

To return average in Decimal we will use float datatype instead of double.

Explanation:

int test1 = scan.nextInt();

int test2 = scan.nextInt();

float average = (test1 + test2 )/2;

System.out.println("Answer: " + average);

You might be interested in
How does an individual's access to a wide range of online services affects their ability to operate safely in the digital world.
S_A_V [24]
Nothing online is safe anymore!!!! People and even the government can get hacked easily with today's technology.You can search someone easily on websites like Google or Facebook and even read someone's tweets on Twitter because their account is not private. But what's the point of saying private if they can easily get hacked by someone. There is no safety these days that is why you have to be careful with what you post on the internet in general.
6 0
3 years ago
You typed the word "weather" when you meant to type the word "whether." When will Writer or Word flag this as a misspelling or a
maria [59]

Answer:

It depends on the structure of the sentence.

Explanation:

This will be shown as grammatical mistake because both the spellings are correct. If we write the word weather instead of the whether, Ms word shows the grammatical mistake. This is because, if we want to write the word whether, we should use or in our sentence. Both of these words are comes together.

Example

I will take a leave whether its raining or not.

In above sentence, both whether and or comes together. If we write weather instead of whether it just show the grammatical mistake in the sentence.

4 0
3 years ago
Read 2 more answers
What is the name of the component that allows us to use electrical pulses in a computer?
alexdok [17]
The component your looking for is the system clock
5 0
4 years ago
List the 4 Fundamental Storage Technologies​
grigory [225]

Answer:

Magnetic Storage. Magnetic storage encodes data in patterns of positive and negative magnetic polarity on some magnetic medium like organic metal. ...

Optical Storage. Optical storage technology use laser/optical reflection phenomenon to read or write data. ...

Solid State storage.

Explanation:

Hope this help!!

8 0
3 years ago
Read 2 more answers
Why do organizations create multiple databases?
igomit [66]
Just in case one database gets hacked or crashes they have another to run on
5 0
4 years ago
Other questions:
  • Database designers typically do not add spaces in field names (LName), but can add details in the ________ field of the field pr
    12·1 answer
  • Give a recursive algorithm for finding the sum of the<br> first n odd positive integers.
    8·1 answer
  • When a person devises the idea for the venture, develops a business plan, uses savings or loans to acquire other resources and a
    9·1 answer
  • A new systems development project is Pete’s first experience as a project manager, and he has led his team successfully to the p
    13·1 answer
  • How does the post process alert the user if it detects a hardware problem during the post process?
    6·1 answer
  • Which statement compares the Autofill and Flash Fill features?
    9·2 answers
  • What is the output for the following code?<br><br> print (5*4+5)
    11·1 answer
  • What defines the scope of a project?
    5·1 answer
  • A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
    13·1 answer
  • Which protocol makes a connection, checks whether the data is received, and resends it if it is not?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!