SlideShare a Scribd company logo
1 of 3
Assignment Questions
Question (1):Only “if (condition) {}”
1. Write a program that inputs marks and displays “Congratulations! You have passed.”
If the marks are 40 or more.
2. Write a program that inputs two numbers and find whetherboth are equal.
3. Write a program that inputs two numbers and finds if second number is square of
first.
4. Write a program that inputs marks of three subjects. If the average of marks is more
than 80, it displays two messages “You are above standard!” and Admission granted!”
5. Write a program that inputs three numbers and displays the maximum number.
6. Write a program that inputs three numbers and displays the minimum number.
7. Write a program to input a numberand determine whether it is positive, negative or 0
8. Write a program that inputs five integers. It finds and prints the largest and smallest
integer.
9. Write a program that inputs a characterand displays whether it is vowel or not.
10. Write a program that inputs a number and finds whether it is even or odd.
Question (2):Only “if (condition) {} else{}”
1. Write a program that inputs a number and finds whether it is even or odd.
2. Write a program that inputs a year and finds whether it is leap year or not.
3. Write a program that inputs salary and grade. It adds 50% bonus if the grade is greater
than 15. It adds 25% bonus if the grade is 15 or less and then displays total salary.
4. Write a program that inputs two integer. It determines and prints it the first integer is
a multiple of second integer.
Question (3):Only “if (condition) {} elseif {} else {}”
1. Write a program that inputs test score of a student and displays his grade according to
the following criteria:
a. >=90 A
b. 80-89 B
c. 70-79 C
d. 60-69 D
e. Below 60 F
2. Write a program that calculates the electricity bill. The rates are given below:
a. If units consumed are <=300, then the cost is Rs.2 per unit.
b. If units consumed are >300 and <=500, then the cost is Rs.5 per unit.
c. If units consumed exceed 500, then the cost is Rs.7 per unit.
d. A line rent Rs.150 is also added to the total bill and a surcharge of 5% extra if
the bill exceeds Rs.2000.
e. Calculate the total bill with all the conditions given above.
3. Write a program that inputs radius and user’s choice. It calculates area of circle if user
enters 1 as choice. It calculates circumference if the user enters 2 as choice.
4. Write a program that inputs salary. It the salary is 20000 or more, it deducts 7% of
salary. If the salary is 10000 or more but less than 20000, it deducts 1000 from the
salary. It the salary is less than 10000, it deducts nothing. It finally displays the net
salary.
5. Write a program that inputs a characterand displays whether it is vowel or not.
Question (4):Only “Nesting of if-else”
1. Find grade using nesting in question mention above.
Question (5):Only “Logical operatorsin if ()”
1. Write a program that inputs three numbers and displays the maximum number.
2. Write a program that inputs three numbers and displays the minimum number.
3. Write a program that inputs a characterand displays whether it is vowel or not.
4. Write a program that allows the user to enter any character through keyboard and
determines whether it is a capital letter, small case letter, a digit number or a special
character.
5. Write a program that inputs a number and displays whether it is even or odd.
Question (6):Only “switch”
1. Write a program that inputs number of week’s day and displays the name of the day.
2. Write a program that inputs a characterfrom the user and checks whether it is vowel
or consonant.
3. Write a program that displays the following menu of a health club.
1. Standard Adult membership
2. Child Membership
3. Senior Citizen Membership
4. Quit the Program
5. It inputs choice and number of months and calculates membership charges are:
i. Standard Adult Membership Rs.50
ii. Child Membership Rs.20
iii. Senior Citizen Membership Rs.30
Question (7):Only “conditional/ternary operator”
1. Write a program that inputs a number and finds whether it is even or odd.
2. Write a program that inputs a number and displays whether it is divisible by 3 or not.
If switch structure

More Related Content

What's hot

Compiler lab final report writing
Compiler lab final report writingCompiler lab final report writing
Compiler lab final report writingUmme habiba
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab neweyavagal
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newscottbrownnn
 
2. Write a programto prompt the user to enter 2 integer values. I...
2.             Write a programto prompt the user to enter 2 integer values. I...2.             Write a programto prompt the user to enter 2 integer values. I...
2. Write a programto prompt the user to enter 2 integer values. I...hwbloom15
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchSAKSHIGAWADE2
 
name or initial, and then lastname. The program then outputs the name in the ...
name or initial, and then lastname. The program then outputs the name in the ...name or initial, and then lastname. The program then outputs the name in the ...
name or initial, and then lastname. The program then outputs the name in the ...licservernoida
 
Assignment java workshop
Assignment java workshopAssignment java workshop
Assignment java workshopJaya Jeswani
 
