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
In memory ads for DIMMs, you notice DDR 2400 CL15 in one ad and PC4 21300 CL9 in another. Which ad is advertising the faster mem
Artyom0805 [142]

Answer:

The answer is 'PC4 21300 CL9".

Explanation:

Faster memory advertising is used to provide customer memory, which is essential for brand actions. It can't be taken throughout ad coverage. Retired-laboratory tests revealed its access to ad-memory detection aspects of the effect of its grade through publicity recovery, that's why it uses the PC4 21300 CL9, it transfers the 170400 bits per second.

8 0
4 years ago
The backbone networks of the Internet are typically owned by long-distance telephone companies called
Aneli [31]

Answer:

network service providers

Explanation:

The backbone networks of the Internet are typically owned by long-distance telephone companies called network service providers.

A network service provider can be defined as a business firm or company that is saddled with the responsibility of leasing or selling bandwidth, internet services, infrastructure such as cable lines to small internet service providers.

5 0
3 years ago
Computers can be positioned on a network in different ways relative to each other. true false
Likurg_2 [28]
False they cant do that
4 0
3 years ago
The process of transduction is analogous to a. a rocket ship breaking through the Earth’s atmosphere. b. a sailboat utilizing th
maks197457 [2]

Answer:

The answer to this question is "none of these"

Explanation:

Transduction is also known as a virus, that moves in the genetic information through each type of bacteria to another, and in the computer science it is used in the machine learning, that provides testing, and other options were wrong, that can be explained as follows:

  • Option a, It can't use in a rocket ship for breaking.
  • Option b, It can't utilize glide along the water.  
  • Option c, It provides hack and test systems, and not for communication.
  • Option d, It uses a programming language to test virus, that's why it is wrong.
6 0
3 years ago
Describe the components of the Ethernet frame in detail?
Marta_Voda [28]
Starts with an Ethernet header, which contains destination and source MAC addresses as its first two fields
7 0
3 years ago
Other questions:
  • Which extensions can help drive installs of your mobile app?
    12·1 answer
  • Which line of code will print I can code on the screen?
    13·1 answer
  • Name three recent advances that are influencing OS design.
    15·1 answer
  • A technician needs to boot a PC from a USB drive.
    5·1 answer
  • Which of the following cameras is a high-end digital camera that has interchangeable lenses and uses a mirror to display on its
    13·1 answer
  • Seneca has just applied conditional formatting and realizes that she has made a mistake. Which action should she take to fix the
    12·2 answers
  • How many levels of heading tags are allowed in html?
    13·2 answers
  • Describe s computer network that you are familiar with ?
    8·1 answer
  • What is one of the limitations of marketing in social media?.
    13·1 answer
  • Any mobile devices contain a(n) ___ and gyroscope that can sense even the smallest movements.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!