*** PYTHON ***
. Assume the user follows the instructions correctly, and the
program runs without error. The full-points for this assignment is
10. How many points this student will receive for this
assignment?
1 //wt4 Java 2 import java.util.Scanner; 3 4 public class MyHomework 5 { 6 public static void main(String[] args) 7 { 8 Scanner scan = new Scanner(System.in); 9 String str 10 11 while (true) 12 { 13 System.out.println("Enter something, enter 'quit' or 'stop' to stop: "); str = scan.nextLine(); 14 15 if (str.equalsIgnoreCase("quit") || str.equalsIgnoreCase("stop")) break; 16 17 else 18 System.out.println("You've got it"); 19 20 21 22 } 23 9. I works perfectly. Although the student is not in CTP 160, but it should receive partial points. 10. Although the program contains a while-true loop, but the loop has one and only one exit. It's acceptable. O 0. white True loop is considered violating the spirit of the loops. O I don't know. } }
*** PYTHON *** . Assume the user follows the instructions correctly, and the program runs without error. The full-points
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am