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

Helllppppppp plzzzzzzzz

Answers

Answer:

i help you

ife ifrt ksd

its a study meeting of girls i am also girl here we only study boy were not allowed because he disturb here we only study its safe meeting of girl

The number of swappings needed to sort the number 8, 22, 7, 9, 31 in ascending order, using bubble sort is

Answers

Answer:

3

Explanation:

swap the 7 with the 22

swap the 7 with the 8

swap the 9 with the 22

Angelina has added page numbers to her report, but all of the pages are labeled "Page 1” at the bottom. What caused this issue?
She typed “Page 1” in the footer.
She added a header instead of a footer.
She did not create a numbered list in her footer.
She forgot to click the Continue Numbering option.

Answers

Answer:

She typed "Page 1" in the footer.

Explanation:

This occured because the footer only repeats the same message across the footers unless you enable page numbering.

Hope this helps!

Encryption is a process
i. To hide the massage
ii. To decipher the massage
iii. To delete the massage
iv. None of them​

Answers

Answer:

answer is i

Explanation:

jjgjnyjghjhkgukhi

Answer:

Encryption is a process by which we can conceal the original message (effectively hiding it)

Explanation:

We typically apply some kind of algorithm to encrypt a message. By doing this we are effectively hiding the original contents of the message so only the people with the appropriate secret key or knowledge of the algorithm can decipher it.

Which statement describes how to insert the IF, COUNTIF, or SUM function into a cell?

Use the Insert tab and select the appropriate function from the Functions group.
Type an = sign in the cell, followed by the name of the function and the relevant arguments.
Right-click the cell to access the context menu to insert the function.
Use the View tab and choose the correct function from the displayed list.

Answers

Answer:

Type an = sign in the cell, followed by the name of the function and the relevant arguments.

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents. There are different types of functions used in Microsoft Excel to perform specific tasks and these includes;

1. VLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized vertically. Thus, it's typically used for searching values in a column.

2. SUMIF function: it is an Excel function to sum cells that meet criteria such as text, dates and numbers. This function can be used with the following logical operators; <, >, and =.

3. COUNT function: it's an Excel function to find the total number of entries in a column. For example, to count the number of entries in B1:B15; COUNT(B2:B15).

4. IF function: runs a logical test and returns one value for a TRUE result, and another for a FALSE result. For example, to fail scores that are below 40; IF (A1 < 40, "Fail", "Pass").

5. HLOOKUP function: it's an Excel function that avails end users the ability to lookup data in a table organized horizontally. Thus, it's typically used for searching values in a column.

In Microsoft Excel, to insert the IF, COUNTIF, or SUM function into a cell, you should type an equal to (=) sign in the cell, followed by the name of the particular function and the relevant arguments.

For example, to use the SUMIF function, you should type; =SUMIF(A2:B5, "Peter", C1:C9).

write an algorithm and draw a flowchart for switching off a machine after it has made 500 glass bottles. use an appropriate conditional statement for this

Answers

Answer:

The algorithm is as follows:

1. Start

2. bottles = 0

3. While bottles != 500

  3.1 Create bottle

  3.2 bottle = bottle + 1

4. Switch off machine

5. Stop

See attachment for flowchart

Explanation:

This begins the algorithm

1. Start

This initializes bottles to 0

2. bottles = 0

The loop is repeated until 500 bottles is created

3. While bottles != 500

This creates a new bottle

  3.1 Create bottle

This increments the number of bottles by 1

  3.2 bottle = bottle + 1

This switches of the machine after all bottles are created

4. Switch off machine

End algorithm

5. Stop

express in Qbasic assignment statement
[tex]v = \ \sqrt{t} ^{2} - 4s \div {d}^{4} [/tex]

[tex]K = {8}{x} ^{3} - {2}{y}^{ 6} \div {5}{d}+ {e}^{4} [/tex]

Answers

Answer:

v = sqr(t^(1/2)) - 4 * s / d^4

K = 8 * x^3 - 2 * y^6 / 5 * d + e^4

Explanation:

Given

[tex]v = \ \sqrt{t} ^{2} - 4s \div {d}^{4}[/tex]

[tex]K = {8}{x}^{3} - {2}{y}^{ 6} \div {5}{d}+ {e}^{4}[/tex]

Required

The equivalent in Q Basic

To solve this, we use the following rules:

+ , - and * are written as + , - and *

[tex]\div[/tex] is written as /

^ stands for raise to power

SQR is used for square

^(1/2) stands for square root.

So, the equivalents of the above statements are:

v = SQR(t^(1/2)) - 4 * s / d^4

K = 8 * x^3 - 2 * y^6 / 5 * d + e^4

