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
vodomira [7]
2 years ago
12

Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res

ult by the amount of numbers. She will use a variable, avg, to store this average. Which variable type would be most suitable for avg?
Computers and Technology
1 answer:
Andre45 [30]2 years ago
5 0

Answer:

a variable of type "double" is more suitable for finding average because average could be any number with decimal places. we can't use a variable of type "integer" because it will omit the value after the decimal and will not produce satisfactory results.  

Explanation:

an example of C++ code is given to find the average of two numbers a and b

#include <iostream>;

using namespace std;

int main() {

double a = 2.334;

double b = 34;

double average =  (a + b) / 2;

cout << average;

return 0;

}

You might be interested in
Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contai
lisov135 [29]

# Write a function called mul_time that takes a Time object and a number and

# returns a new Time object that contains the product of the original Time and

# the number.

# Then use mul_time to write a function that takes a Time object that

# represents the finishing time in a race, and a number that represents the

# distance, and returns a Time object that represents the average pace (time

# per mile).

# Current Status: Complete

class Time(object):

   """ represents the time of day.

   attributes: hour, minute, second"""

time = Time()

time.hour = 3

time.minute = 0

time.second = 0

def time_to_int(time):

   minutes = time.hour * 60 + time.minute

   seconds = minutes * 60 + time.second

   return seconds

def int_to_time(seconds):

   new_time = Time()

   minutes, new_time.second = divmod(seconds, 60)

   time.hour, time.minute = divmod(minutes, 60)

   return time

def mul_time(time, multicand):

   time_int = time_to_int(time) * multicand

   new_time = int_to_time(time_int)

   if new_time.hour > 12:

       new_time.hour = new_time.hour % 12

#    print ("New time is: %.2d:%.2d:%.2d"

#    % (new_time.hour, new_time.minute, new_time.second))

   return new_time

# mul_time(time, 2)

def race_stats(time, distance):

   print ("The finish time was %.2d:%.2d:%.2d"

         % (time.hour, time.minute, time.second))

   print "The distance was %d miles" % (distance)

   average = mul_time(time, (1.0 / distance))

   print ("The average is: %.2d:%.2d:%.2d per mile"

         % (average.hour, average.minute, average.second))

race_stats(time, 3)

7 0
2 years ago
How has information technology made piracy possible
ololo11 [35]
Well, more and more people are buying products and then uploading them online so that other people, who may not have the money or just don't want to buy them can download them for free. Of course, this is illegal, however it is a common practice all over the globe. Even if you are not downloading, but rather just watching a show on a website where you don't have to pay for it - it is still piracy.
3 0
3 years ago
. How to insert Section Break in Microsoft word 2016 ?
aivan3 [116]

Answer:

C. Layout Tab – Page setup group – Breaks – Next page button.

3 0
3 years ago
"what windows process is responsible for authenticating users?"
Likurg_2 [28]
Lsass.exe /................................................
8 0
3 years ago
A man inside water, the pressure which acts on him is
suter [353]

Answer:

C. Liquid and atmospheric pressure

Explanation:

https://courses.lumenlearning.com/physics/chapter/11-4-variation-of-pressure-with-depth-in-a-fluid/

6 0
2 years ago
Other questions:
  • 4. When you're working with a word processing document and you press the Del key, what happens?
    8·2 answers
  • Anna is making a presentation on the solar system. She wants to emphasize the planet names as they appear one by one on the pres
    11·1 answer
  • What country threatens Denmark at the beginning of Hamlet as evidenced in Marcellus’s question, "Why this same strict and most o
    13·1 answer
  • How do graphic designers showcase their work?
    14·2 answers
  • What will the value of x be after the following statements execute? int x = 0; int y = 5; int z = 4; x = y z * 2;
    14·1 answer
  • How many Iron molecules are in the compound Fe4O2?
    15·2 answers
  • Rewrite each condition below in valid Java syntax (give a boolean expression): a. x &gt; y &gt; z b. x and y are both less than
    7·1 answer
  • _________________ ___________________ is an encrypted code that a person, website, or organization attaches to an electronic mes
    9·1 answer
  • List the difference between GIGO and bug ​
    15·1 answer
  • Write a program to assign and display a string value to any variable of your choice
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!