Home /University Of Sargodha (UOS) /Object Oriented Programming

Object Oriented Programming MS Information Technology/MSc Information Technology/PhD Information Technology 2 Semester/Term University Of Sargodha (UOS) 2018

Object Oriented Programming MS Information Technology/MSc Information Technology/PhD Information Technology 2 Semester/Term University Of Sargodha (UOS) 2018 — 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

University of Sargodha M.Sc. 2*" Term Examination 2018 Subiest: Information Technology Paper: Object Oriented Programming (CMI-2123) Time Allowed: CO feurs Maximum Marks: 60 Objective PardOn Compulsory 21. Write short answers of the following h 2-3 lines each on your answer sheet What is a static method? Give some examples from any Java class? What is the purpose of Information Hiding? i. Can a constructor call another constructor using this keyword? Give example. ustadni.com iv. What is void reference? v. Can a catch block be written without try block? vi. Can we instantiate an interface? vii. When swing package is used? viii. What is the purpose of instanceof operator? Clix. What is this reference and its purpose. Give an example? полет - см sTer Arole malles tal x. Can we override final methods if not why? xi. What is the purpose of Wrapper class? xii. Diffcrentiate between throw and throws? Subjective Part (4*9) Create a class employee (id, name). Inherit two classes named collegeEmployee (salary) and Faculty (contract_duration) from it. Write appropriate constructors/ print and get functions for each class. Write an application that demonstrates using objects of each class. Q3. Write down a class Complex having data members (real, imaginary) and implements Serializable. The program should also contain the constructor and method to read a complex number from user. The program should throw exception if imaginary is negative, Also override toString0 method, Q4. Create an abstract class Furniture (celer, price). Include get and set methods for these fields; the setPrice methods is abstract. Create two subclasses Table (length, width) and Chair (color) from furniture and include appropriate setPrice methods in each class. Finally, write an application. that uses Furnit De class and subclasses to display information about instances. 05. Create are table emine end are Crease dase coule laying and thod play that prints the title and playting Pemonstrate polymorphic behavior of method play using interface Playable, Write an application that calculate grade of student based on marks entered. The -jiff number should be entered from the keyboard (via a TextField). Anjun-editable Textfeld should be used to display grade against entered marks when user clicks on calculate grade button. Use the following formula for the calculation. Hint: If (marks >= 80) grade ='A', IF (marks >=70 && marks<80) grade -B', If (marks >=60-& marks<70) grade =C, If (marks >=50 && marks<60) grade «'C", IF (marks < 50) grade - "F 27. Write a program that concatenates the contents of file2 into contents of filel i.e. it should append the contents of a text file at the end of another file. visit website: ustadni.com