Need Helps for a new Beginners!!!!!!!!

This is my assignment and I dont know how to do it, can anyone give me a help?

(a) Develop a flowchart and then write a C++ program to solve the following program.
Upon execution of the program, your name will be displayed, properly centered.
(b) The program will then prompt the user for two integer input and the program will then compute the sum and the product of the two numbers and produce the results of both operations with appropriate labels. See sample output for the addition operation below.
Later on this assignment.
Sum of a and b is equal to a + b or 4 + 8 and the result is 12

(c)The program will then use the same two integer numbers and perform the following
The program will evaluate and display the relations between the two numbers for the following relational operators:
>, <, ==, >=, <=, !=
Each of these operators require two operands: use the first integer number as the first operand and the second integer number as the second operand. See sample of output desired below.
a > b is 4 > 8 and the result is 0
where a is the first number and b the second number. Your solution will work for any two integer numbers.

(d) The program will then use the same two integer numbers and computes different operations using the following assignment operators:
-=, /=, %=
The results of these operations are stored in the first operand. See example below.
a -= b is 4 -= 8 and the result is a = -4
a /= b is -4 /= 8 and the result is a = 0
Note that a new value a after each operation is rippled to other operations.

1. Your program will only have one main() function, one return statement, and anything declared globally, like #include <iostream>. Parts b-d are part of one .cpp file.
2. Make sure your program execute correctly
3. Make sure the variables are correctly declared without any conflicts with other variables. You may have to change some of the variables to make each variable unique.
4. You need to run the program four times for the numbers shown below.

Test your program with the following sets of numbers:
First number Second number
4 8
20 15
30 -15
-35 -40
well, how much do you have done so far?
This is what I have done so far, I couldnt figure out part c and d

#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
int a, b;
int sum, product;

cout << " Enter the value of a:\n";
cin >> a;
cout << "Enter the value of b:\n";
cin >> b;

sum = a + b;
product = a * b;

cout << " The sum and product of "
<< a << " and " << b << " are: "
<< sum << " and "
<< product << endl;

return 0;
Here is an example of part c.

cout << a << ">" << b << "is " << (a>b) << endl;

An example of part d.

cout << a << "-=" << b << "=";
cout << a << endl;

Hope this helps.
Last edited on
Topic archived. No new replies allowed.