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
Evgesh-ka [11]
3 years ago
13

SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplie

s two int values to find their product.Three ints should be passed to the multiplyNumbers() function, the two numbers to be multiplied (num1 and num2) should be passed by value, and another int (product) to hold the product of the two numbers should be passed by reference, enabling the multiplyNumbers() function to change its value.The source code file provided for this lab includes the necessary variable declarations and input and output statements. Comments are included in the file to help you write the remainder of the program.Instructions:Open the source code file named MultiplyTwo.cpp using the code editor.Write the multiplyNumbers() function, the function declaration, and the function call as indicated by the comments.Execute the program by clicking "Run Code."Rewrite the multiplyNumbers() function to pass the two numbers (num1 and num2) by value and to pass product by address.Execute the program. It should generate the same output.// MultiplyTwo.cpp - This program calculates the product of two numbers.// It demonstrates pass by reference and then pass by address.// Input: None// Output: The product of two numbers#include using namespace std;// Write function declaration hereint main(){int num1 = 10;int num2 = 20;int product = 0;// Print value of product before function callcout << "Value of product is: " << product << endl;// Call multiplyNumbers using pass by reference for product// Print value of calculated productcout << num1 << " * " << num2 << " is " << product << endl;return 0;} // End of main function// Write multiplyNumbers function here; use pass by reference for result of multiplication. Then use pass by address.
Computers and Technology
1 answer:
Maru [420]3 years ago
5 0

Answer:

Declare the method prototype using:

void multiplyNumbers(int x, int y,int &product);

Call the function using:

multiplyNumbers(num1, num2,product);

Lastly, the method is as follows:

void multiplyNumbers (int x, int y,int &product) {

  product = x * y;

  return; }

Explanation:

Declare the method prototype using

void multiplyNumbers(int x, int y,int &product);

Call the function using

multiplyNumbers(num1, num2,product);

The method is as follows; the & written in front of product implies that product is passed by reference

void multiplyNumbers (int x, int y,int &product) {

This calculate the product

  product = x * y;

This returns nothing

  return; }

<em>See attachment for complete program</em>

Download cpp
You might be interested in
How does robotic process automation (rpa) differ from intelligent automation
liq [111]

IPA automates more efficiently than RPA because IPA processes unstructured data handles exceptions and continuously learns.

<h3>What is intelligent automation?</h3>

Intelligent automation refers to the integration of robotics including multiple components from different emerging technologies.

The difference between intelligent automation and robotic process automation is Intelligent automation delivers significantly greater cost reduction.

IPA automates more efficiently than RPA because IPA processes unstructured data handles exceptions, and continuously learns.

Learn more about Intelligent automation here:

brainly.com/question/24977867

#SPJ1

6 0
2 years ago
The buttons on a specific tab are organized into logical Ribbons. <br> T<br> F
NeTakaya
I believe the answer would be true
8 0
3 years ago
Read 2 more answers
Why is it difficult to detect a Trojan horse?
marishachu [46]

Answer:

Explanation:

Because the virus disguises it self as something you are trying to download, then it attackes your device

8 0
3 years ago
Read 2 more answers
The data structure used for file directory is called
Aleks04 [339]
This is a tough question. I’m not sure if I’ll get it right but I’ll try.

Data structures used for file directories typically have a hierarchical tree structure, referred to as a directory structure. The tree has a root directory, and every file in that system has a unique path.

The simplest method of implementing a directory is to use a linear list of file names with pointers to the data blocks. But another way that you can format a file directory is by using a hash table. With this method, the linear list stores the directory entries, but a hash data structure is also used. The hash table takes a value computed from the file name and return the pointer to the file name any linear list.

So I think it’s C. But I’m not 100% sure.

I hope that helps.
6 0
3 years ago
CALL US ☏1≠855☼241☼6569 Aol mail not working on windows 10 ||123||**USA***
Nina [5.8K]

Answer:

umm

Explanation:

3 0
3 years ago
Other questions:
  • What information is not typically included in an e-mail header?​?
    15·1 answer
  • Libby wrote an email to her friend. She pressed Shift and the number key 2 together to enter the email address. Which symbol did
    7·2 answers
  • What's one way to engage teens in technology?
    8·1 answer
  • Which social media post indicates your home may be unattended?
    10·1 answer
  • Ideally an entity identifier is composed of _____ attribute(s).
    11·1 answer
  • HELP ME!! <br> it’s a cross word, but I don’t know the answers, 25 points
    12·1 answer
  • The _________ in Java is passed by value but ______ is passedby reference.
    5·1 answer
  • It is important to know the terms of use of any website because why
    12·2 answers
  • Write a recursive method that receives a string as a parameter and recursively capitalizes each character in the string (change
    5·1 answer
  • I dont uderstand dis my teacher no helping pls help me i need to understand TEch
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!