File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ Java also supports a <c>switch</c> statement that acts something like the <c>eli
173173 <title >Match Case Example</title >
174174 <code >
175175 grade = 85
176+ # Convert grade to a scale of 0-10 using integer division
176177 tempgrade = grade // 10
177178 def grading(tempgrade):
178179 match grade:
@@ -204,8 +205,9 @@ Java also supports a <c>switch</c> statement that acts something like the <c>eli
204205 <program xml : id =" java-switch-up" interactive =" activecode" language =" java" >
205206 <code >
206207 public class SwitchUp {
207- public static void main(String args[]) {
208+ public static void main(String args[]) {
208209 int grade = 85;
210+ // Convert grade to a scale of 0-10 using integer division
209211 int tempgrade = grade / 10;
210212 switch(tempgrade) {
211213 case 10:
@@ -224,7 +226,7 @@ Java also supports a <c>switch</c> statement that acts something like the <c>eli
224226 default:
225227 System.out.println('F');
226228 }
227- }
229+ }
228230 }
229231 </code > <tests > </tests >
230232 </program >
You can’t perform that action at this time.
0 commit comments