ICSE Practice test 2 class X : Top Questions
Question 2. [15]Define a class Taximeter having the following description:Data members/instance variablesint taxino - to store taxi numberString name - to store passenger's nameint km - to store number of kilometres travelledMember functions:Taximeter()- default constructor to assign default values
Watch Java videos
In this ICSE practice test all the topics of java for ICSE computer application has been covered.
ICSE Practice test
Question 1. [10]
Write a program to make a function to find the smallest digit of an integer that is input by the user.
Sample input : 6524
Sample output : Smallest digit is 2
Question 2. [15]
Define a class Taximeter having the following description:
Data members/instance variables
int taxino - to store taxi number
String name - to store passenger's name
int km - to store number of kilometres travelled
Member functions:
Taximeter()- default constructor to assign default values to the data member.
Taximeter (int tno, String nm, int k) - to store taxino ,name, km
calculate() - to calculate bill for a customer according to given conditions
Kilometers travelled(km) Rate/km
≤ 1 km Rs 25
1 < km ≤ 6 Rs 10
6 < km ≤ 12 Rs 15
12 < km ≤ 18 Rs 20 >18 km Rs 25
display()- To display the details in the following format
Taxino Name Kilometres travelled Bill amount
Create an object in the main method and call all the above methods in it.
ICSE Practice test
String Handling
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.