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
Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
mezya [45]

Answer:

The answer is c

Explanation:

7 0
3 years ago
C. There are two types of computer on the basis of size. true or false​
Veronika [31]

Answer:

False

Explanation:

Different factors, such as processing power, information processing, and the component (CPU) utilised in computers, are used to classify computers. Micro-computers, Mini-computers, Main-frame computers, and Super-computers are divided into four categories based on the components utilised and functionality of the computers.

4 0
3 years ago
Pls can anyone be so kind and answer this question.....i need the answer urgently
mixas84 [53]

Answer:

so u have to be smaet

Explanation:

8 0
3 years ago
A/An ________ attack in which a malicious hacker floods a Web server with millions of bogus service requests that so occupy the
CaHeK987 [17]

Answer:

denial of service

Explanation:

A <u>denial of service</u> attack in which a malicious hacker floods a Web server with millions of bogus service requests that so occupy the server that it cannot service legitimate requests.

6 0
3 years ago
What factors might influence how effective a vaccine is when it’s widely released?​
777dan777 [17]

Answer:

alot of people might get sick off it and some people might die bec they don't know how to use and everybody acts differnt and has differnt opinions

Explanation:

8 0
3 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
  • A network administrator has statically configured the LMI type on the interface of a Cisco router that is running Cisco IOS Rele
    7·1 answer
  • Which part of the cpu stores instructions for high speed access or processing
    14·1 answer
  • 1. Mobile devices have a _________ viewport that displays a web page content that fits within a mobile screen.
    11·1 answer
  • En que se diferencia el software y el hardware
    7·2 answers
  • What are copyright laws? Authority to reprint an original work as long as it's not for profit Entitlement to use and sell anothe
    15·2 answers
  • WHO WANTS TO PLAY AMONG US
    15·2 answers
  • &gt;What is the output of the following code:
    5·1 answer
  • Laptop computers use PCMCIA cards, another type of ________
    15·1 answer
  • What is the missing part to have the output as 3 2 1 while count &gt;0 : print(count) count -= 1
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!