| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Lesson 2-2: The Defining Diagram

Page history last edited by Ms. R. Singh 11 years, 6 months ago

THE DEFINING DIAGRAM

 

A table with three columns which represents the three components: input, processing and output.

 

* Input refers to the source data provided - easily identified by the keywords – given, read or accept, input

 

* Output refers to the end result required - keywords are print, display, produce, output

 

*Processing are the actions  must be performed to achieve the required output  -  it answers the question: What must I do with the inputs in order to produce the desired result?

 

 

 

PROBLEM 1:

Write a solution to read three numbers and calculate and print the total. 

 

INPUT

PROCESSING

OUTPUT

3 numbers

e.g. num1, num2, num3

  1. Get 3 numbers
  2. Add numbers together
  3. Print total.

Total

 

 

 

 

 

 

 

 

PROBLEM 2:

Given three integers representing the age of three boys respectively, write a solution to find their average age.

 

INPUT

PROCESSING

OUTPUT

3 integers

e.g.age1, age2, age3

  1. Read/accept/get 3 integers
  2. Add the 3 ages
  3. Divide total by 3
  4. Print the average,

Average

 

Comments (0)

You don't have permission to comment on this page.