Write a function float Average(int, int) that finds the mean, and then write a main program that inputs two numbers from the user 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.

Answers

Answer 1

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:

https://brainly.com/question/17378192


Related Questions

Which of the following is a responsibility of CTSO membership?

getting all As in your classes

traveling to a national conference

conducting yourself appropriately and professionally

getting a job in your career field after graduation

Answers

Answer:conducting yourself appropriately and professionally

Explanation:

2021 edg

Which of these problems is correct if the numbers are binary numbers?Group of answer choices1 + 1 = 21 + 1 = 100 + 0 = 11 + 0 = 10

Answers

Answer:

The last one is correct.  

Explanation:

How do I type fast?

Give me an actual answer...

Answers

Practice!
And a good keyboard I recommend mechanical key boards
But the best way to improving your WPM is definitely practice one way you can practice is playing typeracer it’s pretty fun way

Hope this helps!
Brainliest is much appreciated!

Answer:

Use all 10 fingers and remember where the keys are.

Explanation:

This may take a while to get used to, but just let your hands flow across the keyboard. There really isn't a specific way to do it, but there are websites that'll help you.

can someone pelaseee help

Answers

Answer:

Explanation:

develloppemetn de grace en option est logiquement une biologiste experimenter des annes 1256 a toulouse en france

Which of the following is an example of an incremented sequence?

A.
1, 2, 3, 4

B.
4, 3, 2, 1

C.
North, South, East, West

D.
A, B, C, D

Answers

Answer:

A

Explanation:

When a sequence number is genrated, the sequence is incremented independent of the transaction committing or rolling back.

Fill in the blank: With ticket ________, you are able to edit ticket properties according to which team owns the ticket.

Answers

Answer: records customization

Explanation:

Pls help me pls I’m struggling

Answers

Answer:

Forward(30)

Explanation:

To turn right you have to say right(Angle) and then forward(steps) to go that many steps in that direction

A company is looking for an employee to install new computers and integrate them into its existing network. Which computer field most likely include this job ?
A. Network systems administrator
B. Information security analysis
C. Computer support
D. Application Development

Answers

A. Network systems administrator

Answer:

A. Network systems administrator

Explanation:

trust me i just did it 1.3.2

what method does a gsm network use to separate data on a channel?

Answers

It uses TDMA method

If you want to use the randint function, you need to include import random in your program.
A. True
B.False

Answers

Answer:

A. True

Explanation:

Because to use randint (which means random integer) you need to import random module.

Sort the Chart Tools options under the tab where they are located.

Answers

Answer:

That is in fact the correct order. post protected.

Explanation:

The change that was made to the pie chart is that the angle of the slices was adjusted in the Format tab, the chart title was added in the Layout tab, and the legend was changed to the bottom in the Layout tab. Thus, the correct option for this question is C.

What is a Pie chart?

A pie chart may be characterized as a graphical representation technique that displays data in a circular-shaped graph. It is a composite static chart that works best with a few variables.

The design, format, and layout tabs chart Tools contextual tabs appear on the Ribbon when you select a chart. Pie charts are often utilized in order to represent sample data—with data points belonging to a combination of different categories.

Therefore, the correct option for this question is C.

To learn more about Pie charts, refer to the link:

brainly.com/question/796269

#SPJ3

A(n) ________ is the portion of virus code that is unique to a particular computer virus. A) virus signature B) encryptio

Answers

Answer:

A) virus signature

Explanation:

Antivirus databases contain what are called signatures, a virus signature is a continuous sequence of bytes that is common for a certain malware sample.

--

Encryption is a way of scrambling data so that only authorized parties can understand the information.

in python:
The mode of a list of numbers is the number listed most often. The median of a list of numbers is the value in the middle of the list if the list is arranged in order. For this software solution you will do the following:

Take 10 numbers as input from the user and display the number with the highest mode. If there is a tie, you will need to show all of those numbers.
Your program must create a user-defined function that takes an array of numbers as a parameter and returns the value that appears the most often in the array.
For those same 10 numbers your program must create a user-defined function that takes an array of numbers as a parameter and returns the value which is the median for those numbers.

please help!

Answers

Python can be used to implement central of tendencies such as mean, median and mode using the statistic module

The program in Python, where comments are used to explain each line is as follows:

#This imports the statistics module

import statistics

#This defines the function that calculates the mode

def calcMode(myList):

   #This prints the mode

   print(statistics.multimode(myList))

#This defines the function that calculates the median

def calcMedian(myList):

   #This prints the median

   print(statistics.median(myList))

