Home /UOG — University of Gujrat /Object Oriented Programming

Object Oriented Programming UOG — University of Gujrat

Object Oriented Programming UOG — University of Gujrat — 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· 20 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 CS Department, University of Gujrat. Exam: Mid Term Object Oriented Programming Code: CS 103 Total Marks: 25 Time: 90Min Subjective Question (Marks 3,3,3) Limit your answer to 10 lines for each. 1. Explain the concept of classes and objects in Object Oriented Programming using a suitable system from real world. 2. How many types of constructors are used for creation of an object of a class, describe each with a sample implementation. 3. Differentiate between encapsulation and data-hiding. Problem Statements (Marks 5,5,6) 4. Create a Class with name Date and add following functionalities a. Constructor that initialize object with 01:01:2001 date. b. an overloaded constructor that takes i. 3 arguments i.e. (day month and year) c. A function that can adds days in date i. e.g if 45 days are added to date it will increase 1 month and 15. d. A Copy constructor 5. Overload function GreetingMsg for following incomplete code #include using namespace std; int main() { GreetingMsg(); // Assalam Alykum! (default) GreetingMsg("Ali"); // Assalam Alykum, Ali! GreetingMsg("Saad", RED); // Assalam Alykum, Saad! (saad in red color) return 0; } 6. Consider a class User with attributes username and password, perform following operations (3+3) 1. Make class User and Load 3 Sample users object in an array of max 10 users 2. As program starts request for username, if username is correct then show welcome message and request for password otherwise display message user not found.