We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.(C++).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 

We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.(C++).

 

 

 

 

A Programming Assignment - 4
E Programming Assignment -4 - G X
G types of inheritance with exampl
My Questions | bartleby
D CodesDope PRO: Simplest Cours
O X
i docs.google.com/document/d/1YZDAArNdeQr_COQNK-LJrmCLzdbi5usgOu9IlbsO4kg/edit
☆
I Apps
G Gmail
u Online Courses - A...
A Classes
SkillRack.com
E Reading list
Programming Assignment -4
☆ 回 @
Share
R
File Edit View Insert Format Tools Add-ons Help
Last edit was 6 hours ago
A P
100%
Heading 3
BIU A
= = - E
- E E
Times
12
+
Editing
31
1 | ' 2
II| 5 | 6
1
4
7
2. Make a class named Fruit with a data member to calculate the number of fruits in a
basket. Create two other class named Apples and Mangoes to calculate the number of
apples and mangoes in the basket. Print the number of fruits of each type and the total
PROGRAMMING ASSIGNMEN..
Create two classes named M...
number of fruits in the basket.
1- function of Mammals by t...
3. We want to calculate the total marks of each student of a class in Physics,
and Mathematics and the average marks of the class. The number of students in the
class are entered by the user. Create a class named Marks with data members for roll
number, name and marks. Create three other classes inheriting the Marks class,
namely Physics, Chemistry and Mathematics, which are used to define marks in
individual subject of each student. Roll number of each student will be generated
automatically.
emistry
Make a class named Fruit wit..
+
We want to calculate the total...
We want to store the informat.
*Bike with data members to s.
Now, store and print the infor...
4. We want to store the information of different vehicles. Create a class named Vehicle
Create a class named Shape .
with two data member named mileage and price. Create its two subclasses
*Car with data members to store ownership cost, warranty (by years), seating capacity
and fuel type (diesel or petrol).
Now, try calling the function b..
Write a class Account that pr.
*Bike with data members to store the number of cylinders, number of gears, cooling
type(air, liquid or oil), wheel type(alloys or spokes) and fuel tank size(in inches)
Make another two subclasses Audi and Ford of Car, each having a data member to
store the model type. Next, make two subclasses Bajaj and TVS, each having a data
member to store the make-type.
Employees
Now, store and print the information of an Audi and a Ford car (i.e. model type,
ownership cost, warranty, seating capacity, fuel type, mileage and price.) Do the same
for a Bajaj and a TVS bike.
>
21:29
e Type here to search
26°C Partly cloudy ^ ) , ENG
31-08-2021
(1
!!!>
lılı
Transcribed Image Text:A Programming Assignment - 4 E Programming Assignment -4 - G X G types of inheritance with exampl My Questions | bartleby D CodesDope PRO: Simplest Cours O X i docs.google.com/document/d/1YZDAArNdeQr_COQNK-LJrmCLzdbi5usgOu9IlbsO4kg/edit ☆ I Apps G Gmail u Online Courses - A... A Classes SkillRack.com E Reading list Programming Assignment -4 ☆ 回 @ Share R File Edit View Insert Format Tools Add-ons Help Last edit was 6 hours ago A P 100% Heading 3 BIU A = = - E - E E Times 12 + Editing 31 1 | ' 2 II| 5 | 6 1 4 7 2. Make a class named Fruit with a data member to calculate the number of fruits in a basket. Create two other class named Apples and Mangoes to calculate the number of apples and mangoes in the basket. Print the number of fruits of each type and the total PROGRAMMING ASSIGNMEN.. Create two classes named M... number of fruits in the basket. 1- function of Mammals by t... 3. We want to calculate the total marks of each student of a class in Physics, and Mathematics and the average marks of the class. The number of students in the class are entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically. emistry Make a class named Fruit wit.. + We want to calculate the total... We want to store the informat. *Bike with data members to s. Now, store and print the infor... 4. We want to store the information of different vehicles. Create a class named Vehicle Create a class named Shape . with two data member named mileage and price. Create its two subclasses *Car with data members to store ownership cost, warranty (by years), seating capacity and fuel type (diesel or petrol). Now, try calling the function b.. Write a class Account that pr. *Bike with data members to store the number of cylinders, number of gears, cooling type(air, liquid or oil), wheel type(alloys or spokes) and fuel tank size(in inches) Make another two subclasses Audi and Ford of Car, each having a data member to store the model type. Next, make two subclasses Bajaj and TVS, each having a data member to store the make-type. Employees Now, store and print the information of an Audi and a Ford car (i.e. model type, ownership cost, warranty, seating capacity, fuel type, mileage and price.) Do the same for a Bajaj and a TVS bike. > 21:29 e Type here to search 26°C Partly cloudy ^ ) , ENG 31-08-2021 (1 !!!> lılı
A Programming Assignment - 4
E Programming Assignment -4 - G X
G types of inheritance with exampl
My Questions | bartleby
D CodesDope PRO: Simplest Cours
O X
i docs.google.com/document/d/1YZDAArNdeQr_COQNK-LJrmCLzdbi5usgOu9IlbsO4kg/edit
☆
I Apps
G Gmail
u Online Courses - A...
A Classes
SkillRack.com
E Reading list
Programming Assignment -4
☆ 回 @
Share
R
File Edit View Insert Format Tools Add-ons Help
Last edit was 6 hours ago
A P
100%
Heading 3
Times
12
B IU A
= E - E
- E E
Editing
+
31
1
2
3
4
| 5 I | 6
5. Create a class named Shape with a function that prints "This is a shape". Create
another class named Polygon inheriting the Shape class with the same function that
prints "Polygon is a shape". Create two other classes named Rectangle and Triangle
having the same function which prints "Rectangle is a polygon" and "Triangle is a
polygon" respectively. Again, make another class named Square having the same
function which prints "Square is a rectangle".
PROGRAMMING ASSIGNMEN..
Create two classes named ...
1- function of Mammals by t...
Make a class named Fruit wit..
Now, try calling the function by the object of each of these classes.
We want to calculate the total.
We want to store the informat.
6. Write a class Account that provides the basic functionality of accounts. It allows
deposits and withdrawals but not overdraft limits or interest rates.
a. Using the Account class
called SavingsAccount and CurrentAccount.
addition to the attributes of an Account object, should have an interest variable
and a method which adds interest to the account. A CurrentAccount object, in
addition to the attributes of an Account object, should have an overdraft limit
variable.
b. Now
of Account objects. Accounts in the array could be instances of
the Account class, the SavingsAccount class, or the CurrentAccount class.
Create some test accounts (some of each type).
c. Write an update method in the bank class. It iterates through each account,
updating it in the following ways: Savings accounts get interest added (via the
method you already wrote); CurrentAccounts get a letter sent if they are in
overdraft.
*Bike with data members to s..
as a base class, write two derived classes
A SavingsAccount object, in
Now, store and print the infor...
Create a class named Shape .
Now, try calling the function ...
create
a Bank class,
an object of which contains an
array
Write a class Account that pr..
Employees
d. The Bank class requires methods for opening and closing accounts, and for
paying a dividend into each account.
>
21:30
e Type here to search
26°C Partly cloudy ^ ) , ENG
31-08-2021
1
Transcribed Image Text:A Programming Assignment - 4 E Programming Assignment -4 - G X G types of inheritance with exampl My Questions | bartleby D CodesDope PRO: Simplest Cours O X i docs.google.com/document/d/1YZDAArNdeQr_COQNK-LJrmCLzdbi5usgOu9IlbsO4kg/edit ☆ I Apps G Gmail u Online Courses - A... A Classes SkillRack.com E Reading list Programming Assignment -4 ☆ 回 @ Share R File Edit View Insert Format Tools Add-ons Help Last edit was 6 hours ago A P 100% Heading 3 Times 12 B IU A = E - E - E E Editing + 31 1 2 3 4 | 5 I | 6 5. Create a class named Shape with a function that prints "This is a shape". Create another class named Polygon inheriting the Shape class with the same function that prints "Polygon is a shape". Create two other classes named Rectangle and Triangle having the same function which prints "Rectangle is a polygon" and "Triangle is a polygon" respectively. Again, make another class named Square having the same function which prints "Square is a rectangle". PROGRAMMING ASSIGNMEN.. Create two classes named ... 1- function of Mammals by t... Make a class named Fruit wit.. Now, try calling the function by the object of each of these classes. We want to calculate the total. We want to store the informat. 6. Write a class Account that provides the basic functionality of accounts. It allows deposits and withdrawals but not overdraft limits or interest rates. a. Using the Account class called SavingsAccount and CurrentAccount. addition to the attributes of an Account object, should have an interest variable and a method which adds interest to the account. A CurrentAccount object, in addition to the attributes of an Account object, should have an overdraft limit variable. b. Now of Account objects. Accounts in the array could be instances of the Account class, the SavingsAccount class, or the CurrentAccount class. Create some test accounts (some of each type). c. Write an update method in the bank class. It iterates through each account, updating it in the following ways: Savings accounts get interest added (via the method you already wrote); CurrentAccounts get a letter sent if they are in overdraft. *Bike with data members to s.. as a base class, write two derived classes A SavingsAccount object, in Now, store and print the infor... Create a class named Shape . Now, try calling the function ... create a Bank class, an object of which contains an array Write a class Account that pr.. Employees d. The Bank class requires methods for opening and closing accounts, and for paying a dividend into each account. > 21:30 e Type here to search 26°C Partly cloudy ^ ) , ENG 31-08-2021 1
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education