CSE 100 Final: Final Exam (2/4) - Fall 2017

438 views18 pages

Document Summary

Inputting a value into a variable with cin and >: like cout, requires iostream file extraction operator >> Input is dependent on the enter key: can be used to input multiple values, when the user inputs multiple values, each value is separated by spaces on the user end. Therefore the order you place cin variable storage counts: ex if i type 3 15, for width and length values the code must be ordered cin >> width >> length. Use more spaces if specified field width is not big enough. setprecision(x): when used with fixed, print floating-point value using x digits after the decimal. If you input cout << fixed << setprecision(3) then if a given value is 2. 1786, 2. 178 (3 digits after the decimal point) will be displayed: without fixed, print floating-point value using x significant digits. Information is processed through the cpu and results are temporarily stored on main memory (ram)