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
Which routing protocol does an exterior router use to collect data to build its routing tables?
natita [175]

Answer:

D. BGP

Explanation:

In order to exchange routing information with another AS (Autonomous Systems) only, exterior routers use an exterior routing protocol, like BGP (Border Gateway Protocol) or EGP (Exterior Routing Protocol).

BGP is an application-layer protocol in the TCP/IP suite, that uses a well-known TCP port (179) in order to deliver information reliably.

It is important to note that in order to exchange routing data within his own AS, the router uses an interior routing protocol, like OSPF.

3 0
4 years ago
Part of metacognition involves making a plan to address <br> .
Ray Of Light [21]

Answer:

weaknesses

Explanation:

hope this helps :)

8 0
3 years ago
Read 2 more answers
How has technology effected the way we communicate?
horsena [70]

Indeed it has.

Advancements in technology and changes in communication generally go hand in hand. Landlines displaced the telegraph and cell phones replaced landlines. The arrival of the internet opened new doors of personal communication. E-mails replaced postal mails and social media took the place of text messages.

Communication technology, such as mobile phones, email, text messaging, instant messaging and social networking have had a profound effect on nearly everyone's business and personal lives. While technology makes communications faster and easier, at times it can also be intrusive and misinterpreted.

Increased isolation, reduced social interaction and social skills, and increased human-to-machine interactions are all a result of an overuse of technology, which has created a wall between many people globally.

Technology has the ability to enhance daily living from appliances to mobile devices and computers, technology is everywhere. ... In the rise of digital communication, technology can actually help communication skills because it allows people to learn written communication to varying audiences.

<em>-Astolfo</em>

3 0
3 years ago
Consider a computer system, where each processor can independently perform a separate task. given that the response time on a co
vekshin1
First four tasks = 8 seconds
Next four tasks = 8 seconds
Last two tasks = 8 seconds

The total number of seconds to perform all tasks is 24 seconds.

The throughput, which would be the number of tasks per second, is calculated by taking the number of tasks and dividing by the number of seconds:

10 tasks / 24 seconds = 5/12 or 0.4167 tasks per second
8 0
3 years ago
I have no idea which one please help!
shutvik [7]

Answer:

i think its the second one

Explanation:

brainliest pls

6 0
3 years ago
Read 2 more answers
Other questions:
  • Clip art, by default, is formatted as a(n) ____, which cannot be moved to a precise location on a page.
    14·1 answer
  • Which of them does not support decision making? Options DSS, GDSS, ESS All of above
    10·1 answer
  • Which osi reference model layer includes all programs on a computer that interact with the network?
    13·1 answer
  • Working at a ski resort in the mountains has its own unique security issues. Kenny is the chief information officer for Sundance
    10·1 answer
  • If str 1 and str2 are both Strings, which of the following expressions will correctly
    13·1 answer
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • A(n) _________ is a computer system which is part of a larger system which performs a dedicated function.
    8·1 answer
  • Explain mechanical computer ,electromechanical and electronic computer with example<br>​
    11·1 answer
  • My brainly isnt working it isnt showing and answers wats going on? wat do i do
    14·2 answers
  • Chris needs to modify the default bullets that are used in a nonnumbered list in Word.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!