Switch Statements

4 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€47.77
List Price:  €66.88
You save:  €19.11
£39.64
List Price:  £55.51
You save:  £15.86
CA$70.94
List Price:  CA$99.32
You save:  CA$28.38
A$78.59
List Price:  A$110.04
You save:  A$31.44
S$67.09
List Price:  S$93.93
You save:  S$26.84
HK$388.70
List Price:  HK$544.21
You save:  HK$155.51
CHF 45.01
List Price:  CHF 63.01
You save:  CHF 18
NOK kr556.49
List Price:  NOK kr779.13
You save:  NOK kr222.64
DKK kr356.31
List Price:  DKK kr498.87
You save:  DKK kr142.55
NZ$87.54
List Price:  NZ$122.57
You save:  NZ$35.02
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.45
৳6,082.62
List Price:  ৳8,516.16
You save:  ৳2,433.53
₹4,345.36
List Price:  ₹6,083.86
You save:  ₹1,738.49
RM222.23
List Price:  RM311.14
You save:  RM88.91
₦75,492.39
List Price:  ₦105,695.39
You save:  ₦30,203
₨13,978.18
List Price:  ₨19,570.57
You save:  ₨5,592.39
฿1,684.21
List Price:  ฿2,358.03
You save:  ฿673.82
₺1,813.34
List Price:  ₺2,538.83
You save:  ₺725.48
B$286.22
List Price:  B$400.73
You save:  B$114.51
R918.92
List Price:  R1,286.57
You save:  R367.64
Лв93.45
List Price:  Лв130.83
You save:  Лв37.38
₩72,018.15
List Price:  ₩100,831.17
You save:  ₩28,813.02
₪178.28
List Price:  ₪249.61
You save:  ₪71.32
₱2,907.99
List Price:  ₱4,071.42
You save:  ₱1,163.43
¥7,590.87
List Price:  ¥10,627.83
You save:  ¥3,036.95
MX$1,012.87
List Price:  MX$1,418.09
You save:  MX$405.22
QR182.48
List Price:  QR255.49
You save:  QR73
P691.04
List Price:  P967.51
You save:  P276.47
KSh6,461.20
List Price:  KSh9,046.20
You save:  KSh2,585
E£2,529.99
List Price:  E£3,542.20
You save:  E£1,012.20
ብር6,426.16
List Price:  ብር8,997.14
You save:  ብር2,570.97
Kz45,590.88
List Price:  Kz63,830.88
You save:  Kz18,240
CLP$47,388.02
List Price:  CLP$66,347.02
You save:  CLP$18,959
CN¥363.92
List Price:  CN¥509.52
You save:  CN¥145.59
RD$3,107.31
List Price:  RD$4,350.49
You save:  RD$1,243.17
DA6,740.10
List Price:  DA9,436.68
You save:  DA2,696.58
FJ$114.89
List Price:  FJ$160.86
You save:  FJ$45.96
Q386.25
List Price:  Q540.79
You save:  Q154.53
GY$10,474.43
List Price:  GY$14,665.04
You save:  GY$4,190.61
ISK kr7,008.09
List Price:  ISK kr9,811.89
You save:  ISK kr2,803.80
DH498.75
List Price:  DH698.29
You save:  DH199.54
L932.39
List Price:  L1,305.42
You save:  L373.03
ден2,939.32
List Price:  ден4,115.28
You save:  ден1,175.96
MOP$401.15
List Price:  MOP$561.64
You save:  MOP$160.49
N$922.85
List Price:  N$1,292.07
You save:  N$369.21
C$1,842.14
List Price:  C$2,579.14
You save:  C$737
रु6,955.59
List Price:  रु9,738.38
You save:  रु2,782.79
S/185.20
List Price:  S/259.30
You save:  S/74.09
K201.36
List Price:  K281.92
You save:  K80.56
SAR187.48
List Price:  SAR262.49
You save:  SAR75.01
ZK1,408.06
List Price:  ZK1,971.40
You save:  ZK563.33
L237.76
List Price:  L332.89
You save:  L95.12
Kč1,197.96
List Price:  Kč1,677.24
You save:  Kč479.28
Ft19,190.82
List Price:  Ft26,868.69
You save:  Ft7,677.86
SEK kr535.66
List Price:  SEK kr749.97
You save:  SEK kr214.31
ARS$52,958.15
List Price:  ARS$74,145.65
You save:  ARS$21,187.50
Bs347.18
List Price:  Bs486.09
You save:  Bs138.90
COP$206,555.21
List Price:  COP$289,193.83
You save:  COP$82,638.61
₡25,356.42
List Price:  ₡35,501.02
You save:  ₡10,144.59
L1,276.31
List Price:  L1,786.93
You save:  L510.62
₲395,669.61
List Price:  ₲553,969.11
You save:  ₲158,299.50
$U2,162.01
List Price:  $U3,026.99
You save:  $U864.97
zł198.63
List Price:  zł278.10
You save:  zł79.46
Already have an account? Log In

Transcript

Okay in Java, we also have a switch statement. So let's say I have cha cha maybe I gave you some great sauce, I'm back. Okay, let's say I gave you a grid. So this is a character, variable, character, data type. And then we have these switch. k switch and let's see.

Case. A. printer System dot out dot print. ly put in a go. Let's see. case B. When System dot out dot println lie ah okay maybe fair case see System dot out dot print line and I see APU try harder for that great I should have the D FOSS demon the font means the L steamin gay D file that is na r dot pre okay say try ah Try less a more harder okay.

I see run this code now I have adisa statement print out so if I want to let's see made this statement correct or made this program correct then I need to add in a break statement here the break and then here I also need a break Andy for a cane also a yeah now let's see. I run the project he'll give me If I change to be it will give me the fair. If I change to see it will give me the try harder. If I change to let's say let's say D day will give me the default one try more harder okay. This is the system. So, he is I will say is like the SD mode so, so ah if gray is a, then printer good.

If gray is B, then print this affair. If greatest C then print these try harder for better gray or else then we print these try more harder. So, this is like the ethos, the fan statements inside a eval statement. So a C statement or these c saying case statement is actually another way of writing the if statement.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.