2 147
Subscribers
+324 hours
+87 days
+1430 days
Posts Archive
2 147
Question
Write a program to accept 20 different integers in a single dimensional
Array. Arrange the number in ascending order by using the 'Bubble Sort'
technique and display them.
2 147
Question :
Write a program to input integer elements into an array of size 20 and perform the following operations:
Display largest number from the array
Display smallest number from the array
Display sum of all the elements of the array
2 147
Question :
Write a program to accept 20 integer numbers in a single
Dimensional Array. Find and Display the following:
i. Count of even numbers.
ii. Count of odd numbers.
iii. Count of multiples of 4
2 147
Question :
Accept 10 numbers into an array and then calculate the sum of numbers present in odd positions and even positions respectively.
2 147
Today we start with arrays questions. I advice all class 10 ICSE students to do these practice questions regularly.
2 147
Dear children,
Hope you did the programs given. Coming week questions on arrays will be given for the practice.
Saturday and Sunday for the preparation of this topic!!
Best wishes
2 147
Question:
Define a class Employee having the following description :
Data members/instance variables:
int pan — to store personal account number
String name — to store name
double tax income — to store annual taxable income
double tax — to store tax that is calculated
Member functions:
input() — Store the pan number, name, taxable income
calc() — Calculate tax for an employee
display() — Output details of an employee
Write a program to compute the tax according to the given conditions and display the output as per given format.
Total annual Taxable Income Tax Rate
Upto Rs. 1,00,000 No tax
From 1,00,001 to 1,50,000 10% of the income exceeding Rs. 1,00,000.
From 1,50,001 to 2,50,000. Rs. 5,000 + 20% of the income exceeding Rs. 1,50,000
Above Rs. 2,50,000 Rs. 25,000 + 30% of the income exceeding Rs. 2,50,000.
PAN NAME TAX-INCOME TAX
2 147
Question:
Define a class Employee having the following description :
Data members/instance variables:
int pan — to store personal account number
String name — to store name
double tax income — to store annual taxable income
double tax — to store tax that is calculated
Member functions:
input() — Store the pan number, name, taxable income
calc() — Calculate tax for an employee
display() — Output details of an employee
Write a program to compute the tax according to the given conditions and display the output as per given format.
Total annual Taxable Income Tax Rate
Upto Rs. 1,00,000 No tax
From 1,00,001 to 1,50,000 10% of the income exceeding Rs. 1,00,000
From 1,50,001 to 2,50,000 Rs. 5,000 + 20% of the income exceeding Rs. 1,50,000
Above Rs. 2,50,000 Rs. 25,000 + 30% of the income exceeding Rs. 2,50,000.
2 147
Question :
Define a class Student described as below:
Data members I instance variables:
name, age, m1, m2, m3 (marks in 3 subjects), maximum, average
Member methods
(i) A default constructor to initialize the data members
(ii) To accept the details of a student
(iii) To compute the average and the maximum out of three marks
(iv) To display the name, age, marks in three subjects, maximum and average.
Write a main method to create an object of a class and call the above member methods.
2 147
Question :
Define a class called FruitJuice with the following description:
Instance variables/data members:
int product_code - stores the product code number
String flavour - stores the flavour of the juice.(orange, apple, etc.)
String pack_type - stores the type of packaging (tetra-pack, bottle, etc.)
int pack_size - stores package size (200ml, 400ml, etc.)
int product_price - stores the price of the product
Member Methods:
FriuitJuice() - default constructor to initialise integer data members to zero and
string data members to “”.
void input() - to input and store the product code, flavour, pack type, pack size and
product price.
void discount() - to reduce the product price by 10.
void display() - to display the product code, flavour, pack type, pack size and product
price.
Create an object in the main method and call all the above methods in it.
2 147
Question:
Define a class called Library with the following description:
Data members/instance variables:
int code: stores library code of the book
String title: stores the title of the book
String author: stores author of the book
Member methods:
input(): to input data members from the user
compute(): to accept the number of days the book is returned late and display the fine amount at the rate of Rs. 2 per day.
display(): to display the data members in the following format:
Book Code Title Author
------------- ------- ---------
Write the main method to create an object of the class and all the above member methods.
2 147
Question:
Define a class Digital with the following specifications:
class name: Digital
Data members/ Instance variables:
String name: Customer’s name
double pp: Printed price of the digital camera
double disc_amt: Discount amount
double net_amt: Net amount payable by the customer
Member methods/ Functions:
void Inputdata(): To input the customer’s name and the printed price of the camera
void Calculate(): To calculate the Amount payable by the customer as follows: net_amt=printed price – disc_amt
disc_amt= 5% of printed price
void Display(): To display Customer name, Printed price, Discount amount and Net payable amount
Also, write the main method to call above methods.
