0% found this document useful (0 votes)
27 views2 pages

Assignment_Questions_13_to_20

Uploaded by

Geet Lagad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Assignment_Questions_13_to_20

Uploaded by

Geet Lagad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

13. Title: Removal of all the vowels from the string and printing the new string.

Question: Write a program in Java to accept a string and print the new string after removing all the
vowels present in the string.

14. Title: Method Palin() to check whether a string is a Palindrome or not.


Question: Write a program using a method Palin(), to check whether a string is a Palindrome or not. A
Palindrome is a string that reads the same from left to right and vice versa. Eg. MADAM, ARORA,
ABBA etc.

15. Title: Arrange letters in alphabetical order.


Question: Write a program in Java to accept a word. Arrange all the alphabets of the word in ascending
order and display the new word.
Eg: i/p: BLUEJ
o/p: BEJLU

16. Title: Search for a number using Binary Search technique.


Question: WAP in java to accept 10 numbers in S.D.A. Enter a number and check whether it is present
or not using Binary Search Technique, if the number is present then display the message, “Number is
present” otherwise “Number is not present”

17. Title: Enter 15 numbers from keyboard, assuming that no integer is a zero and sort them using
bubble sort or selection sort as per users choice.
Question: WAP a program to enter 15 integers from the keyboard, assuming that no integer entered is a
zero. Sort the integers either using bubble sort or selection sort depending on the users choice and then
print them in ascending order.

18. Title : Enter names of visitors in double dimensional array and display the their room and floor
number.
Question: A Metropolitan Hotel has 5 floors and 10 rooms in each floor. The names of the visitors are
entered in a Double Dimensional Array (DDA) as M[5][10].The Hotel Manager wants to know from
the "Enquiry" about the position of a visitor (i.e. floor number and room number) as soon as he enters
the name of the visitor. Write a program in Java to perform the above task.

19. Title : Calculate amount and interest.


Question: Write a program to model a class with the specifications given below:

Class name: Loan

Data Members Purpose

int time Time for which loan is sanctioned

double principal Amount sanctioned

double rate Rate of interest

double interest To store the interest

double amt Amount to pay after given time

Member Methods Purpose

void getdata() To accept principal and time

Page 1 of 2
Member Methods Purpose

To find interest and amount.


void calculate() Interest = (Principal*Rate*Time)/100
Amount = Principal + Interest

void display() To display interest and amount

20. Title : Calculate and display the updated amount.


Question: Design a class RailwayTicket with following description:

Class name : RailwayTicket

Data Members Purpose

String name To store the name of the customer

String coach To store the type of coach customer wants to travel

long mob no To store customer's mobile number

int amt To store basic amount of ticket

int totalamt To store the amount to be paid after updating the original amount

Member
Purpose
Methods

void accept() To take input for name, coach, mobile number and amount

To update the amount as per the coach selected (extra amount to be


void update()
added in the amount as per the table below)

To display all details of a customer such as name, coach, total amount


void display()
and mobile number

Type of Coaches Amount

First_AC ₹700

Second_AC ₹500

Third_AC ₹250

Sleeper None

Write a main method to create an object of the class and call the above member methods.

****************************

Page 2 of 2

You might also like