computer hard
computer hard
Flowchart
Start
Stop
2. Define the problem and write an algorithm to prepare a cup of tea.
Algorithm
Step 1- Start.
Inputs- Water,sugar,milk and tea leaves.
Step 2- Boil water and add sugar.
Step 3- Add tea leaves to the boiling mixture and let it boil again.
Step 4- Add milk to the mixture and let it boil to get the right colour.
Step 5- Put boiled tea in a cup.
Output- A hot tea cup.
Step 6- Stop
Start
Return Home
Chocolate bought
Stop
4. Clearly define the problem ,write algorithm and draw a flowchart to
add any two numbers.
Defining the problem - To find the sum of any two numbers accepted
from the user.
Algorithm
Step 1- Start
Inputs- Accept any two numbers as input A and input B
Step 2- Let C= A+B
Step 3 - Display the output as C
Output - Sum is C
Step 4- Stop
Flowchart
Start
Input A,B
C=A+B
Display C
Stop
Clearly defining the problem - To accept two numbers from the uses and
then find and display their product .
Algorithm
Step 1- Start
Inputs - Accept 2 numbers in A and B as Input A , B
Step 2 - Find product in C as C = A x B
Output - Display C
Step 3- Stop
Flowchart-
Start
Input A, B
C= A x B
Output -Display C
Stop
Algorithm
Step 1 - Start.
Inputs - Room Temperature.
Step 2- Ask the question - is temperature > 32?
Step 2a - If yes , then leave the baskets uncovered .Go to step 3.
Step 2 b- If no, then cover the baskets of tomatoes.
Output- Baskets covered or uncovered as per the requirement .
Step 3- Stop.
Flowchart Start
Output
No Is Yes
T > 32 Output
Tomatoes are
Tomatoes left
covered ? uncovered
Stop
7.Clearly define the problem and write algorithm and to input /accept a
number and then find and display if it is positive or negative.
Defining the problem -To accept /input a non-zero number and then
check and display if the number is positive or negative
Algorithm
Step 1- Start
Input - Number as NUM
Step 2- Ask the question-
Is NUM > 0 ?
Step 2a -If yes then display NUM is positive. Go to Step 3.
Step 2 b - If no then display NUM is negative .
Output - NUM is positive or negative is determined.
Step 3 -Stop.
Input CP,SP
No Yes
Is
Loss =CP -SP SP>CP ? Profit =SP-CP
Stop