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]
3 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]3 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
PLEASE HELP ASAP!!!!!!!!!!!
Bingel [31]

Answer:

True

Explanation:

3 0
3 years ago
Read 2 more answers
12While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The change
AfilCa [17]

Answer:

Issue the reload command without saving the running configuration.

Explanation:

5 0
3 years ago
Write the definition of a function divide that takes four arguments and returns no value . The first two arguments are of type i
Nastasia [14]

Answer:

#include <iostream>

using namespace std;

void divide(int numerator, int denominator, int *quotient, int *remainder)

{

*quotient = (int)(numerator / denominator);

*remainder = numerator % denominator;

}

int main()

{

int num = 42, den = 5, quotient=0, remainder=0;

divide(num, den, &quotient, &remainder);

 

return 0;

}

Explanation:

The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.

To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.

Thanks! :)

8 0
3 years ago
Oblicz: uchyb bezwzględny, poprawkę, uchyb względny, uchyb
Zarrin [17]
Calculate; absolute errors, Correction, Relative errors, errors. There’s no attachment to ur question
8 0
3 years ago
6.5 Code Practice
o-na [289]

Answer: tried using stack over flow and GitHub. The have most of the codes for everything

Explanation:

4 0
3 years ago
Other questions:
  • Review the given requirements using the checklist and discover possible problems with them. The following requirements are for a
    8·1 answer
  • Can i still download an update for an xbox one game if it's not turned on
    13·1 answer
  • True or false? any webb app can be accessed and run on any computing
    12·1 answer
  • Keyboards that are widely used on various smartphones and other small portable devices, and which are designed primarily for com
    15·1 answer
  • Explain the reason why vector graphics are highly recommended for logo​
    5·1 answer
  • Really helpful, I want to get together tomorrow ,Later I will follow and make it the best answer
    7·1 answer
  • Which Internet connection type tends to use shared bandwidth?<br> Cable<br> Dial-up<br> DSL<br> ISDN
    5·2 answers
  • Create a set of functions that compute the mean, median, and mode of a set of
    8·2 answers
  • SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SUSSY SU
    6·2 answers
  • What type of software is developed by volunteers, contains code in the public domain, and helped to make Linux popular
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!