{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment 10 - CSC 124 4.1#include using...

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

View Full Document Right Arrow Icon
CSC 124 10-12-07 4.1 #include <iostream> using namespace std; int main () { float x; cout << "Please enter a number: " << endl; cin >> x; if (x > 0) cout << "This number is positive." << endl; else if (x < 0) cout << "This number is negative." << endl; else cout << "This number is zero." << endl; system ("PAUSE"); return 0; } 4.2 #include <iostream> using namespace std; int main () { float a, b, c; cout << "Please enter three numbers. Press enter after each." << endl; cin >> a >> b >> c; { if (a < b < c) cout << a << b << c << endl; else if (a < c < b) cout << a << c << b << endl; else if (b < a < c) cout << b << a << c << endl; else if (b < c < a) cout << b << c << a << endl; else if (c < a < b) cout << c << a << b << endl; else if (c < b < a) cout << c << b << a << endl; } system ("PAUSE");
Background image of page 1

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

View Full Document Right Arrow Icon
return 0; } 4.3 #include <iostream> using namespace std; int main () { int x; cout << "Please enter an integer between 0 and 35: " << endl; cin >> x; if (x <= 9) cout << "\n Your number is: " << x << endl; else cout << "\n The letter representing your number is : " << static_cast<char>(x) << endl; system ("PAUSE"); return 0; } 4.4 #include <iostream> #include <iomanip> using namespace std; int main () { const float connect_fee = 1.99; const float first_three = 2.00; float x, addition_min, amount_due;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}