01:198:111 Lecture Notes - Lecture 10: Multiplication Table

35 views4 pages
Verified Note

Document Summary

(!isvalid) is the same as (isvalid == false) (x>5) means x>5 is false. To do calculations with different variable types you have to cast the variable first. For example, if you have two integers but want a double answer you would write it as: double a = x/2. If x=5, then it would calculate 5/2 and a would be 2. 5. You could also make your answer a double by writing: double a = (double) x / 2. In this case, the division would be 5. 0/2 and give the answer of 2. 5. Additionally, if you have a double and cast it as an integer, it will cut off the decimal. For example: double a = 2. 5 (int) a = 2. One time actions such as set, read, display are 1 action. Each condition statement is an operation, so you count the if statement, while statement, do while statement each time the code runs it.

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

Related Questions