0% found this document useful (0 votes)
13 views4 pages

Conditional Statement Problems

Uploaded by

sium242-40-056
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)
13 views4 pages

Conditional Statement Problems

Uploaded by

sium242-40-056
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/ 4

1.

ATM Withdrawal Process

 Problem Statement: Design a flowchart to simulate the process of withdrawing cash from an
ATM. Include steps such as card insertion, PIN validation, checking the account balance, and
dispensing cash.
 Steps:
1. Insert card.
2. Enter PIN.
3. Verify PIN (if correct, continue; if incorrect, allow up to 3 retries, then exit).
4. Check if sufficient funds are available.
5. If yes, dispense cash and update balance.
6. Eject card and display a successful transaction message.

2. Temperature Conversion Tool

 Problem Statement: Create a flowchart to convert a temperature from Celsius to Fahrenheit


or from Fahrenheit to Celsius based on user input.
 Steps:
1. Start.
2. Ask the user for the type of conversion (Celsius to Fahrenheit or Fahrenheit to
Celsius).
3. Read the temperature value.
4. Perform the conversion:
 If Celsius to Fahrenheit, use the formula F=C×95+32F = C \times \frac{9}{5}
+ 32F=C×59​ +32.
 If Fahrenheit to Celsius, use C=(F−32)×59C = (F - 32) \times
\frac{5}{9}C=(F−32)×95​ .
5. Display the result.
6. End.

3. Simple Login Verification

 Problem Statement: Create a flowchart to check if a user’s login credentials are correct. The
system should grant access if both username and password match predefined values.
 Steps:
1. Start.
2. Input username and password.
3. Compare with stored values (e.g., "admin" and "password123").
4. If both are correct, grant access and display "Login Successful."
5. If incorrect, allow up to 3 attempts.
6. If all attempts are used, lock the account and display "Access Denied."

4. Grading System for a Student

 Problem Statement: Draw a flowchart to assign a letter grade based on a student’s score in a
subject.
 Steps:
1. Start.
2. Input student’s score (0–100).
3. Check the range:
 Score 90–100: Grade A.
 Score 80–89: Grade B.
 Score 70–79: Grade C.
 Score 60–69: Grade D.
 Score below 60: Grade F.
4. Output the grade.
5. End.

5. Odd or Even Number Checker

 Problem Statement: Create a flowchart to determine if a given number is odd or even.


 Steps:
1. Start.
2. Input a number.
3. Check if the number is divisible by 2.
 If yes, the number is even.
 If no, the number is odd.
4. Display the result.
5. End.

6. Customer Discount Calculation

 Problem Statement: Design a flowchart that calculates the discount for a customer based on
their total purchase amount.
 Steps:
1. Start.
2. Input the total purchase amount.
3. Check the amount:
 If the amount is greater than $1000, apply a 10% discount.
 If between $500–$1000, apply a 5% discount.
 If below $500, no discount.
4. Calculate the final amount after applying the discount.
5. Display the discounted amount.
6. End.

7. Finding the Maximum of Three Numbers

 Problem Statement: Create a flowchart to find the largest of three given numbers.
 Steps:
1. Start.
2. Input three numbers (A, B, and C).
3. Compare A with B and C:
 If A is greater than both, A is the largest.
4. If not, compare B with A and C:

 If B is greater than both, B is the largest.

5. Otherwise, C is the largest.


6. Output the largest number.
7. End.
8. Simple Calculator for Basic Arithmetic Operations

 Problem Statement: Design a flowchart for a simple calculator that performs addition,
subtraction, multiplication, or division based on user input.
 Steps:
1. Start.
2. Input two numbers.
3. Ask the user to select an operation (+, -, *, /).
4. Perform the operation:
 Addition if the user chooses +.
 Subtraction if the user chooses -.
 Multiplication if the user chooses *.
 Division if the user chooses /.
5. Display the result.
6. End.

9. Electricity Bill Calculation

 Problem Statement: Draw a flowchart to calculate an electricity bill based on units


consumed, with different rates for ranges of usage.
 Steps:
1. Start.
2. Input the number of units consumed.
3. Check the usage:
 If units ≤ 100, rate = $0.5 per unit.
 If units between 101 and 300, rate = $0.75 per unit.
 If units above 300, rate = $1 per unit.
4. Calculate the total bill based on the rate.
5. Display the bill amount.
6. End.

10. Vending Machine Process

 Problem Statement: Create a flowchart for a vending machine that dispenses items based on
user selection and checks if sufficient funds are provided.
 Steps:
1. Start.
2. Display items with prices.
3. User selects an item.
4. Input the amount paid.
5. Check if the amount is sufficient:
 If yes, dispense item and return any change.
 If no, prompt to add more money.
6. End.

11. BMI Calculation and Categorization

 Problem Statement: Create a flowchart to calculate Body Mass Index (BMI) and categorize it
as Underweight, Normal, Overweight, or Obese.
 Steps:
1. Start.
2. Input weight (in kg) and height (in meters).
3. Calculate BMI using the formula: BMI=weight/height*height
4. Categorize BMI:
 BMI < 18.5: Underweight.
 BMI 18.5–24.9: Normal.
 BMI 25–29.9: Overweight.
 BMI ≥ 30: Obese.
5. Display BMI and category.
6. End.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy