Exercise 5 Draw a flowchart that represents your algorithm in Exercise 3.
3 Flowchart with branching (Decision) All steps in the previous flowcharts were sequential, however sometimes there is a need for making decision and flow specific branch based on the decision. For example, let’s assume that the three numbers entered in the previous example repres ent exam grades, and after calculating the average, instead of printing the average, we would like to print “Pass” if the average is equal or greater than 60, otherwise we want to print “Fail”. The following flowchart represents the steps to perform the task above.
4 Exercise 6 Draw a flowchart that reads two numbers from user and prints the maximum one. Exercise 7 Draw a flowchart that reads a number from user then determine if the number is positive or negative. Exercise 8 Draw a flowchart to read employee’s salary, deduct the tax and print the net salary. If the salary is less than 10,000 the tax is 5%, otherwise the tax is 10%. Exercise 9 Draw a flowchart to read three numbers from user, and print the smallest one. Exercise 10 Draw a flowchart that reads three numbers and prints one of the following a- They are all the same b- Only two of them are equal c- They are different Exercise 11 Assuming user enters his grade between 1 and 100 inclusively, draw a flowchart to read student’s grade
You've reached the end of your free preview.
Want to read all 6 pages?
- Spring '16
- Computer Programming, Dept. of Computer Science, Al-Khwarizmi