Professional Documents
Culture Documents
Full Syllabus Test - 20-2-2021
Full Syllabus Test - 20-2-2021
c. Math.ceil(-6.7) (1)
b. Write an expression that uses a conditional operator to set the value of discount to
10 if price is less than 1500 and to 15 otherwise (2)
c. Decalre a variable PI, and assign the fixed value 3.142 to it. (2)
d. Write and explain the 2 different styles of expressing a comment in a program (2)
e. find 15 – 30/4 + 9*6 %5 (2)
5. Write a menu driven program to generate the sum of the given series
-- s = 1/1 + 1/2 + 1/3 + …. + 1/n
-- s = 1/a2 + 4/a5 + 7/a8 +….. to n terms (15)
6. A prepaid taxi charges from the passengers as per the tariff given below:
Distance rate
Upto 5 km Rs. 60
For next 10 km Rs 10/km
For next 10 km Rs 8/km (15)
More than 25 km Rs 5/km
WAP to input the distance covered and calculate the amount paid by the passenger.
7.1. WAP to enter a number and check whether the number is a “Neon” number or
not. A number is said to be Neon , if sum of the digits of square of a number is equal
to the number itself. E.g. 9
9*9 = 81 8+1 =9 So 9 is a Neon number (8)
8. WAP to accept the number of days and convert days into years, months and days.
Display total number of years, months and days present. Ignore leap years.
Assume 1 year = 365 days and 1 month = 30 days
e.g. days = 400
output = 1 year 1 month and 5 days (15)
9. WAP to accept the marks obtained and print the grade based on the marks obtained
according to the following table: (15)
Marks Grade
More than 85 A
More than equal to 70 ad upto 85 B
More than equal to 50 and upto 69 C
More than equal to 40 and upto 49 D
Less than 40 F
Answers
A
Object
-6.0
Double
=
17
bytecode
12
I=10
J=11
A=15 b=10
No output