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

Exercise 1.2. Flowchart Instruction: Create A Flowchart of The Following (1-4) and Trace The Flowchart in Item Number 5. Write Your

1. The document provides instructions to create a flowchart for calculating the slope of a line given two points, determining the length of a ladder at a given height and angle, finding the average of a series of numbers, and determining a letter grade from an exam score. 2. It includes an example flowchart and table for tracing the flowchart to find the final sum and number of loop executions for calculating an average. 3. The user is asked to create a flowchart for the four problems and trace an example flowchart in a table to answer questions about the final sum and loop executions.

Uploaded by

rienalen placa
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)
26 views2 pages

Exercise 1.2. Flowchart Instruction: Create A Flowchart of The Following (1-4) and Trace The Flowchart in Item Number 5. Write Your

1. The document provides instructions to create a flowchart for calculating the slope of a line given two points, determining the length of a ladder at a given height and angle, finding the average of a series of numbers, and determining a letter grade from an exam score. 2. It includes an example flowchart and table for tracing the flowchart to find the final sum and number of loop executions for calculating an average. 3. The user is asked to create a flowchart for the four problems and trace an example flowchart in a table to answer questions about the final sum and loop executions.

Uploaded by

rienalen placa
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/ 2

EXERCISE 1.2.

FLOWCHART

Instruction: Create a flowchart of the following (1-4) and trace the flowchart in item number 5. Write your
answer neatly in a short bond paper.

1. Two points in a plane are specified using the coordinates (x1, y1) and (x2, y2). Calculate the slope
of a line through two (non-vertical) points entered by the user.

2. Determine the length of a ladder required to reach a given height when leaned against a ho use.
The height and angle of the ladder are given as inputs. To compute length use:

Note: the angle must be in radians. Ask for an angle in degrees and use this formula to convert:

3. Find the average of a series of numbers entered by the user. The program will first ask the user
how many numbers there are.

4. A Certain CS professor gives 100-point exams that are graded on the scale 90-100: A, 80-89:B, 70-
79:C,60-69:D, <60:F. Your program should accepts an exam score as input and prints out the
corresponding grade.

5. Trace the following flowchart using a neat table.Answer the following:


a. What is the final value of Sum? __________
b. How many times does the loop execute until the condition is satisfied? _________

Example of a tracing table of Fig.1 which uses 5 scores to compute an average:

C Score Sum C==5? Avg Output


0 2 2
1 5 7 F
2 3 10 F
3 4 14 F
4 8 22 F
5 T 4.4 4.4

Fig. 1. Sample flowchart of computing the average of 5 scores.

You might also like