Home /UOG — University of Gujrat /Object Oriented Programming

Object Oriented Programming 2 Semester/Term UOG — University of Gujrat 2023

Object Oriented Programming 2 Semester/Term UOG — University of Gujrat 2023 — 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.

Need Paper? See all →

Need a paper or stuck on a question? Ask here — students reply and you get an email.

Ask about a paper
  • Bushra· 21 hours ago

    BS Islamic Studies, 5th semester, ISL-511 Translation of Holy Quran (3) — Government College University Faisalabad (GCU…

    0 replies Reply →
  • Khadija· 2 days ago

    Civics course code GCCE101

    1 reply Reply →
  • Tasddaq hussain· 2 days ago

    BS 4the semester2025 civics and community engagement past paper According UOs

    0 replies Reply →
  • Humna Khan· 3 days ago

    Bs public administration 1st semester mid term past papers

    0 replies Reply →
  • Rania· 3 days ago

    BS English from uni of Sargodha Functional English, history of old English literature, literary devices and genres,

    0 replies Reply →
Ad

Paper text

UNIVERSITY OF GUJRAT FINAL TERM EXAMINATIONS SPRING-2023 Course Code: IT-106 Course Title: Object Oriented Programming Semester # 02 Section A Q. 1:- Solve the following short questions: 5x4 or 4x5 = 20 Marks a. Write a class Compare with data member number. Create a constructor to initialize the value and member function display () and MAX (), create two objects of the class call the member function to check which number is greater by using "THIS" keyword. b. Differentiate between new and delete operators? How can we create runtime objects in C++? c. Write a menu driven program that converts ASCII number to character and vice versa. The program should display the following menu • Convert ASCII value to character • Convert character to ASCII value. d. Write a program to raise an exception if any attempt is made to refer to an element whose index is beyond the array size. e. How can constructor and member function define inside and outside of the class. Explain with examples. Section B Attempt essay questions any two out of three: 2x15 = 30 Marks Q. 2:- Write a C++ program that will carry out the following: • Define a class named circular that has data members named radius and height, a member function named set which is used to initialize the value of length and height and a virtual function named volume, • Implement a derived class from circular named cylinder whose radius and height get from the user and calculate the volume (V= PI*R*R*H) • Implement a derived class from circular named cone whose radius and height get from the user and calculate the volume (V=PI*R*R*H/3) • Create display function to show the output of the cylinder and cone volume, and also use pointers. Q. 3:- Create a base class basic_info with data members name, roll no, gender and two-member functions get_data and display. Derive a class physical_fit from basic_info which has data members height and weight and member functions get_data and display. Display all the information using object of derived class. Q. 4:- Write down a C++ program to Create a class complex which have data members real and imaginary part of the number. • Use get_data () and display_data() method to input and display the values. • Initialize the default constructor. • Overload the (<<)ostream, (-) subtraction and (++)increment operators. (Continue overleaf)