public class MultipleBirths
1:
2: import java.util.Scanner;
3:
4: public class MultipleBirths
5: {
6: public static void main(String[] args)
7: {
8: int numberOfBabies;
9: System.out.print("Enter number of babies: ");
10: Scanner keyboard = new Scanner(System.in);
11: numberOfBabies = keyboard.nextInt();
12:
13: switch (numberOfBabies)
14: {
15: case 1:
16: System.out.println("Congratulations.");
17: break;
18: case 2:
19: System.out.println("Wow. Twins.");
20: break;
21: case 3:
22: System.out.println("Wow. Triplets.");
23: break;
24: case 4:
25: case 5:
26: System.out.print("Unbelievable; ");
27: System.out.println(numberOfBabies + " babies.");
28: break;
29: default:
30: System.out.println("I don't believe you.");
31: break;
32: }
33: }
34: }
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47: