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.
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 number of fruits in the basket.
Write a probram with a mother class animal. Inside it define a name and an age variables, and set_value() function.Then create two bases variables Zebra and Dolphin which write a message telling the age, the name etc.
Write a program that defines a shape class with a constructor that gives value to width and height. The define two sub-classes triangle and rectangle, that calculate the area of the shape area ().
In the main, define two variables a triangle and a rectangle and then call the area() function in this two varibles.
Write a Math Class will perform the basic functions (+, -, *, /). Write two classes the SimpleCalculator and ScientificCalculator that will inherit the Math class.
Write specific methods, attributes to the classes and show the results.
what is the program output/errors
#include<iostream>
using namespace std;
int fun (int x, int y)
{
return x + y;
}
double fun (int x, int y)
{
return x * y;
}
int main()
{
cout<<fun(5, 10);
return 0;
}
Write a function called FindSequence. The function takes a 4-digit integer as parameter, validates the integer and returns 1 when the digits are in increasing order or 2 when the digits are in decreasing order or 0 when the digits are not in any order.
Write a program to help you calculate the amount of money that your customers have to
pay depending on how long they have used your computer (in hours).
first one hour = 1.20
subsequent hour = 0.80