Download the attached file/s, copy and paste the code segment/s into your visual studio or any...

90.2K

Verified Solution

Question

Programming

Download the attached file/s, copy and paste the code segment/sinto your visual studio or any other C++ IDE and run it. You willhave to implement a small intentional bug in your program and postit for other students to debug.

To be able to receive your full discussion points, you need tosubmit the following.

Following is your check list and rubric

      Attach your .cpp file/s with animplemented bug - 20pnts
      Describe what the code does indetail - 20pnts
      Debug at least one other program andsubmit your .cpp file - 40pnts (note what the bug was incomments)
      After running the debugged program,attach the screen shot of your output- 20pnts


// This program uses a function that returns a value.
#include
using namespace std;

// Function prototype
int sum(int num1, int num2);

int main()
{
   int value1 = 20,   // The first value
       value2 = 40,   //The second value
      total;         // Holds thereturned total

   // Call the sum function, passing the contentsof
   // value1 and value2 as arguments. Assign thereturn
   // value to the total variable.
   total = sum(value1, value2);

   // Display the sum of the values
   cout << \"The sum of \" << value1 << \"and \"
        << value2 <<\" is \" << total << endl;
   return 0;
}

/*********************************************************
*                         sum                         *
* This function returns the sum of its two parameters. *
*********************************************************/
int sum(int num1, int num2)
{
   return num1 + num2;
}

Answer & Explanation Solved by verified expert
4.2 Ratings (722 Votes)
SOLUTIONWhat the codedoesThis program is used to calculate sumof two numbers using functions In    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students