Problem solving using a computer
Problem solving using a computer
# To enter a number and find it's square
- Problem Analysis {Objective, Inputs, Outputs, Processing, Feasibility study}
- Algorithm and Flowchart
- Coding
- Compilation and Execution
- Testing and Debugging
- Documentation
Write and Algorithm and Flowchart:
# To print "It is my first program"
- Start
- Print "It is my first program"
- Stop
- Start
- Input a
- r = a * a
- Print "r"
- Stop
# To find Simple Interest
- Start
- Input P, T, R
- I = (P*T*R)/100
- Print "I"
- Stop
# To enter temperature in centigrade & display its equivalent Fahrenheit
- Start
- Input C
- F = (C*9/5 + 32)
- Print "F"
- Stop
Selective Structure
Write and Algorithm and Flowchart:
# To enter an age of a person and check whether it is greater or equal to 18 or not. If it is greater or equal to 18 then display "You are eligible for voting" if not then display "You are not eligible for voting".
- Start
- Input a
- Check if a>=18 if true then goto 4 else goto 5
- Print "You are eligible for voting" goto 6
- Print "You are not eligible for voting"
- Stop
#To enter a number and check whether it is even or odd.
- Start
- Input a
- Check if a mod 2 = 0 if true then goto 4 else goto 5
- Print "It is even" goto 6
- Print "It is odd"
- Stop
#To enter a nember to check whether positive or negative.
- Start
- Input a
- Check if a = 0 if true then goto 4 else goto 5
- Print "It is zero" goto 6 else goto 7
- Check if a > 0 if true then goto 6 else goto 7
- Print "It is Positive" goto 8
- Print "It is Negative"
- Stop
#To enter the rate and quantity of an item. If the total cost exceed 15000 then provide discount 10% and display the net amount.
- Start
- Input r, q
- Check if r*q>15000 if true then goto 4 else goto 5
- c = r * q - (10 * r * q)/100
- c = r * q
- Print c
- Stop
Post a Comment