Estimating the product cost using microsoft excel
Estimating the product cost using microsoft excelEstimating the product cost using microsoft excel
Estimating the product cost using microsoft excelJames Paul Antonio
 
SPL 12.1 | Multi Dimensional(Two) Array Practice Problems
SPL 12.1 | Multi Dimensional(Two) Array Practice ProblemsSPL 12.1 | Multi Dimensional(Two) Array Practice Problems
SPL 12.1 | Multi Dimensional(Two) Array Practice ProblemsMohammad Imam Hossain
 
Chapter 3 branching v4
Chapter 3 branching v4Chapter 3 branching v4
Chapter 3 branching v4Sunarto Quek
 
Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functionsErnesteNtezirizaza
 
Evaluation of postfix expression using stack
Evaluation of postfix expression using stackEvaluation of postfix expression using stack
Evaluation of postfix expression using stackshubhajitCHATTERJEE2
 
Comp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source codeComp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source codepradesigali1
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsnoahjamessss
 

What's hot (17)

practice problems on functions IN SWIFT
practice problems on functions IN SWIFTpractice problems on functions IN SWIFT
practice problems on functions IN SWIFT
 
Compiler lab final report writing
Compiler lab final report writingCompiler lab final report writing
Compiler lab final report writing
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
Hello World e4 Application Part 6
Hello World e4 Application Part 6Hello World e4 Application Part 6
Hello World e4 Application Part 6
 
2. Write a programto prompt the user to enter 2 integer values. I...
2.             Write a programto prompt the user to enter 2 integer values. I...2.             Write a programto prompt the user to enter 2 integer values. I...
2. Write a programto prompt the user to enter 2 integer values. I...
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
 
name or initial, and then lastname. The program then outputs the name in the ...
name or initial, and then lastname. The program then outputs the name in the ...name or initial, and then lastname. The program then outputs the name in the ...
name or initial, and then lastname. The program then outputs the name in the ...
 
Assignment java workshop
Assignment java workshopAssignment java workshop
Assignment java workshop
 
Estimating the product cost using microsoft excel
Estimating the product cost using microsoft excelEstimating the product cost using microsoft excel
Estimating the product cost using microsoft excel
 
SPL 12.1 | Multi Dimensional(Two) Array Practice Problems
SPL 12.1 | Multi Dimensional(Two) Array Practice ProblemsSPL 12.1 | Multi Dimensional(Two) Array Practice Problems
SPL 12.1 | Multi Dimensional(Two) Array Practice Problems
 
Chapter 3 branching v4
Chapter 3 branching v4Chapter 3 branching v4
Chapter 3 branching v4
 
Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functions
 
Experiment 9(exceptions)
Experiment 9(exceptions)Experiment 9(exceptions)
Experiment 9(exceptions)
 
Evaluation of postfix expression using stack
Evaluation of postfix expression using stackEvaluation of postfix expression using stack
Evaluation of postfix expression using stack
 
Comp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source codeComp 220 i lab 3 bank account lab report and source code
Comp 220 i lab 3 bank account lab report and source code
 
Devry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 

Similar to If switch structure

C programming assignment presentation file
C programming assignment presentation fileC programming assignment presentation file
C programming assignment presentation filesantoshkumarhpu
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy BookAbir Hossain
 
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docx
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docxLab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docx
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docxABDULAHAD507571
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newLast7693
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Cis 355 i lab 2 of 6
Cis 355 i lab 2 of 6Cis 355 i lab 2 of 6
Cis 355 i lab 2 of 6helpido9
 
Cis 355 ilab 2 of 6
Cis 355 ilab 2 of 6Cis 355 ilab 2 of 6
Cis 355 ilab 2 of 6comp274
 
Cis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universityCis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universitysjskjd709707
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codepradesigali1
 
Cis 355 ilab 6 of 6
Cis 355 ilab 6 of 6Cis 355 ilab 6 of 6
Cis 355 ilab 6 of 6comp274
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codepradesigali1
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c languageIndia
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 handseyavagal
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codepradesigali1
 
Please help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdfPlease help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdffsenterprises
 

Similar to If switch structure (19)

Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
C programming assignment presentation file
C programming assignment presentation fileC programming assignment presentation file
C programming assignment presentation file
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docx
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docxLab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docx
Lab 4 ,5 & 6 Submission (3) 14136_Mohsin Alvi.docx
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
Md university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab newMd university cmis 102 week 4 hands on lab new
Md university cmis 102 week 4 hands on lab new
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Cis 355 i lab 2 of 6
Cis 355 i lab 2 of 6Cis 355 i lab 2 of 6
Cis 355 i lab 2 of 6
 
Cis 355 ilab 2 of 6
Cis 355 ilab 2 of 6Cis 355 ilab 2 of 6
Cis 355 ilab 2 of 6
 
