Page 2 - HA
P. 2
Home Assignment
Answer the following:
1. What is problem solving and what are the steps in problem solving?
2. Write pseudocode that reads two numbers and divide one by another and display the
quotient.
3. Write the pseudocode to print the bill depending upon the price and quantity of an item.
Also print Bill GST, which is the bill after adding 5% of tax in the total bill.
4. Write pseudocode that will perform the following:
a) Read the marks of three subjects: Computer Science, Mathematics and Physics, out of
100
b) Calculate the aggregate marks
c) Calculate the percentage of marks
5. Write an algorithm to find the greatest among two different numbers entered by the user.
6. Write an algorithm that performs the following:
Ask a user to enter a number.
If the number is between 5 and 15, write the word GREEN.
If the number is between 15 and 25, write the word BLUE.
if the number is between 25 and 35, write the word ORANGE.
If it is any other number, write that ALL COLOURS ARE BEAUTIFUL.
7. Write an algorithm that accepts four numbers as input and find the largest and smallest of
them.
8. Write an algorithm to display the total water bill charges of the month depending upon the
number of units consumed by the customer as per the following criteria:
• for the first 100 units @ ` 5 per unit
• for next 150 units @ ` 10 per unit
• more than 250 units @ ` 20 per unit
Also add meter charges of ` 75 per month to calculate the total water bill.
9. State which among the following is efficient algorithm:
Input num Input num
If num%2==0 If num%2==0
Print EVEN Print EVEN
ELSE IF NUM%2 <> 0
PRINT ODD PRINT ODD
10. State which among the following is efficient algorithm:
Input num1, num2, num3 Input num1, num2, num3