CSCI 1300 Quiz: 23 Jan 2007 1. What is the value of each expression in C++? Data types are int (if there is no decimal point) or double (if there is a decimal point): ANSWERS APPEAR AFTER EACH QUESTION A. 14 / 10 is 1 B. 14 % 10 is 4 C. 7 / 10 is 0 D. 7 % 10 is 7 E. 14.0 / 10.0 (two doubles) is 1.4 F. 14.0 / 10 (one double, one int) is 1.4 2. Write an arithmetic expression in C++ for this one mathmatical expression that involves one addition (in the numerator), one division and one multiplication (in the denominator): a + b ------- <<-- this is the division! cd ANSWER: (a + b)/(c*d) Correct (a + b)/c*d Incorrect (a + b)/cd Incorrect // Put these three lines at the top of your main program // so that every double number you print comes out with // two digits after the decimal point. (See page 320.) cout.setf(ios::showpoint); cout.setf(ios::fixed); cout.setprecision(2);