Enum in a Switch Statement learning material.pptx

Steins18 6 views 4 slides Sep 10, 2024
Slide 1
Slide 1 of 4
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4

About This Presentation

learning material for java


Slide Content

Enum in a Switch Statement Java programming

Directions: Recall your topics on Switch Statement, create your own program using enum in a switch statement with the basis on the next slide.

enum Level { LOW, MEDIUM, HIGH } public class Main { public static void main(String[] args ) { Level myVar = Level.MEDIUM ; switch( myVar ) { case LOW: System.out.println ("Low level"); break; case MEDIUM: System.out.println ("Medium level"); break; case HIGH: System.out.println ("High level"); break; } } }

Rubrics Points Description 20 The student successfully executes the program without mistakes. 12 The student successfully executes the program with very little mistakes. 8 The student successfully executes the program with moderate mistakes. 5 The student was not able to completely execute the program but details and layout of the drawing. 2 The student was not able execute the program .
Tags