SlideShare a Scribd company logo
1 of 6
Our Topic is if else statement
And switch case
WELCOME TO OUR
PRESENTATION
Definition of if else and swetch statement:
 The if-then statement is the most basic of all the
control flow statements. It tells your program to
execute a certain section of code only if a
particular test evaluates to true.
 The if-then-else statement provides a secondary
path of execution when an "if" clause evaluates
to false
 A switch statement checks if a variable is equal
to a list of values. The variable in the switch
statement
Public class ElseIf{
public static void main(String[]args){
int number=30;
if(number <30){
System.out.println("Number is lass then 30");
}
else if(number ==30){
System.out.println("Number is Equal 30");
}
else if(number <50){
System.out.println("Number is lass than 50");
}
else{
System.out.println("Number is greater then 30");
}
}}
Code for the if
else:
Multiple choice tests
public class mcq{
public static void main(String[] args) {
String[] multiChoice1;
Scanner input = new Scanner(System.in);
multiChoice1 = new String[5];
multiChoice1[0] = "1. Which country currently emits the most greenhouse
gases?n";
multiChoice1[1] = "blah blah";
multiChoice1[2] = "blah blah";
multiChoice1[3] = "blah blah";
multiChoice1[4] = "blah blah";String userSelect1 = multiChoice1[0];
if(userSelect1==multiChoice1[0]){
System.out.println(multiChoice1[0]);
System.out.println("A. United
States");
System.out.println("B. China");
System.out.println("C. India");
System.out.println("D. England");
System.out.println();
switch (uSelect1.toUpperCase()){
case "A":
uSelect1 = "United States";
System.out.println("Incorrect!nn");
break;
case "B":
uSelect1 = "China";
System.out.println("Correct!nn");
break;
case "C":
uSelect1 = "India";
System.out.println("Incorrect!nn");
break;
case "D":
uSelect1 = "England";
System.out.println("Incorrect!nn");
break;
default:
uSelect1 = "Incorrect, choice.nn";
break;
}
}// more multiple choice questions with similar structure}]
Daffodil International University. Object oriented programming JAVA if else statement And switch case , JAVA if else statement And switch case

More Related Content

What's hot

Simple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderSimple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderMoni Adhikary
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programmingArchana Gopinath
 
Decision making and branching in c programming
Decision making and branching in c programmingDecision making and branching in c programming
Decision making and branching in c programmingPriyansh Thakar
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C LanguageShaina Arora
 
Control Structures
Control StructuresControl Structures
Control StructuresGhaffar Khan
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C ProgrammingKamal Acharya
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrolsteach4uin
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statementsSaad Sheikh
 
Control structure C++
Control structure C++Control structure C++
Control structure C++Anil Kumar
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statementnarmadhakin
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c languagetanmaymodi4
 
C programming decision making
C programming decision makingC programming decision making
C programming decision makingSENA
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C pptMANJUTRIPATHI7
 

What's hot (20)

Simple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladderSimple if else statement,nesting of if else statement &amp; else if ladder
Simple if else statement,nesting of if else statement &amp; else if ladder
 
Control structures in c
Control structures in cControl structures in c
Control structures in c
 
If statements in c programming
If statements in c programmingIf statements in c programming
If statements in c programming
 
Control structure
Control structureControl structure
Control structure
 
Decision making and branching in c programming
Decision making and branching in c programmingDecision making and branching in c programming
Decision making and branching in c programming
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Control Structures
Control StructuresControl Structures
Control Structures
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C Programming
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
 
Control structures in C
Control structures in CControl structures in C
Control structures in C
 
Cprogrammingprogramcontrols
CprogrammingprogramcontrolsCprogrammingprogramcontrols
Cprogrammingprogramcontrols
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Control structure in c
Control structure in cControl structure in c
Control structure in c
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
 
3. control statement
3. control statement3. control statement
3. control statement
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
 
C programming decision making
C programming decision makingC programming decision making
C programming decision making
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 

Viewers also liked

Viewers also liked (17)

1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
Switch statement
Switch statementSwitch statement
Switch statement
 
Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)Database Systems - SQL - DDL Statements (Chapter 3/3)
Database Systems - SQL - DDL Statements (Chapter 3/3)
 
The Switch Statement in java
The Switch Statement in javaThe Switch Statement in java
The Switch Statement in java
 
Switch statements in Java
Switch statements  in JavaSwitch statements  in Java
Switch statements in Java
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
 
Prabu's sql quries
Prabu's sql quries Prabu's sql quries
Prabu's sql quries
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
DML Commands
DML CommandsDML Commands
DML Commands
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
SQL Data Manipulation
SQL Data ManipulationSQL Data Manipulation
SQL Data Manipulation
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Data Manipulation Language
Data Manipulation LanguageData Manipulation Language
Data Manipulation Language
 
Sql queries with answers
Sql queries with answersSql queries with answers
Sql queries with answers
 

Similar to Daffodil International University. Object oriented programming JAVA if else statement And switch case , JAVA if else statement And switch case

unit 2-Control Structures.pptx
unit 2-Control Structures.pptxunit 2-Control Structures.pptx
unit 2-Control Structures.pptxishaparte4
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional StatementsIntro C# Book
 
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdf
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdfconditionalanddvfvdfvdvdcontrolstatement-171023101126.pdf
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdfsdvdsvsdvsvds
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c languagechintupro9
 
Chapter 4.4
Chapter 4.4Chapter 4.4
Chapter 4.4sotlsoc
 
Java Decision Control
Java Decision ControlJava Decision Control
Java Decision ControlJayfee Ramos
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine LearningStudent
 
Control structures i
Control structures i Control structures i
Control structures i Ahmad Idrees
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statementsrajshreemuthiah
 
Selection Control Structures
Selection Control StructuresSelection Control Structures
Selection Control StructuresPRN USM
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programmingnmahi96
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionalish sha
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in JavaNiloy Saha
 

Similar to Daffodil International University. Object oriented programming JAVA if else statement And switch case , JAVA if else statement And switch case (20)

Lecture 3
Lecture 3Lecture 3
Lecture 3
 
unit 2-Control Structures.pptx
unit 2-Control Structures.pptxunit 2-Control Structures.pptx
unit 2-Control Structures.pptx
 
loops.pdf
loops.pdfloops.pdf
loops.pdf
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
 
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdf
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdfconditionalanddvfvdfvdvdcontrolstatement-171023101126.pdf
conditionalanddvfvdfvdvdcontrolstatement-171023101126.pdf
 
C statements.ppt presentation in c language
C statements.ppt presentation in c languageC statements.ppt presentation in c language
C statements.ppt presentation in c language
 
Chapter 4.4
Chapter 4.4Chapter 4.4
Chapter 4.4
 
Java Decision Control
Java Decision ControlJava Decision Control
Java Decision Control
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Control structures i
Control structures i Control structures i
Control structures i
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statements
 
Java loops
Java loopsJava loops
Java loops
 
Programming C Part 03
Programming C Part 03Programming C Part 03
Programming C Part 03
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Selection Control Structures
Selection Control StructuresSelection Control Structures
Selection Control Structures
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programming
 
Dti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selectionDti2143 chap 4 control structures aka_selection
Dti2143 chap 4 control structures aka_selection
 
CH-4 (1).pptx
CH-4 (1).pptxCH-4 (1).pptx
CH-4 (1).pptx
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Bsit1
Bsit1Bsit1
Bsit1
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Daffodil International University. Object oriented programming JAVA if else statement And switch case , JAVA if else statement And switch case

  • 1. Our Topic is if else statement And switch case WELCOME TO OUR PRESENTATION
  • 2. Definition of if else and swetch statement:  The if-then statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true.  The if-then-else statement provides a secondary path of execution when an "if" clause evaluates to false  A switch statement checks if a variable is equal to a list of values. The variable in the switch statement
  • 3. Public class ElseIf{ public static void main(String[]args){ int number=30; if(number <30){ System.out.println("Number is lass then 30"); } else if(number ==30){ System.out.println("Number is Equal 30"); } else if(number <50){ System.out.println("Number is lass than 50"); } else{ System.out.println("Number is greater then 30"); } }} Code for the if else:
  • 4. Multiple choice tests public class mcq{ public static void main(String[] args) { String[] multiChoice1; Scanner input = new Scanner(System.in); multiChoice1 = new String[5]; multiChoice1[0] = "1. Which country currently emits the most greenhouse gases?n"; multiChoice1[1] = "blah blah"; multiChoice1[2] = "blah blah"; multiChoice1[3] = "blah blah"; multiChoice1[4] = "blah blah";String userSelect1 = multiChoice1[0]; if(userSelect1==multiChoice1[0]){ System.out.println(multiChoice1[0]); System.out.println("A. United States"); System.out.println("B. China"); System.out.println("C. India"); System.out.println("D. England"); System.out.println();
  • 5. switch (uSelect1.toUpperCase()){ case "A": uSelect1 = "United States"; System.out.println("Incorrect!nn"); break; case "B": uSelect1 = "China"; System.out.println("Correct!nn"); break; case "C": uSelect1 = "India"; System.out.println("Incorrect!nn"); break; case "D": uSelect1 = "England"; System.out.println("Incorrect!nn"); break; default: uSelect1 = "Incorrect, choice.nn"; break; } }// more multiple choice questions with similar structure}]