#The main method begins here

#This initializes the list

myList = []

#The following iteration gets input for the list

for i in range(10):

   myList.append(int(input()))

#This calls the calcMode method

calcMode(myList)

#This calls the calcMedian method

calcMedian(myList)

Read more about similar programs at:

https://brainly.com/question/25026386

Brianna is taking a backpacking trip in the wilderness and wants to back up the photos from her camera. Which type of storage device would be best for this purpose?
A. Optical disc
B. Cell phone
C. Flash drive
D. HDD

Answers

Answer:

C

Explanation:

Flash drives usually have an input (E.G. one of those android charger connectors), so just plug that into your camera, and load the flash drive with the photos. Then go home and plug the USB on the flash drive into your PC. If there isn't already, a folder will be made in your "Pictures" folder on your PC, to which you can open the folder, and then your photos should be there. From there you can open them, print them, etc.

Hope this helped, and sorry if I didn't answer in time.

Database management packages based on the _______________ model can link data elements from various tables to provide information to users.

Answers

Answer:

Database management packages based on the relational model can link data elements from various tables to provide information to users.

What is the full form of MOS

Answers

Answer:

Military occupational speciality

Who is your favorite Funtime Anamatronic?

Answers

Answer:

ur mom

Explanation:

jk it's prb something like foxy

The ____ layer in the TCP/IP model is a direct equivalent to the Network layer in the OSI reference model.

Answers

Answer: Application

Explanation:

When a number gets assigned to a variable that already has a value __________. the new number overwrites the previous value at that memory location the new number gets assigned to a neighboring memory location the computer issues an error the new value is destroyed and the old value remains

Answers

Answer: the new number overwrites the previous value at that memory location

Explanation:

When a number gets assigned to a variable that already has a value, the new number overwrites the previous value at that memory location. The correct option is A.

What is assigning value?

To "assign" a variable is to symbolically link a specific piece of data to a name. Any operations performed on this "name" (or variable) must be true for all possible values.

The assignment operator is the equals sign, which should never be used for equality, and should never be followed by the double equals sign.

To assign a value to a variable, use the simple assignment operator. The assigned value is evaluated by the assignment operation.

It is possible to chain the assignment operator to assign a single value to multiple variables.

When a variable receives a new value, the previous value is overwritten.

Thus, the correct option is A.

For more details regarding assigning value, visit:

https://brainly.com/question/28587274

#SPJ2

please help
Felicity wants to take her DSLR camera on vacation, but she can take only one bag. Why is taking a DSLR camera with her not a good idea?

Answers

The reason why taking a DSLR camera with her is not a good idea is because a DSLR camera and its accessories usually require their own bag and can be heavy.

A digital single-lens reflex (DSLR) camera is being used by photographers especially for shooting stunning landscapes or portrait images. DSLR cameras are durable and can be used with a variety of lenses and attachments, they have a long battery life, and provide faster shooting speeds with better autofocus.

Therefore, the reason why taking a DSLR camera with her is not a good idea is because a DSLR camera and its accessories usually require their own bag and can be heavy, whereas she can only take one bag with her.

Learn more about digital single-lens reflex (DSLR) camera here:

https://brainly.com/question/13972212

Answer:

I got the answer here:

Explanation:

Drag each label to the correct location on the image.
Identify the parts of the URL.
World Wide Web
server name
resource ID
protocol
domain name

Answers

Answer:

1) Resource ID

2) Server Name

3) Domain Name

4) World Wide Web

5) Protocol

The correct location is Resource ID, Server Name, Domain Name, World Wide Web, Protocol respectively.

What is a website?

The Online Etymology Dictionary states that in 1994, the word "website" first appeared in the English language.

It combines "Web," used in the meaning of the Internet, with "Site." The study of word origins and how their meanings changed over time is known as etymology. The web address of every website begins with "http://".

The website may be one of many various forms, such as an e-commerce website, a social media website, or a blog website. Each website serves a unique purpose, but they all have the feature of having numerous linked web pages.

Resource ID, Server Name, Domain Name, World Wide Web, and Protocol are the right locations, accordingly.

Thus, this is the correct answers for the given situation.

For more details regarding a website, visit:

https://brainly.com/question/29777063

#SPJ2

how does digital and hybrid computers differ in storage​

Answers

Digital computers perform functions like mathematical, complex calculations, media streaming, etc. While hybrid computers work with the duo combination of analog (analog Quantities like the voltage, temperature) and digital (mathematical functions, complex calculations, media streaming) computers at the same time.

