CSE 142 Lecture 4: Expressions and For Loops

44 views5 pages
Verified Note
5 Oct 2018
School
Course

Document Summary

Interactions:1:1:1:2: cannot find symbol: variabe uy in current context. In java, when everything is an integer, the answer will also be an integer. ** addition, subtraction, multiplication all work the way we think they do in the interactions pane. ** java cares about type of number and value being used (string, character, number, symbol) ** real numbers are referred to as doubles. ** when working with real numbers, answers will sometimes be off by a little bit. ** once you introduce a real number (decimal) the answer will be a real number. For (int i = 1, i <= 10, i++) { ***initialization the test the update*** the above text is black. *since the test is equal to or less than 10, the code will print hi there! 10 times. 23 for (int i = 1; i <= 8; i++) { **instead of lines 12-20 where it"s extremely repetitive, you can create a for loop, seen in lines.

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