Shelby wants to move “ExpirationDate” to the top of the datasheet. What should she do?

Answers

Select row for "ExpirationDate", click the mouse and drag the field until the blue line appears above "Scent," and release the mouse button.

is the process of modifying something to make it fit certain criteria.

Answers

Answer:

Design Process

Your organization uses the following tape rotation strategy for its backup tapes: The first set of tapes is used for daily backups. At the end of each week, the latest daily backup tape is promoted to the weekly backup tape. At the end of each month, one of the weekly backup tapes is promoted to the monthly backup tape. What kind of backup tape rotation strategy is being used

Answers

Answer:

- Grandfather

Explanation:

In the given scenario, the 'grandfather backup rotation strategy' is employed to have the backup of the audiotape files. This is because the entire process is segregated into three distinct sections; daily backup that keeps the track of all the files recorded every day. It is followed by weekly storage of the audio files after the week wraps up in order to save it for future usage. Lastly, 'monthly' media is backed up in order to ensure that no data is left to be backed up that might be required later. This promotes a quicker, easier, yet complete strategy for backing up the desired data files in the systems. Hence, 'grandfather-son-rotation strategy' is the correct answer.

How do you connect asp.Net mvc web application in visual studio 2013 to a database created in mysql query browser

Answers

Solution :

Asp.Net is a programming language of Microsoft. It stands for  Active Server Pages. It was developed by the giant, Microsoft which provides and helps the programmers to build a dynamic web sites, services and applications.

Using the asp.Net we can create a web application which provides interface to the existing database.

Creating an ASP.NET web application :

-- We create a new project in the Visual Studio in the same solution or the new solution and then select asp.NET web app template.

-- Name this project as ContosoSite.

-- Click OK.

-- Now in the project window of a new asp.Net project window, we select the MVC template.

-- Clear the Host in Cloud option as of now as we can deploy the application to the cloud later on.

-- Click ok for creating the application.

how do you underline the selected text?

Answers

Select the text that you want to underline. Tip: You can also use the keyboard shortcut Ctrl+D. Use the Underline style drop-down list to select an underline style. Use the Underline color drop-down list to change the color of the line.

Câu 1: Đất trồng là môi trường?

A. Cung cấp chất dinh dưỡng, ôxy

B. Giúp cây đứng vững

C. Cung cấp chất dinh dưỡng, ôxy, nước

D. Câu B và C

Answers

Answer:

D

Explanation:

What is a possible explanation for the issue described below? A user reports that ever since she or he began creating animations, graphics, and video clips for the company’s Web site on her or his computer, the computer has begun running slower, especially when performing the graphics functions. The computer needs an increase in VRAM. The computer needs an increase in SRAM. The computer needs an increase in SIMM. The computer needs an increase in RIMM.

Answers

VRAM because VRAM is used for graphic intensive workloads

Answer:

The computer needs an increase in VRAM

It is A

You install Windows 10 on a new computer. You update the video card driver and restart the computer. When you start the computer, the screen flickers and then goes blank. You restart the computer and receive the same result. You need to configure the video card driver. What should you do first

Answers

First, you need to cut off power to the PSUHit the switch on the back of the PC to turn off supply to the PSU. Extract the side panel (usually held on by two screws on the rear)If you do not already have a GPU installed, skip to Step 7.

3. Remove the screws holding the GPU in on the rear bracket. ...

4. Unlock the PCI-e slot clip.

5. Remove the GPU by lightly pulling on the card.

6. Hover the GPU over PCI-e slot.

7. Push down on the GPU to slide the connector into the slot.

8. Ensure the secure lock clicks into place.

9. Screw the rear bracket down to secure the card to the chassis.

10. Connect any required PSU cables.

11. Reattach the side panel,

Now, all you need to do is to plug in the display connectors on the rear of the case, whether they're DisplayPort, HDMI, DVI, or VGA. After that, hit the PSU power switch and boot up Windows. If the PC does not turn on or no signals get sent to the monitor, we'll need to double-check that all cables are connected correctly (both inside and on the rear of the PC), and the GPU is seated properly in the PCIe slot.

how is internet connection made possible.​

Answers

Answer:

To connect to the Internet and other computers on a network, a computer must have a NIC (network interface card) installed. A network cable plugged into the NIC on one end and plugged into a cable modem, DSL modem, router, or switch can allow a computer to access the Internet and connect to other computers.

A finite set of values along with set of rules for permissible operations is called ______


Data type

Class

Methods

Answers

Answer(data type) is your answer

Data type is the correct answer

the contribution of Charles Babbage in the history of computer​

Answers

