0% found this document useful (0 votes)
52 views2 pages

Pseudocode Practice Questions

The document contains a series of pseudocode exercises focused on various programming concepts such as condition checks, input validation, and classification based on specific criteria. Each question outlines a specific scenario, including checking exam pass status, loan eligibility, grading based on scores, vehicle speed classification, and validating user inputs like integers, emails, and hex color codes. The exercises are designed to practice logical reasoning and coding skills in a structured format.

Uploaded by

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

Pseudocode Practice Questions

The document contains a series of pseudocode exercises focused on various programming concepts such as condition checks, input validation, and classification based on specific criteria. Each question outlines a specific scenario, including checking exam pass status, loan eligibility, grading based on scores, vehicle speed classification, and validating user inputs like integers, emails, and hex color codes. The exercises are designed to practice logical reasoning and coding skills in a structured format.

Uploaded by

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

PSEUDOCODE PRACTICE

Q1. Write a pseudocode that checks if a student has passed an exam. The student
passes if their score is 50 or more AND they have attended more than 75% of the classes
OR they have a medical exemption. Display "Pass" if the conditions are met; otherwise,
display "Fail."(Range Check)

Q2. Write a pseudocode to check if a person is eligible for a loan. The person is eligible if
their credit score is above 700 AND they have an income over $30,000 OR they have a
guarantor. Display "Eligible" if they qualify; otherwise, display "Not Eligible.

Q3. Create a pseudocode that takes a student’s score as input and outputs their grade
according to the following criteria:

Grade: A" for scores 90 and above,


Grade: B" for scores between 80 and 89,
Grade: C" for scores between 70 and 79,
Grade: D" for scores between 60 and 69,
Grade: F" for scores below 60,
and "Invalid score" for any negative score or score above 100.

Q4. Write a program that takes the speed of a vehicle as input and classifies it according
to the following conditions:

"Over-speeding" if the speed is above 120,


"Highway speed" if the speed is between 80 and 120,
"City speed" if the speed is between 40 and 79,
"Slow speed" if the speed is below 40,
and "Invalid speed" if the speed is negative

Q5. Write a pseudocode to check if the user input is a valid integer. If the input is not an
integer, display an error message.( Type check)

Q6. Write a pseudocode to check if the user has entered any input. If the input is blank,
display an error message. (Presence Check)
Example:

INPUT user_input
IF user_input =” “ THEN
PRINT "Error: No input provided."
ELSE
PRINT "Input received."
END IF
Now make 2 Pseudocode
1)for checking password has input or not
2) for checking phone number has input or not

Q7. Write a pseudocode to Check if the user input is in a valid email format (basic
format: contains "@" and ".").( Type check)
Example:-

Date Format Check (YYYY-MM-DD)

INPUT date
IF date matches pattern "YYYY-MM-DD" THEN
PRINT "Date is in valid format."
ELSE
PRINT "Date is in invalid format."
END IF

Q8. Write a pseudocode to Check If hex Color Code starts with "#" and has 2-7
characters and valid hex digits (0-9, A-F). (Type check)
Hex Color Code Format Check (e.g., #FFFFFF)

INPUT hexColorCode
If hexColorCode starts with "#" AND hexColorCode has characters 2-7 are valid AND hex
digits (0-9, A-F)
Print "Hex color code is in valid format"
Else:
Print "Hex color code is in invalid format"

Q9. Write a pseudocode to Check Time Format Check (24-hour format, HH)

You might also like