You are on page 1of 21

Worksheet 1

1. Write a program to print "Hello World"

2. Write a program (WAP) to assign the cost of two mobile phones and find their total cost.
3. Write a program (WAP) to input the cost of two mobile phones and find their total cost.

4. WAP to input the speed of 3 trains and calculate their sum and average.
5. WAP to input length and breadth to calculate the area of a rectangle.
Worksheet 2
1. WAP to interchange the values of two numbers using a third variable

2. Write a program to input and find the value of the following expression and then display the output
Z = (a5 + b2 – c9) / 2a
3. Write a program to accept the basic salary of a person and then print the total salary if

HRA=25% of basic TA=15% of Basic ENT = 10% of Basic PF = 12% of basic

Gross salary = basic + HRA + TA + ENT


Net salary = Gross salary - PF
Worksheet 3
1. WAP to input 2 numbers and display the largest number among them / input age of 2 children and display who is
oldest

2. WAP to input the age of a person and find whether he is eligible to vote or not.
3. WAP to find whether a given number is odd or even
Worksheet 4
1. WAP to input the total amount in a bill if the amount is greater than 1000 then a discount of 100 is given, otherwise
no discount is given

2. WAP to input the size of a pizza. If the user chooses “m” display “Medium" else display “Large”.
3. WAP to input the income and expenses of an ice cream stall for the month of June. Check, if it is profit or loss
Worksheet 5
1. WAP to display the three given elective subject options for a student. If the student chooses the subject code,
display the respective Subject Name
Subject Subject
Code Name
1 Computer
2 Arts
3 Cookery
2. Write a program that will input the ID, weight and height of a student, and calculate their body mass index

(BMI) and output their ID, BMI and a comment as follows:


A BMI greater than 25 will get the comment ‘OVER WEIGHT’, a BMI between 25 and 19
(inclusive) will get ‘NORMAL’ and a BMI less than 19 will get ‘UNDER WEIGHT’.

3. WAP to input some amount in indian currency and then convert to different currency value based on the user’s
choice. Follow the table below
Choice Country’s Value
1 Rs. 60 = 1 $ (US)
2 Rs 102= 1 Pounds (UK)
3 Rs 9.68= 1 yuan (Chinese)
4 Rs 13.38= 1 Dinar (Kuwait)
4. A house owner must pay tax based on the value of the house. WAP to calculate the tax for the given criteria.

House Value Tax Percentage


>=200000 2%
>=100000 1.5%
>=50000 1%
<50000 0

Worksheet 6
1. Write a program to input Name, Roll No and marks of five subjects. Overall Grade is assigned based on the
following
criteria:-
Average marks Grade

90% and above A*

80% - 89% A

70% - 79% B

60% - 69% C

Below 60% D

3. A Textile industry has announced the following festival discounts on the purchase of items, based on the total cost
of the items purchased:
Total cost Discount
percentage
5%
Less than Rs. 2000
25%
Rs. 2001 to Rs.5000
35%
Rs. 5001 to Rs.10000
50%
Above Rs. 10000
Calculate the discount amount and the total amount to be paid by the customer.

Worksheet 7 (Fixed iteration)


1. WAP to print set of numbers from 1 to 20.

2. WAP to print all numbers from 10 to 0.

3. WAP to print numbers from 5 to -5.


4. WAP to accept any 10 number and print all odd and even numbers with appropriate message.

Worksheet 8
1. WAP to accept 25 numbers and hence calculate & print sum of even and odd integers .

2. WAP that reads a positive integer from the user and counts the number of divisors of the given number.
3. WAP to input the total marks of 25 students in a class and then display the average marks of the class. Also print
the number of students in each of following range.
61 – 70, 71 – 80, 81 – 90, 91 – 100
Worksheet 9
1. Robotics is an organization with 100 employees. WAP to input the basic salaries of all th employees in the
organization & then print their gross and net salary.

HRA = 20% of basic


DA = 25% of basic
CTA = 10% of basic
PF = 12% of basic
Gross salary = basic + HRA + DA + CTA
Net salary = Gross salary – PF
2. WAP to calculate and print the values of z = x2 + y 2 where the value of x ranges from 0 – 50 and y remains at 5.
Declaration:
int x,y;
double z;

You might also like