-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLab11b
80 lines (70 loc) · 1.59 KB
/
Lab11b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* Name: Jacob Castaneda
* Project: 10d
* Instructor: Sister Kristi Hays
* Date: March 10, 2023
* * Description: Lab-10d: Switch Statements for Different apostles
*/
package Week11;
import java.util.Scanner;
public class Lab11b {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner (System.in);//for user input
//variables
boolean done = false;
String input = "a";
System.out.println("This program will show the name of an Apostle in their leadership role. ");
System.out.println("\nEnter a number between 1 and 15 to display the apostle of your choice. (Hit enter twice when done)");
while(!input.equals("")) {
//Switch loop begins
input= in.nextLine();
String Apostle="";
switch (input) {
case "1":
Apostle = " Russell M Nelson ";
break;
case"2":
Apostle= " Daling oaks ";
break;
case"3":
Apostle="M Rusell Ballard";
case"4":
Apostle = "Jefreey R Holland";
break;
case "5":
Apostle = "Henry B Eyring";
break;
case"6":
Apostle= "Dieter F uchdorft";
break;
case"7":
Apostle="David A Bednard";
case"8":
Apostle= "Quentin L Cook";
break;
case "9":
Apostle = "D Tood Christoferson";
break;
case"10":
Apostle= "Neil L Andersen";
break;
case"11":
Apostle="Ronald A Rasband";
case"12":
Apostle= " Gary E Stevenson";
break;
case "13":
Apostle = "Dale G Redlund";
break;
case"14":
Apostle= "Gerrit W Gong";
break;
case"15":
Apostle= "Ulisses Soares";
default:
Apostle = "is not a valid choice .Try again!";
}//end of Switch Statement
System.out.println(" Number "+ input + " is " + Apostle);
}//end of while Statement
}//end of main method
}//end of lab11b