College Homework Help

closed account (37S1hbRD)
My homework assignment is to.

Write a c++ program that allows the user to enter two values. Display the results of adding the two values, subtracting them form each other, multiplying them, and dividing them. Note I am new to c++ I do not know how to do this if any one can help me please do so thank you.
closed account (37S1hbRD)
In class tonight we wrote this but i still don't get it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// NumberDemo.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<iostream>
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	int a,b,c;
	double x,y,z;
	a = 13;
	b = 4;
	x = 3.3;
	y = 15.78;
	c = a + b;
	cout << "a + b is " << c << endl;
	z = x + y;
	cout << "x + y is " << z << endl;
	c = a / b;
	cout << "a / b is " << c << endl;
	c = a % b;
	cout << "a % b is " << c << endl;
	a = 2;
	c = ++a;
	cout << "a is " << a << " and c is " << c << endl;
	a = 2;
	c = a++;
	cout << "a is " << a << " and c is " << c << endl;
	system ("pause.exe");
	return 0;
}
Here is what you want to do:

1
2
3
4
5
6
7
8
9
10
int main()
{ 
      // declare three vars to be used
      // ask for input for each var, check if input is good
 
     //print out the result of addition/multiplication/subtraction
     //example: 
     cout << "The value is: " << (add two variable together here) << endl;
    return 0;
}


make sense?
closed account (37S1hbRD)
Sounds good to me.
Topic archived. No new replies allowed.