Charles Babbage also known as the “father of computers” have made an incredible contribution in the evolution and history of computers. His most well-known invention, the analytical engine was a proposed mechanical general-purpose computer with complex machinal working features. Today, most computers follow Charles Babbage’s analytical engine’s process of working (IPO). Charles Babbage was the one to originate the concept of a digital programmable computer. Other mentionable invention of Charles Babbage is difference engine.


Plz give me the brainliest :)

An end-user license agreement protects _____.

Answers

End User License Agreements are important for protecting the rights of the business owner/licensor and critical for setting the rules of use and managing the expectations of the end-user.

Answer: both the owner and the purchaser of the software

Explanation:

ou need to implement a wireless network link between two buildings on a college campus. A wired network has already been implemented within each building. The buildings are 100 meters apart. Which type of wireless antenna should you use on each side of the link

Answers

Answer:

High-gain and directional wireless antenna.

Explanation:

WiFi can be defined as a wireless local area network that allows network devices such as access points (APs), computers (both laptops and desktops), smartphones, smart televisions, etc., to communicate with each other wirelessly over a short-ranged network. It is a standard communication network that uses radio waves to establish a channel (medium) between multiple network devices.

This ultimately implies that, the network range or distance covered by WiFi is largely dependent on transmission power and frequency. Generally, the standard range or distance covered by WiFi is about 50 meters (160 feet).

Electromagnetic waves is a propagating medium used in all communications device to transmit data (messages) from the device of the sender to the device of the receiver through the use of an antenna.

In this scenario, you need to implement a wireless network link between two buildings on a college campus, which are 100 meters apart.

A high-gain antenna is an electromagnetic device that typically has a gain rating of 12dBi or sometimes higher. Also, a highly directional antenna can only receive radio signals from a specific direction and it compresses the radio waves that are being transmitted from a sender in to a very narrow beam.

Hence, the two (2) type of wireless antenna you should use on each side of the link are a high-gain antenna and a directional wireless antenna.

CLS
N = 1
FOR J = 1 TO 5
PRINT N
N = 10*N+1
NEXT J
END

Answers

Answer:

1

11

111

1111

11111

Explanation:

Given

The above QBasic code

Required

The output

The iteration on the third line is repeated 5 times; i.e. for values of j from 1 to 5.

In each iteration, the value of N is printed and the next value is calculated.

Initially, the value of N is 1 ---- on line 2

So, 1 is printed first. The next value of N is as follows:

[tex]N = 10 * N + 1[/tex] --- we keep replacing N (on the right-hand side) with current N value.

So, we have:

[tex]N = 10 * 1 + 1 =11[/tex]

[tex]N = 10 * 11 + 1 = 111[/tex]

[tex]N =10 *111+1 = 1111[/tex]

[tex]N =10 *1111+1 = 11111[/tex]

Which computer can be used where there is no regular electricity?​

Answers

Answer:

A mechanical computer

Explanation:

Created from gears and levers

what is the georgia connections academy administrative password? i want to install something.

Answers

Answer:

ICL has world-class customized accredited curriculum of over 75 subjects & 1 on 1 support. ICL students compete at the highest level, perform on Broadway & excel in entrepreneurship. Customize Curriculum. Cambridge Style Seminars.

A user informs you that he or she never deletes any files he or she creates. How might this affect the operating system? It will cause the operating system to crash. It will cause the operating system to upgrade. It will cause the operating system to run faster. It will cause the operating system to run slower.

Answers

Answer:

Depending on the amount of files there are, the operating system will run slower because these files take up space on the hard drive, slowing it down.

Explanation:

You want to make sure that a set of servers only accepts traffic for specific network services. You have verified that the servers are only running the necessary services, but you also want to make sure that the servers do not accept packets sent to those services. Which tool should you use

Answers

Answer:

Port scanner.

Explanation:

A server can be defined as a specialized computer system that provides specific services for its clients on request. An example is a web server.

A web server is a type of computer that run websites and distribute web pages as they requested over the internet by end users (clients). When an end user request for a website by adding or typing the uniform resource locator (URL) on the address bar of a web browser, a request is sent to the internet to view the corresponding web pages (website) associated with that particular address.

In this scenario, the tool you should use is a port scanner because it would scan all packets that are sent or received by the server i.e all packets that are being transmitted to and from the server.

Jeremiah wants to print an object from a database, and Marie wants to print a deport of her database.

Answers

Answer: both Jeremiah and Marie.

Explanation:

From the information given, while Jeremiah wants to print an object from a database, Marie wants to print a report of her database.

In this scenario, it should be noted that both Jeremiah and Marie can be able to select the information and print it since they both want to print and the action can be performed by each person.

Therefore, the correct option is B.

