Topics
Revision of Class Ix Syllabus
Class as the Basis of All Computation
User - Defined Method
Constructors
Library Classes
Encapsulation
Arrays
- Definition of Array
- Types of Array
- Usages of Array
- Sorting and Search Technique of Array
- Declaration of Single and Double Dimension Arrays
- Initialization of Single and Double Dimensional Arrays
- Accepting Data of Single and Double Dimensional Arrays
- Accessing the Elements of Single Dimensional and Double Dimensional Arrays
String Handling
description
- Scope of variables
- Scope of Class variables
- Scope of Instance variables
- Scope of Argument variables
- Scope of Local variables
If you would like to contribute notes or other learning material, please submit them using the button below.
Related QuestionsVIEW ALL [4]
Define a class named BookFair with the following description:
Instance variables/Data members :
String Bname — stores the name of the book
double price — stores the price of the book Member methods :
(i) BookFair() — Default constructor to initialize data members
(ii) void Input() — To input and store the name and the price of the book.
(iii) void calculate() — To calculate the price after discount. Discount is calculated based on the following criteria.
Price | Discount |
Less than or equal to Rs. 1000 | 2% of price |
More than Rs. 1000 and less than or equal to Rs. 3000 |
10% of price |
More than % 3000 |
15% of price |
(iv) void display() — To display the name and price of the book after discount. Write a main method to create an object of the class and call the above member methods.
Advertisement Remove all ads