Object Oriented Programming 2012

Similar documents
Lesson Plan. Subject: OBJECT ORIENTED PROGRAMMING USING C++ :15 weeks (From January, 2018 to April,2018)

Syllabus for Bachelor of Technology. Computer Engineering. Subject Code: 01CE1303. B.Tech. Year - II

Object Oriented Programming Using C ++ Page No. : 1. ASSIGNMENT SHEET WITHOUT USING OBJECT AND CLASSES

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

Babaria Institute of Technology Computer Science and Engineering Department Practical List of Object Oriented Programming with C

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

22316 Course Title : Object Oriented Programming using C++ Max. Marks : 70 Time: 3 Hrs.

Revised time table of BCA (2011 admission) record submission

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

END TERM EXAMINATION

PROGRAMMING IN C AND C++:

PROGRAMS. EXCELLENT ACADEMY OF ENGINEERING. Telephone: / NORMAL PROGRAM

Lesson Plan for Even semester Govt. Polytechnic Education Society, Lisana (Rewari) Name of the Faculty: Sh. Praveen Kumar Discipline:

Subject: Computer Science

ALIGARH MUSLIM UNIVERSITY Department of Computer Science. JAVA Lab Assignment Course: MCA II nd Semester Academic Session:

Write a java program to prints the count of odd and even no s entered.

Savitribai Phule Pune University, Pune Second Year of Computer Engineering (2015 Course) : Object Oriented Programming Lab Teaching Scheme

Data Types & Variables

OBJECT ORIENTED AND MULTICORE PROGRAMMING LABORATORY

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Shapes leading to CAD system project

Exercises 1. class member { int membernum = 25; float memberpay; public void Input(cin >> membernum >> memberpay); void Output; }

Jayaram college of Engineering and Technology, Pagalavadi. CS2203 Object Oriented Programming Question Bank Prepared By: S.Gopalakrishnan, Lecturer/IT

Chapter 3 Problem Solving and the Computer

6.096 Introduction to C++

Get Unique study materials from

Question 1 Consider the following structure used to keep employee records:

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU 2013

IT 1033: Fundamentals of Programming Data types & variables

WARM UP LESSONS BARE BASICS

Inheritance and Overloading. Week 11

6.096 Introduction to C++

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

11.2. Overloading Operators

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

C++ Programming: From Problem Analysis to Program Design, Third Edition

List of Practical for Class XII Computer Science

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions.

Homework #3 CS2255 Fall 2012

Full file at

calling a function - function-name(argument list); y = square ( z ); include parentheses even if parameter list is empty!

Answer Key Lesson 5: Area Problems

CSc 10200! Introduction to Computing. Lecture 4-5 Edgardo Molina Fall 2013 City College of New York

A First Book of ANSI C Fourth Edition. Chapter 8 Arrays

CHAPTER 4 FUNCTIONS. Dr. Shady Yehia Elmashad

TIME: 3 HOURS MARKS: a. Develop a java program to sort an array of N numbers in ascending order. (40)

Lab 12 Object Oriented Programming Dr. John Abraham

CSCI 111 Midterm 1, version A Exam Fall Solutions 09.00am 09.50am, Tuesday, October 13, 2015

Honors Computer Science C++ Mr. Clausen Program 6A, 6B, 6C, & 6G

UNIVERSITY OF MUMBAI T.Y.B.Sc.( INFORMATION TECHNOLOGY) (Semester V) (Practical) EXAMINATION OCTOBER ASP.NET with C# Seat No. : Max.

Avg. Of Test 1 and Test 2. Exam

VALLIAMMAI ENGINEERING COLLEGE

Pointers and Arrays CS 201. This slide set covers pointers and arrays in C++. You should read Chapter 8 from your Deitel & Deitel book.

For Teacher's Use Only Q No Total Q No Q No

CHAPTER 4 FUNCTIONS. Dr. Shady Yehia Elmashad

7.1 Optional Parameters

More Advanced Class Concepts

public : int min, hour ; T( ) //here constructor is defined inside the class definition, as line function. { sec = min = hour = 0 ; }

Lecture 4 Tao Wang 1

Unit 5, Lesson 8: Calculating Products of Decimals

SAURASHTRA UNIVERSITY

Chapter-9 INPUT AND OUTPUT OPERATORS

Assignment-I PGDCA 01- INFORMATION TECHNOLOGY

Expressions, Input, Output and Data Type Conversions

VIRTUAL FUNCTIONS Chapter 10

CHAPTER 1 Introduction to Computers and Programming CHAPTER 2 Introduction to C++ ( Hexadecimal 0xF4 and Octal literals 031) cout Object

Problem Solving with C++

Arrays IT 1033: Fundamentals of Programming

Preface to the Second Edition Preface to the First Edition Brief Contents Introduction to C++ p. 1 A Review of Structures p.

By the end of this section you should: Understand what the variables are and why they are used. Use C++ built in data types to create program

Week 8: Operator overloading

M.C.A DEGREE EXAMINATION,NOVEMBER/DECEMBER 2010 Second Semester MC 9222-OBJECT ORIENTED PROGRAMMING (Regulation 2009)

Absolute C++ Walter Savitch

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation.

- HALF YEARLY EXAM ANSWER KEY DEC-2016 COMPUTER SCIENCE ENGLISH MEDIUM

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

Object Oriented Programming. Assistant Lecture Omar Al Khayat 2 nd Year

CGS 2405 Advanced Programming with C++ Course Justification

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

WEST VIRGINIA ADULT BASIC EDUCATION SKILLS CHECKLIST ABE MATHEMATICS Federal Functioning Level 1 Beginning Literacy (0 1.9)

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

LAB 4.1 Relational Operators and the if Statement

Suggestive List of C++ Programs

Test Booklet. Subject: MA, Grade: 10 TAKS Grade 10 Math Student name:

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

+2 Volume II OBJECT TECHNOLOGY OBJECTIVE QUESTIONS R.Sreenivasan SanThome HSS, Chennai-4. Chapter -1

Object Oriented Programming

Chapter 15 - C++ As A "Better C"

Introduction to C++ Introduction to C++ 1

[CHAPTER] 1 INTRODUCTION 1

Stratford upon Avon School Mathematics Homework Booklet

CS242 COMPUTER PROGRAMMING

CS 151 Review #3. // More than one variable can be defined // in a statement. Multiple variables are // separated by a comma.


OOP THROUGH C++(R16) int *x; float *f; char *c;

Transcription:

1. Write a program to display the following output using single cout statement. Maths = 90 Physics =77 Chemestry =69 2. Write a program to read two numbers from the keyboard and display the larger value on the screen. 3. Write a program to input an integer value from keyboard and display on screen WELL DONE that many times. 4. Write a program to read the values of a, b and c and display the value of x, where x = a / b c Test your program for the following values: (a) a=250, b=85, c= 25 (b) A=300, b=70, c=70 5. Write a C++ program that will ask for a temperature in Fahrenheit and display it in Celsius. 6. Write a C++ program that will ask for a temperature in Fahrenheit and display it in Celsius using a class called temp and member functions. 7. Write a function using reference variable as arguments to swap the values of a pair of integers. 8. Write a function that creates a vector of user-given size M using newoperator. 9. Write a program to print the following output using for loop. 1 22 333 4444 55555. 10. Write a macro that obtains the largest of three numbers. 11. Write a function power() to raise a number mto a power n. the function takes a doubke value for m and int vakue for n, and returns the result correctly. Use a default value of 2 for n to make the function calculate squares when this argument is omitted. Write a main that gets the value of m and n from the user to test the function. 12. Define a class to represent a bank account. Include the following members: Data members 1. Name of the depositor 2. Account number 3. Type of Account 4. Balance amount in the account Member functions 1. To assign initial values 2. To deposit an amount 3. To withdraw an amount after checking the balance Sapan Naik Page 1

4. To display name and balance Write a main program to test the program. 13. Write a class to represent a vector ( a series of float value). Include member function to perform the following tasks: 1. To create the vector 2. To modify the value of a given element 3. To multiply by a scalar value 4. To display the vector in the form (10, 20,30,.) Write a program to test your class. 14. Modify the class and the program of 13 for handling 10 customers. And program would able to add two vectors and display the resultant vector. ( You can pass objects as function arguments). 15. Create two classes DM and DB which store the value of distance. DM stores distances in meters and centimeter and DB in feet and inches. Write a program that can read values for the class objects and add one object of DM with another object of DB. Use a friend function to carry out the addition operation. The object that stores the results may be a DM object or DB Object, depending on the units in which the result are required. The display should be in the format of feet and inches or meters and centimeters depending on the object on display. 16. A book shop maintains the inventory of the books that are being sold at the shop. The list includes details such as author, title, price, publisher and stock Position. Whenever customer wants a book the sales person inputs the title and author and the system searches the list and displays whether it s available or not. If it is not, an appropriate message is displayed. If it is, then system displays the book details and request for the number of copies required. If the requested copies are available, a total cost of requested copies is displayed, otherwise the message Required copies not in stock is displayed. 1. The price of the books should be updated as and when required. Use a private member function to implement this. 2. The stock value of each book should be automatically updated as soon as a transaction is completed. 3. The number of successful and unsuccessful transactions should be recorded for the purpose of statistical analysis. Use static data members to keep count of transaction. Design a system using a class called books with suitable member function and constructors. Use new operator in constructors to allocate memory space required. 17. Create a class FLOAT that contains one float data member. Overload all the four arithmetic operators so that they operate on the objects of FLOAT. 18. Define a class String. Use overloaded == operator to compare two strings. 19. Create a class index with overloaded prefix and postfix unary operators. Sapan Naik Page 2

20. Write a program to manipulate N student objects. Overload the subscript operator for bounds checking while accessing i th student object. 21. Write a program to overload stream operators for reading or displaying contents of vector class s object as follow Cin >> v1; cout << v2 22. An educational institution wishes to maintain a database of its employees. The database is divided into a number of classes whose hierarchical relationships are shown in Figure. The figure also shows the minimum information required for each class. Specify all the classes and define functions to create the database and retrieve individual as and when required. 23. Consider a class network of below figure. The class master derives information from both account and admin classes which in turn derive information from the class person. Define all the four classes and write a program to create update and display the information contained in master objects. Sapan Naik Page 3

24. create a base class called shape. Use this class to store two double type values that could be use to compute the area of figures. Derive two specific classes called triangle and rectangle from the base shape. Add to the base class, a member function get_data() to compute and display the area of figure. Make display_area() as a virtual function and redefine this function in the derived classes to suit their requirements. Using these classes design a program that will accept dimensions of the triangle or a rectangle interactivly and display the area. 25. Write a program to read a list containing item name, item code, and cost interactively and produce a three column output as shown below. NAME CODE COST Turbo C++ 1001 250.95 C Primer 905 95.70...................................... Note that the name and code are left justified and the cost is right justified with a precision of two digits. Trailing zeros are shown. 26. Write a program which reads a text from keyboard and displays the following information on the screen in two columns: a. Number of lines. b. Number of words. c. Number of characters String should be left justified and the numbers should be right justified in a suitable field width. Sapan Naik Page 4

27. A file contains a list of telephone numbers in the following form:: John 23456 Ahmed 34567........... The name contains only one word and the names and telephone number are separated by white spaces. Write a program to read the file and output the list in two columns. The names should be left-justified and the numbers right-justified. 28. Write a program that will create a data file containing the list of telephone numbers given in exercise 27. Use a class object to store each set of data. 29. Write an interactive, menu driven program that will create one data file containing the list of telephone number (use a class object to store each set of data). Also implement the following tasks. a. Determine the telephone number of the specified person. b. Determine the name if a telephone number is known. c. Update the telephone number, whenever there is a change. 30. Create on Employee class which is inherited by FileHandle class. Using FileHandle class store the information about employees in sorted order of their employee numbers in the file. Read an employee number from the keyboard and display the corresponding employee details. Sapan Naik Page 5