Type the correct answer in each box. Spell all words correctly.

Digital artist Frank is discussing how to enhance scanned or photographed images. Complete the following sentences while keeping in mind the topic of discussion.

You can rework or enhance scanned or photographed images using photo editing and illustration software or by using a digital____.

The device has a_____surface on which you can draw images, graphics, and animations.

Answers

Answer:

1. Tablet

2. Flat

Explanation:

Your disaster recovery plan calls for backup media to be stored at a different location. The location is a safe deposit box at the local bank. Because of this, the disaster recovery plan specifies that you choose a method that uses the least amount of backup media, but also allows you to quickly back up and restore files. Which backup strategy would BEST meet the disaster recovery plan

Answers

Answer:

Perform a full backup once per week and a differential backup the other days of the week.

which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) shortest job scheduling , (c) priority scheduling , (d) round robin scheduling​

Answers

Answer:

is correct answer

(a)first come first serve

Explanation:

The information included in a résumé should always relate to the job objective; if it isn’t related, it shouldn’t be included.

Answers

Answer:

True.

Explanation:

A resume (curriculum vitae) can be defined as a short text-based document that a job applicant use to briefly outline his or her qualifications, abillities and accomplishments, haven completed and obtained an academic certificate. Thus, it is used to briefly outline a person's qualifications, abillities, skills set, and accomplishments, after completing and obtaining an academic certificate such as a bachelor's degree, master's degree, etc.

Generally, all job applicants are required to have a resume (curriculum vitae). This brief and concise document is always requested by human resource managers during the job application process.

Furthermore, the primary way to make a resume persuasive (to convince or inform an action in the minds of the readers - potential employers) is by customizing it to fit each company and position.

Hence, the information included in a résumé should always relate to the job objective; if it isn’t related, it shouldn’t be included.

This ultimately implies that, job applicants are expected to tailor their resume to fit or match the position that is advertised by a company's human resources department.

Other Questions
Beeswax used in making candles is produced by honeybees produce 7 pounds of honey for each pound of wax they produce. How many pounds of honey is produced if 145 pounds of beeswax Which of the sets of ordered pairs represents a function? (4 points)A = {(4, 5), (1, 1), (2, 2), (2, 3)}B = {(2, 2), (3, 2), (9, 3), (9, 3)} aOnly A bOnly B cBoth A and B dNeither A nor B Solve: 1.Square both sides of the equation.2.Expand the left side.(3 k)(3 k) = 3k + 13.Multiply9 6k + k2 = 3k + 14.Write the quadratic equation in standard form.k2 9k + 8 = 05.Factor the quadratic equation.(k 8)(k 1) = 06.Use the zero product property. The solutions to the quadratic equation are .The true solution(s) to the radical equation Which of the following illustration do not show congruence. What would American politics and government be like without political parties? The graph below shows the change in the frequency of one allele over 500generations in a large population. Which of the following statementsdescribes the change depicted in the graph? Read this sentence from the introduction of the passage. If other package delivery services can make money, the USPS should be able to make money too.Which logical fallacy is found in this sentence?Select one:a.red herringb.non sequiturc.false analogyd.bandwagon appeal In a scale drawing, 3 millimeters represents 17 meters. Exactly how many millimeters represents 55 meters? How many solutions does this system have?y = 2/3x + 32x - 3y = -9A. one solution (what i think) ****B. two solutionsC. no solutionsD. infinitely many solutions How long did it take for French immigrants to get to Ellis Island? Bacteria needs little to no moisture to grow rapidly. *TrueFalse In the 19th century Americans believed in _______________________________________ , meaning that they thought God wanted them to occupy the whole continent. find the volume of this prism What is the function of the hormone progesterone brainly. 1. Describe which elements of art (line, shape, value, form, texture, space, color) are the most dominant in this paintingand why.2. What could this artwork synbolize? Which of the following graph of the compound inequality 4p+1>-7 and 6p +3 < 33 Jamaal ran 6 miles in 30 minutes. Which expression shows how to correctly determine his speed in miles per minute?6 miles 30 minutes30 minutes 6 miles6 miles 1 minute30 minutes 1 mile Write all permutations of the letters E, F, G, and H if the letters F and G must remain between the letters E and H. (Enter your answers as a comma-separated list of four letter combinations. For example, the combination "C,D,E,F" should be entered as CDEF.) Write an essay explaining whether learning always has a positive effect on a person's life. Victoria kicked a soccer ball laying on the ground. It was in the air for 5 seconds before it hit the ground. While the soccer ball was in the air, it reached a height of approximately 15 feet. Assuming that the soccer ball height (in feet) is a function of time (in seconds), what is the domain in the context of this problem?