Lecture 6 - Flowcharting

# Lecture 6 - Flowcharting - mm wall thickness mm and density...

This preview shows pages 1–4. Sign up to view the full content.

1/27/2010 1 TODAY’S TOPICS : : Flowcharting Programming Engr 160 Flowcharting How will learning this help me? • Flowcharts help you organize a program • Flowcharts will help you plan out the logic of your programs • Flowcharts are a graphical representation of a program Free Associations with this Topic Engr 160

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1/27/2010 2 Flowchart Symbols • Enter data or output data • Perform a calculation • Make a decision (branch) • Loop (repeat a part of the program) • A smaller program within a larger program (sub-program, function, subroutine) • Go to this symbol to find the next part of the program Engr 160 I/O A Flowchart Symbols • Begin/End the program • Off page connector • Comments Engr 160 Begin B comments
1/27/2010 3 Sample Flowchart • Calculate the mass of a hollow aluminum sphere. • The user (person using the program) should be prompted for outer diameter in

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mm, wall thickness, mm, and density, in kg/m 3 • Print out the mass in kg/m 3 • d O = 260 mm, t = 3.10 mm, density_Al = 2640 kg/m 3 • Density water = 1000 kg/m 3 Engr 160 Engr 160 1/27/2010 4 In Class Assignment Make flowchart that represents a program which will do the following: 1. Prompts the user for his or her name 2. Asks the user to input two coordinates, (x 1 , y 1 ) and (x 2 , y 2 ) 3. Calculates the slope, m, and prints it out to the user 4. Calculates the y-intercept, b, and prints it out to the user 5. Asks the user if he or she wishes to compute a new slope and y-intercept 1. If the answer is yes, then the program should go back to the point where the coordinates are asked for 2. If the answer is no, then the program should end Engr 160...
View Full Document

## This note was uploaded on 02/09/2012 for the course ENGR 160 taught by Professor Sengupta during the Spring '07 term at Iowa State.

### Page1 / 4

Lecture 6 - Flowcharting - mm wall thickness mm and density...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online