Question

Need help coding this program and please explain how the operations work in pseudocode please.

Problem: Starting with the following C++ program #include <iostream> using namespace std; void main () long Var16; long Var210; long var3 = 15; long Var4 21; long Var522; long Sum; long Result; long Remainder; const unsigned byte c-6: const unsigned byte c2-10; const unsigned byte c3-15 const unsigned byte c4 21; const unsigned byte c5 22; a sm cout << Sum is cout << Result 13 cout << Remainder is<<Remainder << endl; <<Sum << endl <Result << endl; Inside the block denoted by the asm keyword. perform the following math 1) Add the values in variables Varl, Var2, Var3, Var4, and Var5. Place the 2) Calculate the result of the expression: (cl+c2)*(c3-c4) (c5+cl). Place the operations sum into the variable Sum result into the variable Result and the remainder of the division into the variable Remainder

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program

#include<iostream>
using namespace std;
int main()
{
    long Var1=6;
    long Var2=10;
    long Var3=15;
    long Var4=21;
    long Var5=22;
    long Sum;
    long Result;
    long Remainder;

    const unsigned int c1=6;
    const unsigned int c2=10;
    const unsigned int c3=15;
    const unsigned int c4=21;
    const unsigned int c5=22;

    Sum=Var1+Var2+Var3+Var4+Var5;
    Result=(c1+c2)*(c3-c4)/(c5+c1);
    Remainder=(c1+c2)*(c3-c4)%(c5+c1);

    cout<<"Sum is "<<Sum<<endl;
    cout<<"Result is "<<Result<<endl;
    cout<<"Remainder is "<<Remainder<<endl;

    return 0;
}

Add a comment
Know the answer?
Add Answer to:
Need help coding this program and please explain how the operations work in pseudocode please. Problem:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT