Design a class named Record that includes
•A data member named rollNo for student roll number
•Two data fields i.e. course1Name and course2Name of type string
•A parameterized constructor to initialize rollNo, course1Name, and course2Name data fields
•Three getter functions to get the value of rollNo, course1Name, and course2Name, respectively
Derive a class named CourseRecord inherited from Record class and contains
•Two additional data members i.e. marksCourse1 and marksCourse2
•A parameterized constructor to initialize its own data fields along with the inherited data fields
•Two getter functions that return the value of marksCourse1 and marksCourse2, respectively
Imagine a publishing company that markets both book and audiocassette versions of its work. Create a class Publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: Book which adds page count (type int) and author (a string); and Tape which adds a playing time in minutes (type float). Each of these three classes should have a getData() function to get its data from the user at keyboard, and a putData() function to display its data. getData() and putData() should be overloaded in both derived class.
Add a member function having return type bool called isOversize() to the book and tape classes. Let’s say that a book with more than 800 pages, or a tape with a playing time longer than 90 minutes (which would require two cassettes), is considered oversize. You can access this function from main() and display the string “Oversize” for oversize books and tapes when you display their other data.
Consider an abstract class Computer having
· Two fields (i.e. companyName, price) and
· A single function named show()
A class named Desktop inherits Computer class and adds fields representing
· color, monitor size, and processor type and
· Override function named show() to display values of its all attributes
A class named Laptop inherits Computer class and adds fields representing
· color, size, weight, and processor type and
· Override function named show() to display values of its all attributes
Write a main() function that instantiates objects of derived classes to access respective show() function using pointer to Computer class (dynamic binding).
❑A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges
an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum
charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours
at a time. Write a program that calculates and prints the parking charges for each of three
customers who parked their cars in this garage yesterday. You should enter the hours parked for
each customer.
❑Your program should print the results in a neat tabular format and should calculate and print the
total of yesterday’s receipts. The program should use the function calculateCharges to determine
the charge for each customer. Your outputs should appear in the following format:
Car parking tickets
EE204031 Object Oriented Programming 50
Car Hours Charge
1 1.5 2.00
2 4.0 2.50
3 24.0 10.00
TOTAL 29.5 14.50
you have to create a program that shall determine the age of the user.
NOTE:
No global declarations
Make use of classes
And Run test the functions in main
Task:
Write linked list implementation of stack that only inserts elements if they are not present in the stack(i.e no duplicate elements). Functions to implement
1)insert function
2)delete/pop function
3)display function
4)search function
Write a C++ program using a function to identify the smallest number from three numbers. Name the function as minval.
Sample Output:
Enter First Number: 300
Enter Second Number: 200
Enter Third Number: 1000
The Smallest Number: 200
You have to pile clothes in a box in such a
way that cloths can be added and removed
from only one end. Determine the most
suitable data structure. Provide both array
based and linked list based implementation.
Define a two dimensional array named temp of three rows and four columns of type int such that the first row is initialized to, 6,8,12,9; the second row is initialized to 17,5,10,6; and the third row is initialized to 14,13,16,20.
Write a float function rectangle() that computes and returns the area of a rectangle using its two float formal parameters h and w, where h is the height and w is the width of the rectangel