homework4-Hunt

# homework4-Hunt - Tyler Hunt 07:03:37 ECE 1574 HW 4 1)...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tyler Hunt 07:03:37 ECE 1574 HW 4 1) #include <iostream> using namespace std; int main() { char a, b; cout << "Please enter 2 letters." << endl; cin >> a; cin >> b; if ( a > b ) cout << a << " has a greater value than " << b << endl; else if ( a < b ) cout << b << " has a greater value than " << a << endl; return EXIT_SUCCESS; } 3) #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double PI; PI = 3.14159; double thetaR, thetaD; cout << "Theta: cos(Theta):" << endl; cout << "-------------------" << endl; for ( thetaD = 0; thetaD <= 360; thetaD += 10 ) { thetaR = (PI/180) * thetaD; cout << setw (5); cout << thetaD; switch ( cos (thetaR) <= 0.0000001 ) { Tyler Hunt 07:03:37 ECE 1574 HW 4 cout << "0.0" << endl; } cout << setw (14); cout << cos (thetaR) << endl; } return 0; } 4) #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double PI; PI = 3.14159; double thetaR, thetaD; cout << "Theta: cos(Theta):" << endl;...
View Full Document

## This note was uploaded on 04/14/2010 for the course COMM 2064 taught by Professor Jimkuypers during the Spring '08 term at Virginia Tech.

### Page1 / 7

homework4-Hunt - Tyler Hunt 07:03:37 ECE 1574 HW 4 1)...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online