COMP 202 Lecture Notes - Lecture 7: Bracket

10 views4 pages
jc123 and 40170 others unlocked
COMP 202 Full Course Notes
100
COMP 202 Full Course Notes
Verified Note
100 documents

Document Summary

Write a program using if-else blocks to take a percentage grade and print the corresponding letter. The letter grade should be of type of type int. Because this ends with an else, and there"s no these condition after the else, conditions are true, then the student will get an f. This program would probably be more useful if the computer asked the grade. In order to obtain user input , we can create a variable of type java. util. scanner conversational shorthand. , or scanner in java. util. scanner input = new java. util. scanner(system. in); int myinteger = input. nextint(); This is a very odd looking variable. is the type in the same way that int is the type. is the variable name java. util. scanner input java. util. scanner(system. in); You can memorize it if you want, but on exams we will have an appendix with this kind of stuff on 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