Professional Documents
Culture Documents
Class Q
Class Q
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.