You are on page 1of 1

1.

Create a class called ‘House’ with two String variables ‘address’, ‘color’ and
one double
variable ‘area_code’. Create the methods to initialize these values and to display
the same

2. Create a class named 'Student' with String variable 'name' and integer variable
'roll_no',
mark1, mark2, mark3. Assign the values to these variables by creating an object of
the class
Student and calculate the total and average of the marks using different methods of
a class and access the same from the Main method.

3. Create a class called “Item” with the following variables item_id, quantity,
price. Use
appropriate datatypes. Item class should have a method to find the total amount for
a specified quantity. Create the objects for this ‘Item’ class and find the total
bill amount by calculating from Main method.

4. Define a class to represent a Bank Account. Include the following members:


Data member:
a. Depositor Name
b. Account Number
c. Account Type
d. Balance Amount
Member functions:
a. To initialize the data members
b. To deposit an amount
c. To withdraw an amount after checking balance
d. To display name and balance

You might also like