ECON 1 Lecture Notes - Lecture 17: Standard Streams, Frodo Baggins

14 views3 pages
School
Department
Course
Professor

Document Summary

Abd: 2, 3. 1-3. 5, 3. 8, 3. 10, 4. 1-4. 2, 4. 8-4. 9, 5. 1-5. 5, 9. 4-9. 6. How to write the code with a scanner: import java. util. From then on, you want to read in a value into a variable: int x = stdin. nextint(); double d = stdin. (nextdouble); or x = stdin. nextint(); d = stdin. nextdouble(); You can find the different methods to use a scanner on this document: https://docs. oracle. com/javase/8/docs/api/java/util/scanner. html. Think of mathematical functions: sin(, cos(, tan() Input and output: they take input (the angle, and produce output (the result) In java they are called: math. sin(, math. cos(, math. tan(, meaning, from the math library, call the sin() method. A constant is a variable that cannot be changed: Constants have a specific naming scheme: miles_per_kilometer, all caps, with underscores for spaces. Two values: true and false: boolean. You can use any of this type to define variables that can hold which correspond only to that type. The boolean type has only two values: true, false.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents