You are on page 1of 24

Activity book

English composition & comprehension


Assignment #2
16 December, 2022

Submitted by:

Name: Tahir Mehmood


Section: 1G
Roll no. 348

Submitted to:
Write pseudocode and draw flowchart for following problems.

Mam Alina
Task 1: Marks: 20

Ask the user to input a character. Display the character and a message saying whether the character
is vowel or not.
Task 2: Marks: 20

Prompt the user to enter a year and output a message saying whether the entered year is leap year
or not.
Task 3: Marks: 20

Ask the user to input three numbers. Output the numbers in ascending order.
Task 4: Marks: 20 Take
three numbers as input from user and display the largest number using nested if.
Task 5: Marks: 20

In a right triangle, the square of the length of one side is equal to the sum of the squares of the
lengths of the other two sides. Prompts the user to enter the lengths of three sides of a triangle and
then outputs a message indicating whether the triangle is a right triangle.
Task 6: Marks: 20

Make a solution that mimics a calculator. Take as input two integers and the operation to be
performed. Then output the numbers, the operator, and the result. (For division, if the denominator
is zero, output an appropriate message.)
Task 7: Marks: 10

Accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the
volume of the object using the formula: density 1⁄4 mass / volume.
Task 8: Marks: 20

Take a number as input from user and output the number and a message saying whether the
number is positive, negative, or zero.
Task 9: Marks: 10

Ask the user to enter the weight of a person in kilograms and outputs the equivalent weight in
pounds. (Note that 1 kilogram 1⁄4 2.2 pounds.)
Task 10: Marks: 10

Ask the user to input the elapsed time for an event in hours, minutes, and seconds and output the
elapsed time in seconds.
Task 11: Marks:20

Prompts the user to input the elapsed time for an event in seconds and displays the elapsed time in
hours, minutes, and seconds. (For example, if the elapsed time is 9630 seconds, then the output is
2:40:30.)
Task 12: Marks: 20

Ask the user to enter the capacity, in gallons, of an automobile fuel tank and the miles per gallons
the automobile can be driven. Then outputs the number of miles the automobile can be driven
without refueling.
Task 13: Marks: 20

Take three angles of a triangle from user and check whether a triangle can be formed by the given
value.
Task 14: Marks: 20

Take a character as input from user and display the character and a message saying whether the
character is lower case alphabet, upper case alphabet, digit, or special character.
Task 15: Marks: 20

Ask the user to enter number of days and convert days to years, weeks and days.
Task 16: Marks: 10

Ask the user to enter an integer for a month. Print the days in that month.
Task 17: Marks: 10

Ask the user to enter two angles of a triangle and find the third angle.
Task 18: Marks: 10

Ask the user to enter a number and check if it is prime number or not.
Task 19: Marks: 10
Ask the user to enter a base number and an exponent to compute. Calculate the power of base and
print the result.
Task 20: Marks: 20

Write down a solution to compute the net salary of a person. Ask the user to enter the salary. If the
salary is 20000or less, it deducts 7% of salary and add 10% allowance. If the salary is 30000, it
deducts 10% from the salary and add 15% allowance. If salary is more than 30000, it deducts nothing
and add 20% allowance. Display the net salary.

You might also like