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
A technician replaces a defective 250GB hard drive in a desktop with a 2TB hard drive. After installation, the computer detects
FinnZ [79.3K]

Answer:

D. Flash the BIOS

Explanation:

The function of the BIOS is to test all computer hardware that is attached to a machine before loading the operating system. Since the bios contains firmware that enables the configuration of computer hardware. when the 2 TB hard drive is connected the technician should update the program stored on the BIOS chip in other words flash the bios for it to be able to read the new hard drive. Reinstalling the drive will not make a difference as long as the BIOS still detects the 250 GB hard drive.

6 0
3 years ago
Tamara has $500 she is looking to save for a class trip. She wants to earn the most possible interest and will not need access t
Novay_Z [31]
Certificate Of Deposit- It will be unaccesible and will help her the best.
6 0
3 years ago
Read 2 more answers
Half of the integers stored in the array data are positive, and half are negative. Determine the
jonny [76]

Answer:

Check the explanation

Explanation:

Below is the approx assembly code for above `for loop` :-

1). mov ecx, 0

2). loop_start :

3).    cmp ecx, ARRAY_LENGTH

4).    jge loop_end

5).    mv temp_a, array[ecx]

6).    cmp temp_a, 0

7).    branch on nge

8).        mv array[ecx], temp_a*2

9).   add ecx, 1

10).   jmp loop_start

11). loop_end :

Assumptions :-

*ARRAY_LENGTH is register with value 1000000

*temp_a is a register

Frequency of statements :-

1) will be executed one time

3) will be executed 1000000 times

4) will be executed 1000000 times

5) will be executed 1000000 times

6) will be executed 1000000 times

7) `nge` will be executed 1000000 times, branch will be executed 500000 times

8) will be executed 500000 times

9) will be executed 1000000 times

10) will be executed 1000000 times

Cost of statements :-

1) 10 ns

3) 10ns + 10ns + 10ns [for two register accesses and one cmp]

4) 10ns [for jge ]

5) 10ns + 100ns + 10ns [10ns for register access `ecx`, 100ns for memory access `array[ecx]`, 10ns for mv]

6) 10ns + 10ns [10ns for register_access `temp_a`, 10ns for mv]

7) 10ns for nge, 10ns for branch

8) 30ns + 110ns + 10ns

10ns + 10ns + 10ns for temp_a*2 [10ns for moving 2 into a register, 10ns for multiplication],

110ns for array[ecx],

10ns for mv

9) 10ns for add, 10ns for `ecx` register access

10) 10ns for jmp

Total time taken = sum of (frequency x cost) of all the statements

1) 10*1

3) 30 * 1000000

4) 10 * 1000000

5) 120 * 1000000

6) 20 * 1000000

7) (10 * 500000) + (10 * 1000000)

8) 150 * 500000

9) 20 * 1000000

10) 10 * 1000000

Sum up all the above costs, you will get the answer.

It will equate to 0.175 seconds

7 0
2 years ago
Computer design software requires __________________ to be used properly and successfully by architects.
murzikaleks [220]
<span>The answer is letter B. An arrangement of directions and related documentation that instructs a PC or how to play out an undertaking or it can mean all the product on a PC, including the applications and the working framework. I hope the answer helps. </span>
5 0
3 years ago
Read 2 more answers
The motion of electrons can be predicted precisely.<br><br> True<br> False
Aleksandr-060686 [28]
The statement above is false; the motion of electrons can not be predicted precisely. Electrons move around the orbit shells at different energy levels in atoms. Previous research works had devised ways of measuring the angular velocity of electrons and means of tracking the movement of electrons in atoms but the movement of these electrons can not be predicted. They move in a random manner round the nucleus of an atom.<span />
6 0
3 years ago
Read 2 more answers
Other questions:
  • The amount of interest you will earn in one year from a savings account is the _____. A) APY B) return C) IDA D) CD
    12·2 answers
  • Your boss bought a new printer with a USB 3.0 port, and it came with a USB 3.0 cable. Your boss asks you: Will the printer work
    14·1 answer
  • List and briefly defined categories of security services.
    8·1 answer
  • Match each scenario to the absolute value expression that describes it. 1. the distance moved when going backwards five spaces i
    13·2 answers
  • Suppose that a is declared as an int a[99]. Give the contents of the array after the following two statements are executed: for
    15·1 answer
  • Learning in a digital environment is also called [blank] learning.
    11·2 answers
  • What are TWO examples of soft skills?
    11·1 answer
  • An IT department receives a shipment of 20 new computers, and Alice has been assigned the task of preparing them for deployment
    12·1 answer
  • What happened to the ten commandments tablets.
    9·1 answer
  • Is it possible to code your own game and if so then where should I go to learn and how to publish it?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!