This is an image of the ...........................Topology.

if answer Correct i will mark the first person brainly.​

Answers

Answer:

Mesh

Explanation:

about how many smart devices are active today coinbase

Answers

Considering the latest information released by Statisticà, the number of active smart devices in the world today is 21.5 billion.

What is Smart Device?

Smart Device are generally known as electronic devices, that have the capacity to connect with other device or networks through wireless servers like Bluetooth, Zigbée, NFC, Wi-Fi, LiFi, 5G, etc.

Examples of Smart Devices

Smart devices generally include the following:

SmartphonesSmart cars Smart doorbellsSmart refrigeratorsTabletsPCSmart watches, etc.

Hence, in this case, it is concluded that the correct answer is 21.5 billion.

Learn more about Smart Device here: https://brainly.com/question/24803254

A small network that consists of devices connected by Bluetooth, such as a smartphone and a computer, is referred to as a ________.

Answers

Answer:

I think is technologies

Not all ________ access is malicious, but it should still be prevented; for example, a user may poke around a network share and see sensitive information.

Answers

Answer:

System access.

Explanation:

System access aka admin privileges are not meant for any user in a network.It should be handled by professionals

Please define processor​

Answers

Processor means to break down something.

software ............. the hardware what to display on the user's screen​

Answers

A monitor? This displays on the users screen but I’m not sure if that’s what your asking good luck on finding the right answer.

Before taking the boat out for an excursion, it is always a good idea to let someone know you are leaving. Which would be the best way to accomplish this?

Answers

The best way to let someone know you are leaving on an excursion with a boat is: by filing a boat plan.

A boat plan is also referred to as a sail plan or float plan and it can be defined as a paper document that outlines a traveler's itinerary and other important information while on water.

Generally, a boat plan comprises the following important information about traveler and the trip:

NameOwner's address Telephone numberDestinationSafety equipment on boardDate and time of departureNumber of persons on board.

Ideally, it is a good idea to ensure that you inform a friend or family before taking your boat out for an excursion. Also, the best way to accomplish this is to file a boat plan.

Read more on here: https://brainly.com/question/10339634

What number is represented as a binary code of 101110

Answers

Answer:

46 i think

Explanation:

sorry if thats wrong

46

46 in binary is 101110
Other Questions
which statement best describes a viewpoint of the speaker The lines graphed below are parallel. The slope of the red line is 3. What is theslope of the green line?5-55O A. - 1 / 1O B. 3C.-3 The surface temperature of our sun is about 5800 K, and the peak of its intensity curve is in the middle of the visible spectrum. Mammals have a body temperature of about 310 K. A star that appears reddish could have a surface temperature of: someone plz helpAn object accelerates from rest to 93 m/s over a distance of 49 m. What acceleration did it experience? HELP ME PLEASE GUYS ! :) The sum of two numbers is 20. The greater number is 4 more than three times the smaller number. what is the connotive meaning of lifeless and faceless as it is used in these lines from creating a piece of sky Match each kind of drug to a relationship it has with society and culture. Yovani can do 8 math problems in 1 3/5 of aminute. How many problems can hecomplete per minute? Two numbers multiply to be 0 and add to be -81? At the school dance, between 6 and 7pm, 10 students per minute arrived. If there are 2050 students in the school,what percent of them arrived at the dance between 6 and 7pm? (5j - 2q + 2/5) - (4 - 3j - 1/2q) discuss the criteria of a good test PLEASE HELP I THINK THIS IS EASY BUT I DONT WANT TO DO IT Answer this for me!! For the ones who know and speak Spanish!!!PLEASEEEE!ILL GIVE BRAINLEST AND POINTSSS! An object starts from rest with a constant acceleration of 2m/s^2 along a straight line. Find the distance travelled for the interval of 10 s. Calculate the value of 2x and 3x Solar radiation can cause skin cancer in an individual. If a man with skin cancer caused by solar radiation has offspring, which of the following statements would be true? A. only the man getting skin cancer would be affected B. only the man and his male offspring would be affected C. only the man and his female offspring would be affected D. the man and all of his offspring would be affected The __ is a court in which an accurate, detailed report of what went on attrial is made.specialized courtcourt of recordwrit of certioriaappellate court Plz help LITERARY ANALYSIS: Where are you from? seems like a question with an obvious answer, but the answer is clearly more complicated according to the essay's author, Naomi Sepiso. How does Sepiso respond to this question? What supporting evidence does she include to develop her controlling idea? Write a RACE response in which you are using 3 pieces of evidence from the essay to support your analysis