COSC 111 Lecture Notes - Lecture 9: Triangle

62 views2 pages
Verified Note

Document Summary

If-else statements public static void main(string[] args) { }} system. out. println("yes, my number is " + target); }} Scanner in = new scanner(system. in); int target = (int)(math. random() * 100); System. out. println("guess number between 1 to 100 "); int guess = in. nextint(); while(target != guess) { if (guess > target) { System. out. println("too low. try again: "); guess = in. nextint(); System. out. println("too high. try again: "); guess = in. nextint(); import java. util. scanner; public class guessing_game { import java. util. scanner; public class triangless { public static void main(string[] args) { Switch cases public static void main(string[] args) { System. out. println( what is the speed limit? ); int speed_limit = in. nextint(); System. out. println("school or construction? ); int zone = in. nextint(); int over = (speed_limit) - fast; switch (zone) { import java. util. scanner; public class limitss { case 1 : System. out. println(""); if (over >= 1 && over <= 20) { }else if (over >=40 && over <= 40) { }else if (over >= 41 && over <= 60) { break; case 2 :

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