Lab7_slides

Lab7_slides - Swinburne University of Technology Use of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1 Swinburne University of Technology Faculty of Engineering and Industrial Sciences HES1300 Laboratory worksheet 7 2 Use of Functions in C c Write a program that reads 3 integers from keyboard and prints their average, the maximum, the minimum, the median and their standard deviation value. 1 ) ( 1 2 - - = = n x n i i μ σ 3 The first step: Pseudocode for the main c Pseudocode for the main function: e 1) Read a, b and c e 2) Call the function myAverage e 3) Print the average e 4) Call the function myMax e 5) Print the largest value e 6) … 4 The second step: flowchart for the main Part of the main flowchart Begin End Declaration scanf Call myAverage 5 The third step: Pseudocode for the myAverage c Pseudocode for the myAverage function: e 1) Sum the input values e 2) Divide the sum by 3 e 3) Return the average 6 The fourth step: flowchart for the myAverage myAverage Return the average Declaration Summation division
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 7 The fifth step: Pseudo code for the myMax c 1) Compare the first two value and store
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/29/2010 for the course C++ c taught by Professor Lauren during the Three '10 term at Swinburne.

Page1 / 3

Lab7_slides - Swinburne University of Technology Use of...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online