Home /Islamia University Bhawalpur (IUB) /Object Oriented Programming

Object Oriented Programming MSCS Islamia University Bhawalpur (IUB) 2016

Object Oriented Programming MSCS Islamia University Bhawalpur (IUB) 2016 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

More Object Oriented Programming papers

See all

Paper text

The Islamia Aniversity of Balawalpur

Class

: MCS 2ND 2016-18

Subject: Object Oriented Programing

Term: Final Marks: 20 Time Allowed: 50 Mints Section: Short

Question No. 02(Short Questions/ Answers)|

2.1 Write an application that prints, on separate lines, your

name, your birthday, your hobbies, your favorite book,

and your favorite movie. Label each piece of

information in the output.

2.2 What output is produced by the following code

fragment?

String ml, m2, m3;

m1 = "Quest for the Holy Grail";

m2 = ml.toLowerCase();/

m3 = m1 + "* + m2;

System.out.printin (m3.replace('h', 'Z'));

2.3 Explain the difference between an actual parameter

and a formal parameter.

2.4 What happens if a case in a switch statement does

not end with a break statement.?

2.5 What is the difference between class and interface?

2.6 Define a Java interface called Nameable. This interface

must provide a setName method that requires a single

String parameter and returns nothing, and a getName

method that has no parameters and returns a String.

2.7 Describe the relationship between a parent class and

child class?

2.8 What is exception? What happens if exception is not

caught?

Class : MCS 2ND 2016-18

Subject: Object Oriented Programing

ustadni.com

Term: Final Marks: 20 Time Allowed: 65 Mints Section: Essay Type

Question No. 03(Essay Type Questions)

3.1(a) Write an application that converts miles to kilometers.

(One mile equals 1.60935 kilometers.) Read the miles

value from the user as a floating-point value.

(b) Design/and implement an application that reads a string

From the user, then determines and prints how many of

each lowercase vowel (a, e, i, o, and u) appear in the entire

string. Have a separate counter for each vowel. Also count

andprint the number of nonvowel characters.

parameters and returns their average as a floating-point

value. overload the average method such that if three.

integers are provided as parameters, the method returns

the average of all three.

visit website: ustadni.com