COM SCI 31 Lecture Notes - Lecture 3: Semicolon, Scientific Notation, Operand

19 views3 pages
28 May 2019
School

Document Summary

Code structure: #include >hoursworked, cout<< what is your hourly pay rate? , double payrate, cin>>payrate; Different types of programming errors: compilation errors. Errors in the program indicated by compiler: syntax error. Examples: not declaring the variable, missing parenthesis, missing semicolon, semantic error: improper use of statements. A + b = c: runtime errors. The program is compiled and executed without errors. To learn grammar: f(x, y) = x*x + y*y, distancefromorigin(x, y) = sqrt(f(x, y), distancefromorigin(3. 5, 8. 9, some rules. Types: double about 10^-308 to 10^308, positive or negative, about 15 sig figs, int about -2 billion to 2 billion. One operand is double, the result is going to be double. 14 / 5 = 2: % (modulo operator) 14 % 5 = 4: double x = 3. 1 +14 / 5 = 5. 1.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents