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

Similar documents
Object Oriented Programming 2012

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

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

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

PROGRAMMING IN C AND C++:

REVIEW EXERCISES. Draw an inheritance diagram that shows the relationships between these classes.

[6] [6] [6] [5] [5] [6] [5] [5]

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

Practical List of. MCA IV SEM Session -2010

List of Practical for Class XII 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.

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

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

Java Assignment (BCA/BE Computer)

Revised time table of BCA (2011 admission) record submission

LOOPS. 1- Write a program that prompts user to enter an integer N and determines and prints the sum of cubes from 5 to N (i.e. sum of 5 3 to N 3 ).

VALLIAMMAI ENGINEERING COLLEGE

VARIABLE, OPERATOR AND EXPRESSION [SET 1]

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

Subject: Computer Science

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

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

Time: 3 HOURS Maximum Marks: 100

Test Booklet. Subject: MA, Grade: 11 TAKS Grade 11 Exit Level Math Student name:

Suggestive List of C++ Programs

END TERM EXAMINATION

Week 0. Net Salary =Earnings- deductions; Read the employee number, Basic Print employee Number, Earnings,Deductions and Net salary.

7 th Pre-AP REVIEW for TEST1 1 st Six Weeks

CSE 212 : JAVA PROGRAMMING LAB. IV Sem BE (CS&E) (2013) DEPT OF COMPUTER SCIENCE & ENGG. M. I. T., MANIPAL. Prepared By : Approved by :

FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER (FMM) SHREE RAMCHANDRA EDUCATION SOCIETY S DEPARTMENY OF ELECTRICAL ENGINEERING LAB MANUAL

Objectives/Outcomes. Introduction: If we have a set "collection" of fruits : Banana, Apple and Grapes.

ANNA UNIVERSITY: CHENNAI B.E./B.Tech. DEGREE EXAMINATIONS, JAN Regulations First Semester (Common to All Branches )

[Page 177 (continued)] a. if ( age >= 65 ); cout << "Age is greater than or equal to 65" << endl; else cout << "Age is less than 65 << endl";

Final Exam Review (Revised 3/16) Math MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Mental Maths Competition Topics Included. (1) Q. No. 1 to 50 are based on basic. Calculation questions related to Addition,

Tribhuvan University Institute of Science and Technology 2065

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

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

S3 / S4 General Course Overview

Grade 7 Mathematics STAAR/TEKS 2014

ACT Diagnostic Review #1

RtI 7. Curriculum (219 topics additional topics)

Unit 1. Word Definition Picture. The number s distance from 0 on the number line. The symbol that means a number is greater than the second number.

INDIAN SCHOOL MUSCAT COMPUTER SCIENCE(083) CLASS XI

Downloaded from

Assignment-I PGDCA 01- INFORMATION TECHNOLOGY

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

Once you click on the Enterprise Icon found on your desktop you will be asked for your password. This Default Code Is

CORE JAVA TRAINING COURSE CONTENT

Syllabus of Diploma Engineering. Computer Engineering. Semester: II. Subject Name: Computer Programming. Subject Code: 09CE1104

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

(Practice Worksheet) MATHEMATICS

Objective 1 : The student will demonstrate an understanding of numbers, operations, and quantitative reasoning.

Grade 5 Mathematics MCA-III Item Sampler Teacher Guide

Topic 1. Mrs. Daniel Algebra 1

Page 3 GO ON. 1 The visual representation describes the relationships between the sets and subsets of numbers.

Basic Skills Review Packet

3.2 Pseudocode. Introduction. Definition. 1 Common pseudo code terms

Investigations in Number, Data, and Space for the Common Core 2012

25 Questions EOG Review #1 EOG REVIEW

2016 Autosoft, Inc. All rights reserved.

Chapter 11. Worked-Out Solutions Explorations (p. 585) Chapter 11 Maintaining Mathematical Proficiency (p. 583)

Coatbridge High School Mathematics Department. Homework Booklet. CfE Level 4

Woodland Community College: Math practice Test

PRACTICAL LIST FOR ODD SEMESTERS Session (PGDCA/MCA/MSC (CS))

Mathematics Scope & Sequence Grade 7 Revised: June 2015

Please find attached the Study Guide for the Marion County Grade 6 Mathematics Common End Of Course (CEOC) Exam.

LIST OF EXPERIMENTS. (1) (Office Automation)

Solutions: Program 1: Program 2: //To calculate the Gross salary of an Employee

DE 3630 DISTANCE EDUCATION. B.Sc. (Computer Science) DEGREE EXAMINATION, MAY DIGITAL COMPUTER FUNDAMENTALS. (2007 onwards)

Shapes leading to CAD system project

Object-Oriented Programming in C++/Handout 01 Page 1 of 8

CP I LAB MANUAL. Expt No 2 To Check Whether A Year Is A Leap Year Using if-else-if.

BEGINNING PROBLEM-SOLVING CONCEPTS FOR THE COMPUTER. Chapter 2

Practice 1 f = 12 2 m = 5 3 a = 7 g = 3 8 q = 96 9 c = y = 6. Warm-up. 1 x = 2 2 x = 20 3 y = 6 4 y = 3. Warm-up

EXPLORE MATHEMATICS TEST

Mathematics LV 5 (with QuickTables)

Prentice Hall Algebra Correlated to: ACT College Readiness Standards for Mathematics

Answer any Five Questions. All questions carry equal marks.

(Following Paper ID and Roll No. to be filled by the student in the Answer Book)

Objective: Find areas by decomposing into rectangles or completing composite figures to form rectangles.

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15

REVIEW FOR BASIC MATH SKILLS FINAL EXAM (December 2008) (Basic 4-Function, 10-Key Calculator Allowed No Scientific or Graphing Calculators)

Common Core State Standards - Standards for Mathematical Practice

CSC 121 Spring 2017 Howard Rosenthal

Write an expression in x that represents the length:

End of Year Test B. Whole Numbers, Decimals, and Integers. Fractions. Name Date END OF YEAR TEST B. Answers. 5x 2 3y 3x 2y 5 8, 5 2 3, 1

Math A Regents Exam 0103 Page 1

6th Grade Math. Parent Handbook

Grade 5 Mathematics MCA-III Item Sampler Teacher Guide

(PGDCA 01) ASSIGNMENT -1 PG DIPLOMA DEGREE EXAMINATION, DECEMBER 2017 COMPUTER APPLICATIONS Information Technology

2.1 Algorithm design and problem-solving

Table of Contents. Student Practice Pages. Number Lines and Operations Numbers. Inverse Operations and Checking Answers... 40

UNIVERSITY OF ENGINEERING & MANAGEMENT, KOLKATA C ASSIGNMENTS

Mathematics Scope & Sequence Grade 7 Revised: June 3, 2016 First Six Weeks (24 Days)

Practices (1) 6.MP.2. Reason abstractly and quantitatively.

Roberto Clemente Middle School

Westbourne House School Revision Easter Term Y8 MATHS REVISION CHECKLIST

Transcription:

Object Oriented Programming Using C ++ Page No. : 1. ASSIGNMENT SHEET WITHOUT USING OBJECT AND CLASSES 1. Write a program to calculate the sum of two numbers using function. 2. Write a program to calculate the area of circle, rectangle and triangle using function overloading. 3. Write a program to add numbers using command line argument programs. 4. Write a program to print all prime numbers and print the sum. 5. Write a program to find the nature of a roots of a equation ax 2 +bx+c=0,where a,b,c are given input? Find also the roots. OBJECT, CLASSES AND CONSTRUCTOR 6. Create a class Big and define two member functions One function will take two integers data item from the console and by use of another member function that will calculate the biggest out of two and display the result. 7. Imagine a tollbooth with a class called to tollbooth. The two data items are of type unsigned int to hold the total number of cars and type double to hold the total money collected. A constructor initializes both these to zero. A member function called Paying_Car() increments the car total and adds Rs. 2.50 to the cash total. Another function called Non_Paying_Car() increments the car total but adds nothing to the cash total. Finally a member function called display() shows the two totals. Include a main () program to test this class. The program should allow the user to push one key to count a paying cars and another to count non-paying cars. At end it should print out the total cars and total cash collected and then exit. 8. Five candidates contest an election. The candidates are numbered 1 to 5 and marking the candidate number on the ballot paper does the voting. Write a program to read the ballots and count the votes cast for each candidate using an array variable count. In case a number read is outside the range 1 to 5 the ballot should be considered as a Spoilt ballot and the program should also count the number of spoilt ballots. 9. An electricity board charges the following rates to domestic users to discourage large consumption of energy. For the first 100 units 40 P per unit For the next 200 units 50 P per unit Beyond 300 units -60 P per unit All users are charged a minimum of Rs. 100 /-. If the total cost is more than Rs. 250/- then an additional surcharge of 15% is added. Write a program to read the names of users and numbers of units consumed and print out the charges with names. 10. Define a class to represent a bank account of a customer including a member variables Name of the depositor, Account number, type of account, balance amount in the account and the member functions to assign initial values of member variables, to deposit an amount, to withdraw an amount after checking, to display name and balance. Write a main program to test the program for n number of customers.

Object Oriented Programming Using C ++ Page No. : 2. 11. Create a class called user_time that has separate integer members for hours, minutes and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. A member function should display it in HH:MM:SS format. The final two member functions should add and subtract two objects of time passed as arguments. A main () program should create two initialized user_time objects. Then it should add the two initialized together, leaving the result in the third user_time object. Finally it should display the value of third variable. 12. Create a class called employee that contains a name and an employee number. Include a member function called appointment() to get data from the user for insertion into the object, and another function called show_employee() to display the data. Assume the name has no embedded blanks. Write a main () program and create an array of type employee, and invite the user to input data for up to 5 employees. Finally, it should print out the data for all the employees. 13. Create two classes DM and DB, which store the value of distances. DM stores distances in meters and centimeters and DB in feet and inches. Write a program that can read values for the class object 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 results are required. The display should be in the format of feet and inches or meters and centimeters depending on the object on display. 14. A bookshop maintains the inventory of books that are being sold at the shop. The list includes details such as author, title, price, publisher and stock position. Whenever a customer wants a book, the sales person inputs the title and author and the system searches the list and displays whether it is available or not. If it is not, an appropriate message is displayed. If it is, then the system displays the book details and requests for the number of copies required, If the requested copies are available, the total cost of the requested copies is displayed; otherwise the message Required copies not in stock is displayed. Design a system using a class called books with suitable member functions and constructors, Use new operators in constructors to allocate memory space required. 15. Create a class HugeInterger that uses 40 elements array of digits to store integer as large as 20 digits. Provide method input HugeInterger, output HugeInterger, addhugeinteger, multiplyhugeinterger and modulushugeinteger. 16. Define a stack uses one liner array and counter to notice number of item in stack. Define a member function corresponding to PUSH and POP operations including overflow and underflow situation relevantly. 17. Write down a program on C++ to define a class Matrix that uses a 2D-array and two counters RowSize and ColSize to hold size of the matrix. Define member functions, which perform. 1. Matrix multiplication 2. Matrix addition 18. Write a program in C++ to read the information like name, age, birthday, sex, and address of students. Write functions to create, modify and delete the information of any student and also to print the information of the students.

Object Oriented Programming Using C ++ Page No. : 3. 19. Write a program in C++ to read two strings of different lengths and to test whether one string is a sub-string of the other or not. 20. Define a class country that stores the name of the country, population and its area. Using that class write a program that reads a set of countries and prints. 1. The country with largest area 2. The country with largest population 3. The country with largest population density. 21. Implement a class Address. An address has House number, a street name and optional apartment number, a city and postal code. Supply two constructors one with an apartment number and one without apartment number. Supply a print function that prints the addresses with a street number on one line and the city. State and postal code on another line. 22. Create a class called DAY that has separate integer member day, month and year. One constructor should initialize these data to zero and another should initialize to specific values. Write a main () function to read two dates and find their difference in terms of the number of days and display it. 23. Write a C++ program using array of objects which store player name match played and run scored for given number of players involve member func Hons to obtain player with maximum match played, maximum run scored and maximum average. 24. Design the following program using Call by Reference ad Return by Reference concepts, Define a class item which contains following information item name, item cost, name of the manufacturing company, date of manufacturing. Then return the reference of that item for displaying which contains the maximum product cost. INHERITANCE 25. Implement a base class Person. Derive classes Student and Instructor from Person. A Person has a name and a birthday. A student has a batch,course and a Instructor has a salary. Write the class definitions, the constructor and the member function print () for all classes. 26. Derive a class Manager from Employee. Add a data field named Department of type String, supply print () method that prints the Manager s name, department and salary. Derive a class Executive form Manager. Supply function print () that prints the string Executive followed by the information stored in Manager base object. 27. Define a class Education that holds two pieces of information, namely highest educational qualification and highest professional qualification. These class should be inherited by the classes Teacher and Officer. Display all the objects information created with respect to either of the above classes in a descending order of educational / professional qualification. 28. Implement a base class Account and derived classes Savings and Checking. In the base class, supply member function deposit and withdraw. Provide a function daily-interest that computes and adds daily-interest. For calculations, assume that every month has 30 days. Checking accounts yield interest of 5% monthly on balances over Rs. 1000/-. Savings

Object Oriented Programming Using C ++ Page No. : 4. account yield interest of 6% on the entire balance. Write a driver program that makes a month s worth of deposits and withdraws and calculate the interest everyday. 29. Write a base class Worker and derived classes HourlyWorker and SalariedWorker. Every worker has a name and a salary rate. Write a virtual function ComputePay (in hour) that computes weekly pay for every worker. An hourly worker gets paid the hourly wages for the actual number of hours worked. The hours are at most 40 per week. If it is greater than 40, the worker gets 1.5 times of the hourly rate for excess hour. Te salaried worker gets paid the hourly wage for 40 hours, no matter what the actual number of hours is. 30. A publishing company markets both books and the playing time in munutes for the cassettes. Design a C++ program using derived classes to add books and cassettes. Display the stock and find out whether a particular book or its cassette is in stock or not. 31. Design and implement classes Politician, MP and MLA. MP and MLA and derived classes of Politician. Politician is a derived class from Person (Name and Phone Number). A Politician, in addition to name and phone number, has a party and a state. Class MP has a rank LS / RS. Class MLA has in addition one identification number. Your design will include methods to initialize, access and filing in. 32. Consider the following Net work of classes as mentioned : 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. Person Name Code Account Pay Admin Experience Master Name Code Experience Pay OVERLOADING 33. Write a program to over load the operater + which will concatinate two numbers of any string values.

Object Oriented Programming Using C ++ Page No. : 5. 34. Write a program that overload the operator * where A is a 2D matrix. User the expression as: 1) A*2, 2) A*A, 3) 2*A. 35. Create a class COMPLEX that will contain complex numbers, Use operator overloading to create addition, subtraction and multiplication operators, which will operate on COMPLEX class. 36. Define two classes Polar and rectangle to represent points in the polar and rectangle systems. Use conversion routines to convert from one system to the other. 37. Write a C++ program to construct a class String which has one string and length of that string as data members. Overload the following operators : a) = for string copy, b) == for string comparison c) + for string concatenation. 38. C++ operators such as >>, which reads input from the keyboard, converts the sequences to digit into number. Write a program that emulates this behavior. It should allow the user to type up six digits, then display the resulting the number as a type of long integer. The individual digits should be read using getche(). For constructing the number multiply the partial result by 10 then add new digits. 39. a class polar which describes a point in the plane using polar co- ordinates radius and angle over load the operator + to add two objects of polar. This requires first conversion of points to rectangular co-ordinates then adding the corresponding rectangular co-ordinates and finally converting the result back into polar co-ordinates. This conversion formule are as follows: x=r*cos(a), a=atan(x/y) y=r*sin(a), r=sqrt(x*x+y*y) TEMPLATES 40. Write a program to add two numbers using Template Functions. 41. Designe a Template class where two variables are template type and input values from main function for integer and floating. The operation performed that to convert temperature from centegrate to farenheit. 42. write a program that will open a file and write some contents into it. Display the contents in reverse order as output. 43. Create a master file containing the information about various persons with filed Name, Age, Profession, DOB. Then store these information in a file. Then scan from the file and print information about persons in teaching profession. 44. Sort different data types by help of template. FILES 45. Write a program to add, list,modify and delete values from the data file using class and objects. The file structure is Employee(emp_code,emp_name,designation,salary) 46. Write a program to read data from a data file and count number of words in it. 47. Write a program to copy records from one file to other using command line arguments. END