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

Write a function float Average(int, int) that finds the mean, and then write a main program that inputs two numbers from the use

r repeatedly until the user enter “0”. You need to call the function and display the mean of two numbers in the main. C++ language only.
Computers and Technology
1 answer:
meriva2 years ago
5 0

The program illustrates the use of functions.

Functions are used to group related code segments that act as one, when called.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

//This defines the Average function

float Average(int num1, int num2){

   //This returns the average of the numbers

   return (num1+num2)/2.0;

}

//The main method begins here

int main(){

   //This declares the numbers as integer

   int num1, num2;

   //This gets input for both numbers

   cin>>num1; cin>>num2;

   //This is repeated until the user enters 0

   while(num1!=0 || num2 !=0){

       //This calls the average function, and prints the average

       cout<<Average(num1,num2)<<'\n';

       //This gets input for both numbers, again

       cin>>num1; cin>>num2;

   }

   return 0;

}

Read more about similar programs at:

brainly.com/question/17378192

You might be interested in
A site has been issued the IP address of 192. 168. 10. 0/24. The largest network contained 25 hosts and was given the lowest num
dimulka [17.4K]

Answer:

Explanation: The first thing to calculate is what IP addresses are used by the largest LAN. Because the LAN has 100 hosts, 7 bits must be left for host bits.

Explanation:

Explanation: The first thing to calculate is what IP addresses are used by the largest LAN. Because the LAN has 100 hosts, 7 bits must be left for host bits.

4 0
2 years ago
Please help me with this! I’m using Python 3
IgorLugansk [536]

Something like this?

h1 = int(input())

m1 = int(input())

s1 = int(input())

h2 = int(input())

m2 = int(input())

s2 = int(input())

s = h2*3600 + m2*60 + s2 - (h1*3600 + m1*60 + s1)

print(s)

3 0
3 years ago
Rishilaugh I would like to change my username
allsm [11]

Answer: just text them through their help thing or settings.

Explanation:

3 0
3 years ago
Read 2 more answers
After you create an array variable, you still need to ____ memory space.
Svetllana [295]
This is a little tricky. I would say reserve. It would help to know what programming language and class this is for because a lot of times when you create an array variable the memory is put onto the stack and you as the programmer do not reserve memory space. Now on the other hand, if you are programming in C and you want to create an array variable and put it on the heap then you would reserve memory space on the heap.
6 0
4 years ago
What solar panel alternative is used at kramer junction? 
siniylev [52]
A 150-megawatt solar power plant.

4 0
3 years ago
Other questions:
  • To calculate the multiple of 5
    9·1 answer
  • The _____ stage occurs when advancing IT leads to the development of a more advanced IT product making the old one obsolete and
    10·1 answer
  • The main screen of wireshark includes several shortcuts. which shortcut category displays a list of the network interfaces, or m
    15·1 answer
  • What two pieces of information would you need in order to measure the masses of stars in an eclipsing binary system?
    9·1 answer
  • The following relation schema can be used to register information on the repayments on micro loans.
    13·1 answer
  • What specific authentication method has no encryption for user credentials or data, and is not recommended for most applications
    14·1 answer
  • What are some of the ways you can use bitlocker encryption? (choose all that apply?
    10·1 answer
  • The parts of a memo are _____.
    9·2 answers
  • Why is science, mathematics, and technology different from engineering?
    15·1 answer
  • To excel at these professions, you need to be able to combine an eye for elegant design with a mind that delights in efficient o
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!