Woes

Only available on StudyMode
  • Topic: C++, Carriage return, Wage
  • Pages : 4 (583 words )
  • Download(s) : 84
  • Published : October 31, 2012
Open Document
Text Preview
1. If a = 0, b = 1, and c = 5
a. a + b = 0 + 1 = 1

b. a > b = 0 > 1 = 0

c. 3 + b * c = 3 + 1 * 5 = 8
d. ++b = 2
e. b++ = 1
f. b <= c= 1<=5=1

g. a > 5= 0>5=0

h. ++a ==b= ++0==1=0

i. b != c=1!=5=1

j. b == c= 1==5=0

k. b = c= 1= 5=b=5

l. b / c= 1/5 = .2

m. b % c= 1%5= 1

n. b + c * 4 / 3=1+5*4/3= 7.66666667

o. 22 / (c + 3) = 22/ (5+3)= 2.75

2. Regularworkweek.cpp
#include <iostream>
using namespace std;
int main ()
{

double hourlyWage;
int weeklyHours = 40;

cout << "What is your hourly wage? "<<endl;
cin >> hourlyWage;
cout << "Your hourly wage is $ " <<hourlyWage <<endl; cout << "Your weekly pay is $ " <<hourlyWage*weeklyHours <<endl; system("PAUSE");

return 0;
}

5. Mathexcersise.cpp
#include<iostream>
using namespace std;
int main()
{
double a,b;
cout << "Enter your first value." << endl;
cin >> a;
cout << "Enter your second value." << endl;
cin >> b;
cout << a << "+" << b << "=" <<a+b<<endl; cout << a << "-" << b << "=" <<a-b<<endl; cout << a << "*" << b << "=" <<a*b<<endl; cout << a << "/" << b << "=" <<a/b<<endl; cout << "or" <<endl;

cout << b << "+" << a << "=" <<b+a<<endl; cout << b << "-" << a << "=" <<b-a<<endl; cout << b << "*" << a << "=" <<b*a<<endl; cout << b << "/" << a << "=" <<b/a<<endl; system ("PAUSE");

return 0;
}

9. Phonecall.cpp
#include<iostream>
using namespace std;
struct phoneCall
{
int minutesPerCall;

};
int main()
{
phoneCall...
tracking img