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
What's the value of this Python expression? ((10 &gt;= 5*2) and (10 &lt;= 5*2))
elena-14-01-66 [18.8K]

Answer:

The Boolean value returned by that expression will be True

Explanation:

We have two logical statements in that expression:

Expression 1: (10 >= 5*2)

This can be read as: is 10 greater than or equal to 5 multipled by 2. This evaluates to true as 10 is equal to 5 * 2. Hence expression 1 returns true

Expression 2: (10 <= 5*2)

This can be read as: is 10 less than or equal to 5 multiplied by 2. This also evaluates to true as 10 is equal to 5*2. Hence expression 2 returns true.

Now between this two expression is the and operator which evaluates to true if and only if both logical expressions returnes true.

True and True ==> True

Since Expression 1 ==> True and Expression 2 ==> True

This means Expression 1 and Expression 2 ==> True which is the Boolean value returned by the statement

5 0
3 years ago
You have one address, 196.172.128.0 and you want to subnet that address. You want 10 subnets. 1. What class is this address
Korvikt [17]

Answer:

This address is by default a class c network

Explanation:

This IP address in this question is a class c network because it has 196 as its first octet. A class c network is one which has its first octet to be between 192 and 223. the class c network begins with a 110 binary.  If ip is between 192 to 223 it belongs to this class. These first 3 octets are the representation of the network number in the address. Class c's were made to support small networks initially.

8 0
3 years ago
Arrays are commonly used to store data items. Arrays can be managed in ways that fill, iterate over, add to, and delete items fr
vfiekz [6]

Answer:

mark me brainlist

Explanation:

3 0
3 years ago
State one technique for overcoming external fragmentation in dynamic partitioning. Why is this technique of overcoming external
prisoha [69]

Compaction often gives solutions to the issues regarding external fragmentation.

One technique for overcoming external fragmentation in dynamic partitioning is

Compaction.

The reason why this technique of overcoming external fragmentation may be inefficient is because:

  • External fragmentation may need a lot of compaction and it is an expensive operation.

  • The use of contiguous allocation is often hard to fit processes into memory and also it is so difficult to grow or shrink the amount of memory allocated to a process.

  • Compaction only takes place when relocation is dynamic, and this also is expensive.

Compaction often shuffle memory notes or contents and then put or pile them up all in free memory and in one large block.

External fragmentation takes place when free memory is removed into small blocks.

Learn more from

brainly.com/question/23636593

4 0
2 years ago
In which view can you see speaker notes?
Bond [772]

Answer:

c. notes view

Explanation:

Assuming you're talking about a slideshow program, like Microsoft PowerPoint, the notes view lets you see the speaker notes.

The normal view is the one used normally to present the regular slideshow content, it's formatted for a screen view.

The handout view is same as normal view, but formatted for print.

The slide sorter view is a general overview of your presentation allowing you to move your pages around.

4 0
3 years ago
Other questions:
  • (2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
    5·1 answer
  • A file containing user information which is transmitted from an online server and attached to your web browser and stored on you
    11·1 answer
  • Can somebody please halp meeee?? I'm doing Web design.
    12·2 answers
  • You are troubleshooting a mobile device with no sound output from the headset or external speakers.
    6·1 answer
  • Write the Java code to simulate an inventory control system and a point of sale system with customer history On program start, e
    5·1 answer
  • Why RAM is necessary in a computer​
    9·1 answer
  • What is the biggest danger when you reveal information such as your Social Security number?
    15·2 answers
  • Which of the following statements tests if users walked 10,000 or more steps and ate fewer than 25 grams of sugar?
    9·1 answer
  • Can anyone help with this?​
    6·1 answer
  • PLEASE HELP. Nobody has been helping me, i need to resolve this code issue for game design
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!