Trending ▼   ResFinder  

ICSE Class X Question Bank 2023 : Computer Applications : Computer

5 pages, 29 questions, 0 questions with responses, 0 total responses,    0    0
Akshay C K
Chinmaya Vidyalaya, Bangalore
V-X
+Fave Message
 Home > akki_2007 >

Formatting page ...

PRACTICE PROGRAMS I. Based on Data Members and Member functions:1. Define a class with the following specifications:Class Name:- Tax Member variables:String name stores the customer s name int a stores the water consumption in gallons int rate stores the tax rate Member methods:(i) Tax () default constructor to initialize the data members with default values. (ii) void input () accept details for name and water consumption in gallons. (iii) void compute () find the tax rate based on the following criteria: Water consumed (in Gallons) Tax Rate in ` More than 45 but 75 or less Rs. 475 More than 75 but 125 or less Rs.750 More than 125 but 200 or less Rs.1225 More than 200 but 350 or less Rs.1650 More than 350 Rs.2000 (iv) void display () print the customer s name, water consumption and the tax rate. void main() to create an object and call the above member methods. 2. Define a class with the following specifications:Class Name:- Taxi Member variables:String n stores the customer s name int km stores the distance travelled in kilometres int bill stores the amount to be paid. Member methods:(i) default constructor to initialize the data members with default values. (ii) parameterized constructor to initialize the data members n and km. (iii) void find () calculate the bill amount to be paid based on:Distance (in Kms) Amount in ` First 5 kms `250 [fixed] Next 5 Kms `100 per Km More than 10 Kms `150 per Km (iv) void print () display the details. void main() to create an object and call the above member methods. 3. Define a class with the following specifications:Class Name:- Conversion Member variables:double f stores the temperature as Fahrenheit value double c stores the centigrade value int m stores the number of metres int cm stores the number of centimetres int ft stores the value as number of feet int in stores the value as number of inches Member methods:(i) void get_data () accept values for f, m and ft

Formatting page ...

Formatting page ...

Formatting page ...

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 

© 2010 - 2024 ResPaper. Terms of ServiceContact Us Advertise with us

 

akki_2007 chat