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

Algorithms

The document outlines a series of programming tasks involving pseudocode and flowchart designs for various scenarios, such as calculating sums, determining even or odd numbers, grading systems, and loan eligibility checks. Each task specifies inputs, processes, and outputs, requiring the creation of flowcharts or pseudocode to illustrate the logic. The tasks range from simple arithmetic operations to more complex systems involving user interactions and conditional checks.

Uploaded by

kiprob77
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)
124 views2 pages

Algorithms

The document outlines a series of programming tasks involving pseudocode and flowchart designs for various scenarios, such as calculating sums, determining even or odd numbers, grading systems, and loan eligibility checks. Each task specifies inputs, processes, and outputs, requiring the creation of flowcharts or pseudocode to illustrate the logic. The tasks range from simple arithmetic operations to more complex systems involving user interactions and conditional checks.

Uploaded by

kiprob77
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

1.

Write a pseudocode or draw a flowchart to read two numbers, calculate their sum, and display the
result.
2. Design a flowchart and write pseudocode to read a number and determine if it is even or odd.
3. Write a pseudocode and draw a flowchart that reads a student's marks and displays the grade using
the following scale:
o 80-100: A
o 60-79: B
o 40-59: C
o 20-39: D
o 0-19: E
4. Draw a flowchart and write pseudocode to calculate and display simple interest using the formula:
SI = (P × R × T) / 100,
where P is principal, R is rate, and T is time.
5. Write pseudocode and draw a flowchart to find and display the largest of three numbers entered by
the user.
6. Draw a flowchart and write pseudocode to print the multiplication table of a number entered by the
user (from 1 to 10).
7. Write pseudocode draw a flowchart to compute the factorial of a given number.
8. Design a flowchart or pseudocode to generate and display numbers in the sequence 6, 9, 12, 15... up
to but not including 100.
9. Write pseudocode and draw a flowchart to read N numbers, find their total and average, then display
both.
10. Draw a flowchart and write pseudocode to read a password from the user and check if it matches a
pre-defined password (e.g., "abc123"). Display "Access Granted" or "Access Denied".
1. Draw a flowchart to read marks for 5 subjects, calculate the total and average, then:
o Display the average.
o If average ≥ 50, display “Pass”, else display “Fail”.
2. Design a flowchart that simulates a simple ATM withdrawal:
o Prompt the user to enter a PIN.
o If correct, allow the user to enter withdrawal amount.
o Check if the amount is available (assume balance = 10,000).
o If enough, dispense cash and display new balance; otherwise, display “Insufficient Funds”.
3. Draw a flowchart that reads a number and checks if it is a prime number.
4. Draw a flowchart that displays a menu:
o 1: Convert Celsius to Fahrenheit
o 2: Convert Fahrenheit to Celsius
Then reads user input and performs the appropriate conversion.
5. Create a flowchart that prompts the user for a password. The user has a maximum of 3 attempts to
get it right. If the user fails all 3, display “Account Locked”.
6. Draw a flowchart to read two numbers, then compute and display the sum of all even numbers
between them.
7. Draw a flowchart that:
o Prompts the user for age and ID status.
o If age ≥ 18 and ID is “Yes”, display “Eligible to Vote”.
o Else, display the appropriate message (e.g., “Not of age” or “No ID”).
8. Create a flowchart for a guessing game where the program randomly stores a number (assume it's
7), and the user is prompted to guess the number until they get it right.
9. Draw a flowchart to input three numbers and sort them in ascending order.
10. Design a flowchart that simulates a traffic light sequence:
 Red for 30 seconds
 Green for 45 seconds
 Yellow for 5 seconds
The cycle repeats 3 times.
QUESTION 1: Loan Eligibility Checker (15 Marks)
A bank only offers loans to clients who:
 Have been members for more than 2 years, and
 Earn a monthly income of at least KES 20,000.
Draw a flowchart that:
 Prompts the user to enter the number of years as a member and monthly income.
 Checks if the client qualifies for a loan.
 Displays either “Loan Approved” or “Loan Denied”.
QUESTION 2: Simple Interest Loan Calculator (15 Marks)
The formula for simple interest is:
Interest = (Principal × Rate × Time) / 100
Draw a flowchart that:
 Reads the loan amount (Principal), interest rate (Rate), and time in years (Time).
 Calculates the interest and total amount to be repaid.
 Displays the interest and the total repayment amount.
QUESTION 3: Tiered Interest Rate System (15 Marks)
A bank applies interest rates based on the loan amount as follows:
 ≤ 50,000 KES → 10%
 50,001–100,000 KES → 12%
 100,000 KES → 15%
Draw a flowchart that:
 Accepts loan amount and time (in years).
 Determines the correct interest rate.
 Calculates and displays interest and total repayment.
QUESTION 4: Credit Score-Based Loan Application (15 Marks)
To be eligible for a loan, a customer must:
 Have a credit score of at least 600, and
 Earn a monthly income of KES 30,000 or more
Draw a flowchart that:
 Prompts the user to input credit score and income.
 Checks both conditions.
 Displays either “Loan Granted” or “Loan Declined”.
QUESTION 5: Fixed Deposit Compound Interest (15 Marks)
The formula for compound interest is:
Amount = Principal × (1 + Rate/100) ^ Time
Draw a flowchart that:
 Prompts the user for investment amount, rate of interest, and time in years.
 Calculates and displays:
o The final amount after the period.
o The total interest earned.
QUESTION 6: Loan Application with Repeat Option (15 Marks)
Create a loan application system that:
 Prompts the user for membership years and monthly income.
 Checks if the user is eligible (membership > 2 years and income ≥ 20,000).
 Displays loan status (“Approved” or “Denied”).
 Asks the user whether they want to apply again.
 Repeats the process until the user chooses “No”.
Draw a flowchart to represent this process.

You might also like