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]
3 years ago
12

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

Computers and Technology
2 answers:
wel3 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]3 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
How do you determine latitude using an astrolabe?
miv72 [106K]
This was really useful in determining one's location during the times when technology wasn't that advanced yet. First is that it depends as to what time of the day is it being used. If used at day, most probably at high noon, the altitude of the sun would be measured and recorded and/or remembered. Most of the times, the latitude is determined during the day since it is much easier. At night, a star of known declination will be substituted to the sun. Most of the times, the North Star is used. Then, an almanac will be utilized to determine the declination of the Sun or the star, depending on which was used. After which, the formula is applied, which is latitude = 90 degrees - measured altitude +declination.
3 0
3 years ago
Using the scenario below, answer the following questions:
4vir4ik [10]

Answer:

Here is code in java.

import java.util.*;

class Main

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

         boolean flag=false;

         int total_mile=0;

         double avg_mile;

       // part 1, create and initialize array

       int inp[]={2,5,9,11,13,17,20,22,24,26};

       

       System.out.print("miles ran per week: ");

       // print the miles per week of train

       for(int x=0;x<10;x++)

       {

       System.out.print(inp[x]+" ");

       }

        System.out.println();

       //part 2, print the value of index 2 in the list

       System.out.println("value at index 2: "+inp[2]+" miles");

       //part 3, find length of array

       System.out.println("list length: "+inp.length);

     

       // part 4, calculate total mile and average

       for(int y=0;y<10;y++)

       {

       total_mile=total_mile+inp[y];

       }

       System.out.println("total miles ran: "+total_mile+" miles");

       

       avg_mile=total_mile/10.0;

       System.out.println("average no of miles ran= "+avg_mile+" miles");

       

     // part 5, check 4 exist in the list or not

       for(int k=0;k<10;k++)

       {

       if(inp[k]==4)

       {

       flag=true;

       break;

           }

       }

           if(flag)

           System.out.println("4 exist in the list.");

           else

            System.out.println("4 doesn't exists in the list.");  

       

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create and initialize array with list value equals to 2 and maximum value 26. Print the miles of each week.Then find the value of miles at index 2 in the list.Next find the length of the array and print it.Calculate total miles ran of 10 weeks.Then calculate the average miles by dividing the total with 10. In the array, check 4 exist or not.

Output:

miles ran per week: 2 5 9 11 13 17 20 22 24 26                                                                            

value at index 2: 9 miles                                                                                                  

list length: 10                                                                                                            

total miles ran: 149 miles                                                                                                

average no of miles ran= 14.9 miles                                                                                        

4 doesn't exists

3 0
3 years ago
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
3 years ago
Which term is used to identify the connection of computers that are physically close to one another?
marta [7]

Answer: Local Area Network (LAN)

Explanation:

A Local Area Network (LAN) is a computer network that interconnects computers within a limited physical area such as a residence, school, laboratory, university campus or office building.

An example of  LAN network is "Phone, Computer and TV connected to a single network (such as a Home Network) via Cables, Wifi, Bluetooth or Hotspot". When the devices are interconnected or connected to a LAN, it becomes accessible between each other.

A simplest example of a LAN Device is a <em>Home Router.</em>

6 0
3 years ago
Read 2 more answers
A photo's color intensity can be modified by changing the brightness and content.
fiasKO [112]
The above statement is FALSE.

A photo's color intensity can be modified by changing the brightness and CONTRAST.

There are four common image controls that makes an image easy to view. These controls are brightness, contrast, saturation, and sharpness.

Brightness control simply brightens the whole image from the shadows to the highlights equally.

Contrast control is the separation between the darkest and brightest areas  of the image.

Saturation control is the separation of colors in the image.

Sharpness control is defined as the edge contrast, meaning the edges in the image are the ones being contrasted.
6 0
3 years ago
Other questions:
  • Help asap. 10 points.
    8·2 answers
  • Refer to the following code segment. You may assume that array arr1 contains elements arr1[0],arr[1],...,arr[N-1], where N = arr
    8·1 answer
  • Implement RandMultipByVal function, which gets one integervariable as its argument
    12·1 answer
  • Which statement is NOT CORRECT?
    11·1 answer
  • Emma lives in Pennsylvania, what climate does she live in?
    7·1 answer
  • g How safe is to have a LinkedIn account where you have published all the important information about yourself
    13·2 answers
  • Write a program that asks the user to enter a positive integer that represents a number in the decimal system and then displays
    12·1 answer
  • b. Write a complete program for the following situation related to setting the speed of a car to preset values before starting a
    5·1 answer
  • How to implement switch statement in Python?
    11·2 answers
  • Fill in the blank: _____ data are statistical and numerical facts about a project.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!