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
Why are there problems with patching electronics such as heart rate monitors and MRI machines that run embedded Windows OSs?
timofeeve [1]

Answer:

The various problems with patching electronics such as heart rate monitors and MRI machines that run embedded Windows OSs is that they have a certification which is usually at a specific revision level.

Another issue is that probably the maker or the manufacturer didn’t provide the patch method which would have been used to fix such electronics.

8 0
3 years ago
What version of bluetooth is installed on the yaesu ft-5dr?.
Olin [163]

Answer:

version 4.2

Explanation:

5 0
2 years ago
Bill is building a project network that involves testing a prototype. he must design the prototype (activity 1), build the proto
Vedmedyk [2.9K]

Answer:

Bill is building a project network that involves testing a prototype. he must design the prototype (activity 1), build the prototype (activity 2), and test the prototype (activity 3). activity 1 is the predecessor for activity 2 and activity 2 is the predecessor for activity 3. if the prototype fails testing, bill must redesign the prototype; therefore, activity 3 is a predecessor for activity 1. this is an example of

b. looping

Explanation:

  • The given example is of looping because each activity is leading to another activity on the completion of some conditions.
  • The answer a is not valid as it is not just an example of conditional statements rather it is a loop which will keep moving until unless reached a situation to end it.
  • The option c, d an e are not right options for the given example.
4 0
4 years ago
Observing users as they enter passwords or other personal information to a computer Auditing software often used to test compute
GuDViN [60]

Answer:

Explanation:

1. Observing users as they enter passwords or other personal information to a computer Auditing software often used to test computer data - (shoulder surfing)

2. An acronym for security institute that studies computer crime activities The act of altering data that are entered into, or used by, a computer --- (CSI)

3. A small text file that stores information about your browsing habits and interests Stealing personal information from trash cans - (COOKIES)

4. A software program specifically designed for computer forensic investigations - (EnCase)

5. A type of fraud in which the perpetrator steals small amounts from many different accounts - (salami technique)

6. A software program or hardware device designed to prevent unauthorized data communications - (firewall)

7. Malicious software similar to a computer virus -- (_worm)

8. Federal legislation aimed specifically at computer crime (CFAA)

8 0
3 years ago
Which of the following activities are performed by computer programmers? Choose all that apply.
AleksAgata [21]

Answer:

- They write step by step instructions for a computer to follow.

- They create a logic problem that the computer program can solve.

3 0
3 years ago
Other questions:
  • Does anyone have any social media message me
    14·1 answer
  • What is the name of Louis and Auguste Lumiere's invention that incorporated a camera, a printer, and a project all in one machin
    8·1 answer
  • Median of a sample If the distribution is given, as above, the median can be determined easily. In this problem we will learn ho
    15·1 answer
  • What is another term used for data dictionary?
    12·1 answer
  • Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is: 9_
    6·1 answer
  • 3. Matthew captures traffic on his network and notices connections using ports 20, 22, 23, and 80. Which port normally hosts a p
    14·1 answer
  • Write a function named "list_concat" that takes a list of strings as a parameter and returns the concatenation of all the values
    13·1 answer
  • Computer memory uses different numbers of bytes to store different data types.
    7·1 answer
  • When memory allocation is ____, it means all portions of the program and OS are loaded into sequential locations in memory.
    15·1 answer
  • How do you delete your brainly account
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!