0% found this document useful (0 votes)
7 views5 pages

Practice Questions 10

Uploaded by

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

Practice Questions 10

Uploaded by

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

Q1) Create a class called Marks with the following details: regnum,

MarksInEng, MarksInMaths and MarksInScience. Write getters and


setters for the all variables. Use the class Student which is already
created for getting the details of the student. Create a class called
Standard with 5 students’ details and write separate method for each
of the following tasks and invoke the same.
a) To display the entire reg no and the name of the students in the class
in the ascending order of reg no.
b) To display the reg no and the name of the student who has got the
highest percentage.
c) To display the reg no and the name of the student who scored
highest mark in mathematics.
d) To display the reg no and the name of the student in the ascending
order of the total marks in mathematics and science alone.
e) To display the reg no, name, total marks, percentage and rank of all
the students in the descending order of rank.
d)First parameter is of double data type and second parameter is of int
data type
Q2) Create a class called Calculator which has different add methods.
Overload the methods such that the parameters can be of the following
pattern.
a) Both are of int data type.
b) Both are of double data type.
c) First parameter is of int data type and second parameter is of double
data type.
Q3) Create an object to access these methods and invoke these
methods with different type of numbers and display the result in the
corresponding methods.
a) Create an AddressBook class encapsulating name (String), tempAdd
(Address), premAdd (Address) and phone number(long). Provide
appropriate getter and setter methods.
b) Address class encapsulates house address– name, street address,
city, state.
c) The Address class must be available only to AddressBook class.
d) Make sure that name assigned to AddressBook object is same as
name assigned to Address object.
e) Test the application by creating AddressBook object and printing
address and email id assigned to AddressBook object.

You might also like