Summary

In this lab, you complete a partially written C++ program that includes a function requiring multiple parameters (arguments). The program prompts the user for two numeric values. Both values should be passed to functions named calculateSum(), calculateDifference(), and calculateProduct(). The functions compute the sum of the two values, the difference between the two values, and the product of the two values. Each function should perform the appropriate computation and display the results. The source code file provided for this lab includes the variable declarations and the input statements. Comments are included in the file to help you write the remainder of the program.
Instructions

Write the C++ statements as indicated by the comments.
Execute the program by clicking the Run button at the bottom of the screen.

Grading

When you have completed your program, click the Submit button to record your score.



++// Computation.cpp - This program calculates sum, difference, and product of two values.
// Input: Interactive
// Output: Sum, difference, and product of two values.

#include
#include
void calculateSum(double, double);
void calculateDifference(double, double);
void calculateProduct(double, double);
using namespace std;

int main()
{
double value1;
double value2;

cout << "Enter first numeric value: ";
cin >> value1;
cout << "Enter second numeric value: ";
cin >> value2;

// Call calculateSum

// Call calculateDifference

// Call calculateProduct

Answers

Answer 1

Answer:

The functions are as follows:

void calculateSum(double n1, double n2){

   cout<<n1+n2<<endl; }

void calculateDifference(double n1, double n2){

   cout<<n1-n2<<endl; }

void calculateProduct(double n1, double n2){

   cout<<n1*n2<<endl; }

Call the functions in main using:

calculateSum(value1,value2);

calculateDifference(value1,value2);

calculateProduct(value1,value2);

Explanation:

This defines the calculateSum() function

void calculateSum(double n1, double n2){

This prints the sum

   cout<<n1+n2<<endl; }

This defines the calculateDifference() function

void calculateDifference(double n1, double n2){

This prints the difference

   cout<<n1-n2<<endl; }

This defines the calculateProduct() function

void calculateProduct(double n1, double n2){

This prints the product

   cout<<n1*n2<<endl; }

This calls each of the function

calculateSum(value1,value2);

calculateDifference(value1,value2);

calculateProduct(value1,value2);

See attachment for complete program


Related Questions

Summary of how I could use my Video Skills outside of school

Answers

Answer:

u can take videos of your journey

- enjoy the moment (like using videos in snap)

- you can record ur life

hope this helps

Answer:

you could make some videos for money

Explanation:

Which of the following would not be stored in a cell ?

A. Formula
B. Text
C. Number
D. Chart​

Answers

Answer:

D

Explanation:

Because you can put formulas, text and numbers into a salad, but you can not put a chart interrupt because it won't fit in a cell.

In an online shopping application, the primary case type PurchaseOrder has two child case types: Payment and Packaging. In processing PurchaseOrder case PO-11, Payment case Pay-37 and Packaging case Pac-56 are created. Which statement about the processing of PO-11, Pay-37, and Pac-56 is correct?
A. PO-11 has to be resolved before either Pay-37 and Pac-56 is resolved.
B. Pac-56 has to be resolved before Pay-37 is resolved.
C. Both Pay-37 and Pac-56 have to be resolved before PO-11 can be resolved.
D. PO-11 can be resolved when either Pay-37 or Pac-56 is resolved.

Answers

Answer:

The answer is "Option C".

Explanation:

The principal instance type PurchaseOrder has two types of instance children in an online purchasing application: Pay and Packing. Pay case Pay-37 and packing instance Pac-56 are designed to Sales Orders case PO-11 execution. All statements regarding PO-11, Pay-37, and Pac-56 should be settled before PO-11 may be addressed. Both Pay-37 and Pac-56.

Check out this app! It's millions of students helping each other get through their schoolwork. https://brainly.app.link/qpzV02MawO ​

Answers

Answer:

Tamam hocam o zaman....

Other Questions
According to the general equation for conditional probability, if P(An B9 =001 -and P(B)=718what is P(AB)?A. 5/7B. 3/7C. 4/7D. 2/7 As you increase the temperature, the rate of photosynthesis increases and then decreases.TrueFalse Whats is the answer plzzzz help eacg fruit basket has 5 apples and 3 pears . what is the ratio of the total number of fruits to the numbers of pears in each fruit basket ? what is the impact of Corona virus as one of the socio economic issues on businesses Does a reaction involving an acid and a base have to take place in a water environment? Justify your answer. Please help I will award brainless to whoever helps please its urgent what change occurs to the mass of an object when a unbalanced 8. Suriin ang mga sumusunod na pahayag tungkol sa kolonyalismo at imperyalismosa Silangang Asya at Timog Silangang Asya.Pahayag 1: Ang Pilipinas ay nasakop ng bansang EspanyaPahayag 2: Nasakop ng bansang Portugal ang Malaysia sa unang yugto ng kolonyalismoA. Lahat ng pahayag ay maliB. Lahat ng pahayag ay tamaC. Pahayag 1 ay mali, pahayag 2 ay tamaD. Pahayag 1 ay tama pahayag 2 ay mali which option is an example of expository writing where active passive change buna,la anul trec a 8-a i am nceput s m gndesc la ce profil vreau la liceu..as vrea sa merg pe filologie..s mi spun va rog cineva de la filologie ce materii se fac i ct de greu este ...este nevoie sa tii foarte bine matematica sau altceva?informati-ma va rog puin.. What is the volume of a sphere with a diameter of 57.1 cm, rounded to the nearest tenth of a cubic centimeter? Francis borrowed $20 from his dad in the morning. Later, he gave his dad 8dollars back. What rational number represents the overall amount of money Francis still owes his dad? 16. Which genotype represents a recessive trait? *1 pointeeEeEAEE 10t+[tex]\geq[/tex]130+3.5t Sickle cell anaemia is an inherited autosomal recessivecondition caused by a mutation in the haemoglobinsubunit beta (HBB) gene. A male and female who arephenotypically normal, discover through genetic testingthat they are both carriers of a HBB mutant allele. What isthe probability that their first child will be biologicallyfemale and phenotypically normal? anong insidente na nagpakilala ng mabilis na galit ng kolonya ng amerikano sa britanya dahil sa pagdaragdag ng buwis sa staa sa kanilang inaagkat? the students in charge of the class booth at a carnival would like to earn $3 for every item they sell. they spent $55 for the materials to make the items. solve the inequality 3x-55_>65 which represents how many items they need to sell to make profit of at least $65 Which of the following are characteristics that are shared by ancient and modern civilizations?large citiesspecialized laborsocial classesstyles of dress Fe2O3 (s) + CO (g) -> Fe(s) + CO2 (g) (unbalanced)1.Calculate the number of grams of CO that can react with 0.150kg of Fe2O32. Calculate the number of grams of Fe and the number of grams of CO2 formed when 0.150 kg of Fe2O3 reacts