Cis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universityCis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry university
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 
Cis 355 ilab 6 of 6
Cis 355 ilab 6 of 6Cis 355 ilab 6 of 6
Cis 355 ilab 6 of 6
 
Statement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docxStatement of Operations and Financial StatementsSubmit written r.docx
Statement of Operations and Financial StatementsSubmit written r.docx
 
Comp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source codeComp 122 lab 3 lab report and source code
Comp 122 lab 3 lab report and source code
 
Conditional structure problems
Conditional structure problemsConditional structure problems
Conditional structure problems
 
best notes in c language
best notes in c languagebest notes in c language
best notes in c language
 
Md university cmis 102 week 5 hands
Md university cmis 102 week 5 handsMd university cmis 102 week 5 hands
Md university cmis 102 week 5 hands
 
Comp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source codeComp 122 lab 6 lab report and source code
Comp 122 lab 6 lab report and source code
 
Please help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdfPlease help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdf
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 

Recently uploaded (20)

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 

If switch structure

  • 1. Assignment Questions Question (1):Only “if (condition) {}” 1. Write a program that inputs marks and displays “Congratulations! You have passed.” If the marks are 40 or more. 2. Write a program that inputs two numbers and find whetherboth are equal. 3. Write a program that inputs two numbers and finds if second number is square of first. 4. Write a program that inputs marks of three subjects. If the average of marks is more than 80, it displays two messages “You are above standard!” and Admission granted!” 5. Write a program that inputs three numbers and displays the maximum number. 6. Write a program that inputs three numbers and displays the minimum number. 7. Write a program to input a numberand determine whether it is positive, negative or 0 8. Write a program that inputs five integers. It finds and prints the largest and smallest integer. 9. Write a program that inputs a characterand displays whether it is vowel or not. 10. Write a program that inputs a number and finds whether it is even or odd. Question (2):Only “if (condition) {} else{}” 1. Write a program that inputs a number and finds whether it is even or odd. 2. Write a program that inputs a year and finds whether it is leap year or not. 3. Write a program that inputs salary and grade. It adds 50% bonus if the grade is greater than 15. It adds 25% bonus if the grade is 15 or less and then displays total salary. 4. Write a program that inputs two integer. It determines and prints it the first integer is a multiple of second integer. Question (3):Only “if (condition) {} elseif {} else {}” 1. Write a program that inputs test score of a student and displays his grade according to the following criteria: a. >=90 A b. 80-89 B c. 70-79 C d. 60-69 D e. Below 60 F 2. Write a program that calculates the electricity bill. The rates are given below: a. If units consumed are <=300, then the cost is Rs.2 per unit. b. If units consumed are >300 and <=500, then the cost is Rs.5 per unit. c. If units consumed exceed 500, then the cost is Rs.7 per unit.
  • 2. d. A line rent Rs.150 is also added to the total bill and a surcharge of 5% extra if the bill exceeds Rs.2000. e. Calculate the total bill with all the conditions given above. 3. Write a program that inputs radius and user’s choice. It calculates area of circle if user enters 1 as choice. It calculates circumference if the user enters 2 as choice. 4. Write a program that inputs salary. It the salary is 20000 or more, it deducts 7% of salary. If the salary is 10000 or more but less than 20000, it deducts 1000 from the salary. It the salary is less than 10000, it deducts nothing. It finally displays the net salary. 5. Write a program that inputs a characterand displays whether it is vowel or not. Question (4):Only “Nesting of if-else” 1. Find grade using nesting in question mention above. Question (5):Only “Logical operatorsin if ()” 1. Write a program that inputs three numbers and displays the maximum number. 2. Write a program that inputs three numbers and displays the minimum number. 3. Write a program that inputs a characterand displays whether it is vowel or not. 4. Write a program that allows the user to enter any character through keyboard and determines whether it is a capital letter, small case letter, a digit number or a special character. 5. Write a program that inputs a number and displays whether it is even or odd. Question (6):Only “switch” 1. Write a program that inputs number of week’s day and displays the name of the day. 2. Write a program that inputs a characterfrom the user and checks whether it is vowel or consonant. 3. Write a program that displays the following menu of a health club. 1. Standard Adult membership 2. Child Membership 3. Senior Citizen Membership 4. Quit the Program 5. It inputs choice and number of months and calculates membership charges are: i. Standard Adult Membership Rs.50 ii. Child Membership Rs.20 iii. Senior Citizen Membership Rs.30 Question (7):Only “conditional/ternary operator” 1. Write a program that inputs a number and finds whether it is even or odd. 2. Write a program that inputs a number and displays whether it is divisible by 3 or not.