Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this lab you will continue using the other type of conditional statements: the switch-case For switch-case conditional statements, the idea is that you have

image text in transcribedimage text in transcribedimage text in transcribed

In this lab you will continue using the other type of conditional statements: the switch-case For switch-case conditional statements, the idea is that you have a variable (the switch) that will determine the next course of action depending on its value (the case) Example structure would be: int soneva riab1c 2; case l: do something break: break; someVariable is your swtich and the program will decide a case according to its value Assignment Write the class SwitchingUpMonths java. This program will be completing exactly the sarie task as Lab3c, however you will need to use switch-case conditional statements instead of if-else That is, your program must: 1. Asks a user to enter the name of a month 2. Confirms the Users input. 3. Prints the abbreviation and number corresponding to that month. The sample output for input February nl.er he monlh You entered February Its abbroviation is FeD P'his i s monl.h number In this lab you will continue using the other type of conditional statements: the switch-case For switch-case conditional statements, the idea is that you have a variable (the switch) that will determine the next course of action depending on its value (the case) Example structure would be: int soneva riab1c 2; case l: do something break: break; someVariable is your swtich and the program will decide a case according to its value Assignment Write the class SwitchingUpMonths java. This program will be completing exactly the sarie task as Lab3c, however you will need to use switch-case conditional statements instead of if-else That is, your program must: 1. Asks a user to enter the name of a month 2. Confirms the Users input. 3. Prints the abbreviation and number corresponding to that month. The sample output for input February nl.er he monlh You entered February Its abbroviation is FeD P'his i s monl.h number 3.29 Lab 6c Switching Up Months Objectives .Use Boolean expressions invn Sting comparison Use String methods substring, toupperCase, equals, and charAt . Use switch program control statement Print out a program and turn it in for eyes on grading Introduction In this lab you will cortiue using the other type of conditional statements: the switch-case For switch-case conditional statements, the idea is that you have a variable (the switch) that will determine the next course of action depending on its value (the case Example structure would be: int soncVariablc2 switch (sonVariablc) case 1: /do soothingf break; case 2: /do sonething else breaki someVariable is your swtich and the program will decide a case according to its value Assignment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago