SlideShare a Scribd company logo
INTERNATIONAL SCHOOL
Shaikpet, Hyderabad-500008
COMPUTER APPLICATIONS(Sample Practical Questions)
2022-23
1. Write a program to accept the year of graduation from school as an integer value from the user.
Using the Binary Search technique on the sorted array of integers given below, output the
message “Record exists” if the value input is located in the array. If not, output the message “
Record does not exist”.
{1982,1986, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010}
2. Write a program to initialize the seven wonders of the world along with their locations in two
different arrays. Search for a name of the country input by the user. If found, display the name of
the country along with its Wonder, otherwise display “Sorry Not Found”.
Seven wonders- CHICKEN ITZA, CHRIST THE REDEEMER, TAJ MAHAL, GREAT
WALL OF CHINA,
MACHU PICCHU, PETRA, COLOSSEUM.
Locations- MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example- Country Name: INDIA OUPUT: INDIA- TAJMAHAL
Country Name: USA Output: Sorry not found.
3. The annual examination results of 50 students in a class is tabulated as follows.
Roll No. Subject A Subject B Subject C
---- --- ---- ----
Write a program to read the data, calculate and display the following:
a. Average marks obtained by each student.
b. Print the roll number and average marks of the students whose average mark is above 80.
c. Print the roll number and average marks of the students whose average mark is below 40.
4. Write a java program to input 10 elements in an array and sort them using Bubble sort technique.
5. (i) double area(double a. double b, double e) with three double arguments, returns the
area of a scalene triangle using the formula:
where
(ii) double area(int a, int b, int height) with three integer arguments, returns the area of trapezium
using the formula:
(iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the area
of a rhombus using the formula:
6. Design a class to overload a function polygon() as follows:
(i) void polygon(int n, char ch) : with one integer argument and one character type argument
that draws a filled square of side n using the character stored in ch.
(ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of
length x and breadth y, using the symbol ‘@’
(iii)void polygon( ) : with no argument that draws a filled triangle shown below.
Example:
(i) Input value of n=2, ch=’O’
Output:
OO
OO
(ii) Input value of x=2, y=5
Output:
@@@@@
@@@@@
(iii) Output:
*
**
***
7. Define a class named movieMagic with the following description:
Instance variables/data members:
int year – to store the year of release of a movie
String title – to store the title of the movie.
float rating – to store the popularity rating of the movie.
(minimum rating = 0.0 and maximum rating = 5.0)
Member Methods:
(i) movieMagic() Default constructor to initialize numeric data members to 0 and String data
member to “”.
(ii) void accept() To input and store year, title and rating.
(iii) void display() To display the title of a movie and a message based on the rating as per the
table below.
RATING MESSAGE TO BE DISPLAYED
0.0 to 2.0 Flop
2.1 to 3.4 Semi-hit
3.5 to 4.5 Hit
4.6 to 5.0 Super Hit
Write a main method to create an object of the class and call the above member methods.
8. A special two-digit number is such that when the sum of its digits is added to the product of its
digits, the result is equal to the original two-digit number.
Example: Consider the number 59.
Sum of digits = 5 + 9 = 14
Product of its digits = 5 x 9 = 45
Sum of the sum of digits and product of digits= 14 + 45 = 59
Write a program to accept a two-digit number. Add the sum of its digits to the product of its digits.
If the value is equal to the number input, output the message “Special 2-digit number” otherwise,
output the message “Not a Special 2-digit number”.
9. Using the switch statement. write a menu driven program to calculate the maturity amount of a
Bank Deposit.
The user is given the following options:
(i) Term Deposit
(ii) Recurring Deposit
For option (i) accept principal(P), rare of ¡interest(r) and time period in years(n). Calculate and
output the maturity amount(A) receivable using the formula
For option (ii) accept Monthly Installment (P), rate of interest(r) and time period in months (n).
Calculate and output the maturity amount(A) receivable using the formula
For an incorrect option, an appropriate error message should be displayed.
10. Write a program to input a string and print out the text with the uppercase and lowercase letters
reversed, but all other characters should remain the same as before.
Example:
INPUT: WeLcOmE TO School
OUTPUT: wElCoMe to sCHOOL
11. Design a class name ShowRoom with the following description:
Instance variables/data members:
String name: to store the name of the customer.
long mobno: to store customer’s mobile number.
double cost: to store the cost of the item purchased.
double dis: to store the discount amount.
double amount: to store the amount to be paid after discount.
Methods:
ShowRoom(): default constructor to initialize the data members
void input(): to input customer name, mobile number, cost
void calculate(): to calculate discount on the cost of purchased items, based on the following
criteria
Cost(in Rupees) Discount(In percentage)
Less than or equal to 10000 5 %
More than 10000 and less than or equal to ₹ 20000 10 %
More than 20000 and less than or equal to ₹ 35000 15 %
More than 35000 20%
void display()- To display customer, mobile number, amount to be paid after discount.
Write a main() method to create an object of the class and call the above methods.
12. Write a Java program to print the following pattern using Switch case. Prompt the user to choose
an option between numeric or string pattern.
a. 666666
55555
4444
333
22
1
b. HELLO
HELL
HEL
HE
H

More Related Content

What's hot

Sequences and indexes
Sequences and indexesSequences and indexes
Sequences and indexes
Balqees Al.Mubarak
 
Database users
Database usersDatabase users
Database users
Param Radadiya
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
Ravinder Kamboj
 
Aca11 bk2 ch9
Aca11 bk2 ch9Aca11 bk2 ch9
Aca11 bk2 ch9
Sumit Mittu
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
Aditya Rawat
 
String In C Language
String In C Language String In C Language
String In C Language
Simplilearn
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in python
Jothi Thilaga P
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
robbbminson
 
Database language
Database languageDatabase language
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
Ashish Kumar
 
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
Arun Sial
 
Operating system 32 logical versus physical address
Operating system 32 logical versus physical addressOperating system 32 logical versus physical address
Operating system 32 logical versus physical address
Vaibhav Khanna
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
Mohamed Abdallah
 
Distributed & parallel system
Distributed & parallel systemDistributed & parallel system
Distributed & parallel system
Manish Singh
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
Dhananjaysinh Jhala
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION
AMOGHA A K
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
Mahesh Kumar Attri
 
ETL Testing Interview Questions and Answers
ETL Testing Interview Questions and AnswersETL Testing Interview Questions and Answers
ETL Testing Interview Questions and Answers
H2Kinfosys
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
ramandeep brar
 

What's hot (20)

Sequences and indexes
Sequences and indexesSequences and indexes
Sequences and indexes
 
Database users
Database usersDatabase users
Database users
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
 
Aca11 bk2 ch9
Aca11 bk2 ch9Aca11 bk2 ch9
Aca11 bk2 ch9
 
IPV4 Frame Format
IPV4 Frame FormatIPV4 Frame Format
IPV4 Frame Format
 
String In C Language
String In C Language String In C Language
String In C Language
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in python
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
 
Database language
Database languageDatabase language
Database language
 
remote procedure calls
  remote procedure calls  remote procedure calls
remote procedure calls
 
SQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTIONSQL BUILT-IN FUNCTION
SQL BUILT-IN FUNCTION
 
Operating system 32 logical versus physical address
Operating system 32 logical versus physical addressOperating system 32 logical versus physical address
Operating system 32 logical versus physical address
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
 
Distributed & parallel system
Distributed & parallel systemDistributed & parallel system
Distributed & parallel system
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION           RANDOM ACCESS PROTOCOL IN COMMUNICATION
RANDOM ACCESS PROTOCOL IN COMMUNICATION
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
ETL Testing Interview Questions and Answers
ETL Testing Interview Questions and AnswersETL Testing Interview Questions and Answers
ETL Testing Interview Questions and Answers
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
 

Similar to JAVA practical Exam Questions (1).docx

Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
tiffanyd4
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
sujatam8
 
Computer Practical
Computer PracticalComputer Practical
Computer Practical
PLKFM
 
Assignment in java
Assignment in javaAssignment in java
Assignment in java
Mariel Canonicato
 
Practical java
Practical javaPractical java
Practical java
nirmit
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
Gaurav Dixit
 
Ex
ExEx
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
rajni kaushal
 
Cs8261 cp lab syllabus
Cs8261 cp lab syllabusCs8261 cp lab syllabus
Cs8261 cp lab syllabus
Palani Chamy
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
AASTHA76
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
gerardkortney
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
Mohd Tousif
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
Lab exam question_paper
Lab exam question_paperLab exam question_paper
Lab exam question_paper
Kuntal Bhowmick
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
ARSLANMEHMOOD47
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
C++ Homework Help
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
rafbolet0
 
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
Last7693
 

Similar to JAVA practical Exam Questions (1).docx (20)

Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
 
Computer Practical
Computer PracticalComputer Practical
Computer Practical
 
Assignment in java
Assignment in javaAssignment in java
Assignment in java
 
Practical java
Practical javaPractical java
Practical java
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
Ex
ExEx
Ex
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
 
Cs8261 cp lab syllabus
Cs8261 cp lab syllabusCs8261 cp lab syllabus
Cs8261 cp lab syllabus
 
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docxBTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
BTE 320-498 Summer 2017 Take Home Exam (200 poi.docx
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
OverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docxOverviewThis hands-on lab allows you to follow and experiment w.docx
OverviewThis hands-on lab allows you to follow and experiment w.docx
 
SQL practice questions set - 2
SQL practice questions set - 2SQL practice questions set - 2
SQL practice questions set - 2
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
Lab exam question_paper
Lab exam question_paperLab exam question_paper
Lab exam question_paper
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
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
 

Recently uploaded

一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
zsjl4mimo
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
fkyes25
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
kuntobimo2016
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 

Recently uploaded (20)

一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
Natural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptxNatural Language Processing (NLP), RAG and its applications .pptx
Natural Language Processing (NLP), RAG and its applications .pptx
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 

JAVA practical Exam Questions (1).docx

  • 1. INTERNATIONAL SCHOOL Shaikpet, Hyderabad-500008 COMPUTER APPLICATIONS(Sample Practical Questions) 2022-23 1. Write a program to accept the year of graduation from school as an integer value from the user. Using the Binary Search technique on the sorted array of integers given below, output the message “Record exists” if the value input is located in the array. If not, output the message “ Record does not exist”. {1982,1986, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010} 2. Write a program to initialize the seven wonders of the world along with their locations in two different arrays. Search for a name of the country input by the user. If found, display the name of the country along with its Wonder, otherwise display “Sorry Not Found”. Seven wonders- CHICKEN ITZA, CHRIST THE REDEEMER, TAJ MAHAL, GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM. Locations- MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY Example- Country Name: INDIA OUPUT: INDIA- TAJMAHAL Country Name: USA Output: Sorry not found. 3. The annual examination results of 50 students in a class is tabulated as follows. Roll No. Subject A Subject B Subject C ---- --- ---- ---- Write a program to read the data, calculate and display the following: a. Average marks obtained by each student. b. Print the roll number and average marks of the students whose average mark is above 80. c. Print the roll number and average marks of the students whose average mark is below 40. 4. Write a java program to input 10 elements in an array and sort them using Bubble sort technique. 5. (i) double area(double a. double b, double e) with three double arguments, returns the area of a scalene triangle using the formula: where (ii) double area(int a, int b, int height) with three integer arguments, returns the area of trapezium using the formula: (iii) double area(double diagonal1, double diagonal2) with two double arguments, returns the area of a rhombus using the formula:
  • 2. 6. Design a class to overload a function polygon() as follows: (i) void polygon(int n, char ch) : with one integer argument and one character type argument that draws a filled square of side n using the character stored in ch. (ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of length x and breadth y, using the symbol ‘@’ (iii)void polygon( ) : with no argument that draws a filled triangle shown below. Example: (i) Input value of n=2, ch=’O’ Output: OO OO (ii) Input value of x=2, y=5 Output: @@@@@ @@@@@ (iii) Output: * ** *** 7. Define a class named movieMagic with the following description: Instance variables/data members: int year – to store the year of release of a movie String title – to store the title of the movie. float rating – to store the popularity rating of the movie. (minimum rating = 0.0 and maximum rating = 5.0) Member Methods: (i) movieMagic() Default constructor to initialize numeric data members to 0 and String data member to “”. (ii) void accept() To input and store year, title and rating. (iii) void display() To display the title of a movie and a message based on the rating as per the table below. RATING MESSAGE TO BE DISPLAYED 0.0 to 2.0 Flop 2.1 to 3.4 Semi-hit 3.5 to 4.5 Hit 4.6 to 5.0 Super Hit Write a main method to create an object of the class and call the above member methods. 8. A special two-digit number is such that when the sum of its digits is added to the product of its digits, the result is equal to the original two-digit number.
  • 3. Example: Consider the number 59. Sum of digits = 5 + 9 = 14 Product of its digits = 5 x 9 = 45 Sum of the sum of digits and product of digits= 14 + 45 = 59 Write a program to accept a two-digit number. Add the sum of its digits to the product of its digits. If the value is equal to the number input, output the message “Special 2-digit number” otherwise, output the message “Not a Special 2-digit number”. 9. Using the switch statement. write a menu driven program to calculate the maturity amount of a Bank Deposit. The user is given the following options: (i) Term Deposit (ii) Recurring Deposit For option (i) accept principal(P), rare of ¡interest(r) and time period in years(n). Calculate and output the maturity amount(A) receivable using the formula For option (ii) accept Monthly Installment (P), rate of interest(r) and time period in months (n). Calculate and output the maturity amount(A) receivable using the formula For an incorrect option, an appropriate error message should be displayed. 10. Write a program to input a string and print out the text with the uppercase and lowercase letters reversed, but all other characters should remain the same as before. Example: INPUT: WeLcOmE TO School OUTPUT: wElCoMe to sCHOOL 11. Design a class name ShowRoom with the following description: Instance variables/data members: String name: to store the name of the customer. long mobno: to store customer’s mobile number. double cost: to store the cost of the item purchased. double dis: to store the discount amount. double amount: to store the amount to be paid after discount. Methods: ShowRoom(): default constructor to initialize the data members void input(): to input customer name, mobile number, cost void calculate(): to calculate discount on the cost of purchased items, based on the following criteria
  • 4. Cost(in Rupees) Discount(In percentage) Less than or equal to 10000 5 % More than 10000 and less than or equal to ₹ 20000 10 % More than 20000 and less than or equal to ₹ 35000 15 % More than 35000 20% void display()- To display customer, mobile number, amount to be paid after discount. Write a main() method to create an object of the class and call the above methods. 12. Write a Java program to print the following pattern using Switch case. Prompt the user to choose an option between numeric or string pattern. a. 666666 55555 4444 333 22 1 b. HELLO HELL HEL HE H