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
Butoxors [25]
4 years ago
12

Suppose that the variables grade1, grade2, and grade3 are declared as follows:

Computers and Technology
2 answers:
wel4 years ago
6 0

Answer:

Option B (grade1 + grade2 + grade3) / 3.0

Explanation:

The most accurate result is calculated by the expression given in the option B.  This is because all the <em>grade1</em>, <em>grade2</em> and <em>grade3</em> variables are integer type and therefore we need to add a decimal point after divisor (e.g. 3.0) so that the decimal points of the result can be preserved.

For example:

(88 + 92 + 83) / 3.0  should result in 87.66666666666667

If we do  (88 + 92 + 83) / 3, the decimal points are truncated to 87.

The expression in option c, (double)((grade1 + grade2 + grade3) / 3), will result in 87 as the  (grade1 + grade2 + grade3) / 3 will be evaluated first prior to converting into double type.

The expression in option d and e are inaccurate as they don't calculate average of the three variables.  

Mnenie [13.5K]4 years ago
5 0
A; you have to add the grades to have the total and then divide by 3 because there are 3 variables. 
You might be interested in
During critical thinking, the evaluation of information should use
nexus9112 [7]
False any critical thinking shouldn’t involve emotions
6 0
3 years ago
Read 2 more answers
For an IP or device that is in the local network, it's a very straight forward cache table lookup for its MAC address. How does
astra-53 [7]
It doesn't really. The address is recognized as off the local network, so at the IP layer the packet is sent to the router, whose address is in the ARP table. As the packet travels to different hops, the MAC address is updated to the next hop.
8 0
4 years ago
When parallel parking, you should select a space that is __________ as long as your car.
Shtirlitz [24]

that is Equally as long as your car


7 0
3 years ago
The intranet is the same as the internet. true false
galina1969 [7]
False, the intranet <span> does not refer to a network that supports communication between different organizations.</span>
5 0
3 years ago
Read 2 more answers
A(n) __________ is a common list operation used in programming. its purpose is to iterate through a list of items, one item at a
Nataliya [291]
I would say C- Priority List.
I hope this helps! :)
5 0
3 years ago
Other questions:
  • It is not possible to use keywords to search for themes
    5·1 answer
  • I want to message someone on Brainly but it wont let me. How many questions do I need to answer before I could message?
    12·2 answers
  • Consider the function definition void Demo( int&amp; intVal, float floatVal ) { intVal = intVal * 2; floatVal = float(intVal) +
    7·1 answer
  • “When using a public computer for browsing the Internet, try to use for 1.________ transactions. Also, use 2.__________ browsing
    10·2 answers
  • Darian has a gourmet cupcake business and needs a website to compete with the other bakeries in his area. He has a Google My Bus
    15·1 answer
  • Carol typed a memo to distribute to everyone in her department. To create this memo, she used a _____. spreadsheet word processo
    8·2 answers
  • You have a large text file of people. Each person is represented by one line in the text file. The line starts with their ID num
    5·1 answer
  • Which of the following activities would be best-suited for a thinking mind map?
    10·2 answers
  • What is lossless compression
    6·2 answers
  • Dealing with stress and strong emotions centeral idea​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!