0% found this document useful (0 votes)
6 views

Puesocode

The document outlines a series of programming tasks categorized into three sections: Loops and Conditions, Basic Input/Output & Conditionals, and Math-based Pseudocode or WAP Tasks. Each section contains various exercises that involve inputting numbers, performing calculations, and applying conditional logic. The tasks range from simple operations like finding averages and sums to more complex problems involving population density and student grades.

Uploaded by

ameenacandling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Puesocode

The document outlines a series of programming tasks categorized into three sections: Loops and Conditions, Basic Input/Output & Conditionals, and Math-based Pseudocode or WAP Tasks. Each section contains various exercises that involve inputting numbers, performing calculations, and applying conditional logic. The tasks range from simple operations like finding averages and sums to more complex problems involving population density and student grades.

Uploaded by

ameenacandling
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

A: Loops and Conditions Practice (WAP = Write a Program)

1. Take 10 numbers as input and print their average.


2. Read 10 numbers and find the sum of even numbers.
3. Output numbers from 10 to 25 and find the product of odd numbers in this range.
4. Input numbers until the user enters 0 (end the loop).
5. (Missing in original list)
6. Keep taking numbers and calculate their sum. Stop once the sum exceeds 100, then print the
sum.
7. Print a price table of gasoline from 1 to 25 litres ($0.60/litre).
8. Input sound levels (ending at 0 dB), then calculate and print the average sound level.
9. Keep entering student names until a blank space is entered, then print the total count.
10. Input 50 numbers, count how many are greater than 100.
11. For 500 countries, input population and land area. Output:

 Population density for each,

 Smallest and largest population densities,

 Average population.

12. Ask how many grade scores the user wants to enter, take input, and print the average.
13. Input a number and print its multiplication table.
14. Input 40 numbers, count those that are not 5 or 6.
15. Print all multiples of 5 from 1 to 100.
16. Count all even numbers from 2 to 200.
17. Print all perfect squares between 2 and 100.
18. Let the user enter a number, multiply by 10, repeat until the product is 100 or more.
19. Keep asking “Are we there yet?” until the user enters ‘y’.
20. Keep asking “What coding language is this?” and display a message when “python” is
entered.

B: Basic Input/Output & Conditionals

1. Input 3 numbers and find the maximum.


2. Input a number and check if it’s even or odd.
3. Input a character and check if it’s a vowel or consonant.
4. Input a number (1–7) and print the corresponding weekday.
5. Input a number and check if it’s positive, negative, or zero.
6. Take two numbers and an operation (+, −, ×, ÷), then perform it.
7. Input marks for 3 subjects. If all marks ≥ 50, print “Pass”; else “Fail”.
8. Input temperature and determine the state of water:

 ≤0: solid

 1–99: liquid

 ≥100: gas
9. If age ≥ 18, issue driving license.
10. Input age, check if eligible to vote (age ≥ 18).
11. Use switch-case to print remarks for grades (A, B, C, D, F).
12. Use nested if-else to find the largest of 3 numbers.
13. Input 3 angles. If their sum = 180, the triangle is valid; otherwise, not.

C: Math-based Pseudocode or WAP Tasks

1. Add two numbers.


2. Find the circumference of a circle (input radius).
3. Input marks of 5 subjects, find total and percentage.
4. Input a number (2–20), output its double.
5. Input a number, output its square root.
6. Input length and breadth, output perimeter of rectangle.
7. Input two numbers and output their product.
8. Input weights of three students, output the total weight

Section A: Loops & Conditions (WAP = Write a Program)

1. Take 15 numbers as input and print how many are negative.

2. Read 20 numbers, count how many are divisible by 3 or 5.

3. Output numbers from 30 to 50 and print the sum of numbers that are multiples of 4.

4. Keep asking for numbers until the user enters a number less than 0.

5. Keep inputting numbers and stop when the user enters two even numbers in a row.

6. Input numbers and print their average. Stop when the user enters -999.

7. Print a table showing days and hours worked (1 to 7 days, 1–10 hours/day).

8. Input 10 temperatures and print the highest and lowest temperature recorded.

9. Keep asking for product prices. Stop when total exceeds 500. Then print how many items
were entered.
10. Input 25 numbers, count how many are prime numbers.

11. For 100 students, input height and weight. Output:

 Average height,

 Average weight,

 Tallest height

12. Input marks for multiple students. Stop at -1. Count how many passed (marks ≥ 50).

13. Input a number, print the factorial of it.

14. Input 30 numbers, print how many are between 20 and 50 (inclusive).

15. Print all even numbers from 10 to 70 that are also divisible by 3.

16. Count and print all multiples of 7 from 1 to 200.

17. Print all cubes of numbers between 1 and 20.

18. Ask user to input a number. Multiply by 2 and keep going until the result becomes more
than 200.

19. Keep asking “Do you like coding?” until the user types “yes”.

20. Ask “Guess the secret number” until the user enters 42. Then print “You guessed it!”

📥 Section B: Input/Output & Conditionals

1. Input 4 numbers, print the second largest.

2. Input a year and check if it’s a leap year.

3. Input a character and check if it’s an uppercase vowel.

4. Input an hour (0–23), print if it's morning, afternoon, evening, or night.

5. Input a number, check if it's a multiple of both 3 and 7.

6. Take two numbers and output which is closer to 100.

7. Input marks for 4 subjects. Print “Distinction” if all marks ≥ 85.

8. Input temperature. Suggest “fan”, “heater”, or “open window” based on the value.

9. Input age and check which school level applies (e.g., primary, middle, high).
10. Input username and password. Grant access if both are correct.

11. Use switch-case to print month names from 1 to 12.

12. Use nested if-else to determine the type of triangle (equilateral, isosceles, scalene).

13. Input a number. Check if it’s a palindrome.

14. Input total bill and apply discount:

 1000 = 20%

 500–1000 = 10%

 <500 = 0%

➗ Section C: Math-Based WAP Tasks

1. Input base and height, output area of triangle.

2. Input a number and check if it's a perfect square.

3. Input marks of 6 subjects, calculate GPA (basic average with grading).

4. Input a number, output its cube root.

5. Input price and quantity for 3 items, find total bill and average item cost.

6. Input a 3-digit number, reverse it and print.

7. Input the radius, output volume of a sphere.

8. Input 2 numbers, output their LCM and GCD.

You might also like