week09 - WELCOME EF 105 Spring 2006 Week 9 Program Features...

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

View Full Document Right Arrow Icon
    WELCOME WELCOME EF 105                Spring 2006 Week 9
Background image of page 1

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

View Full DocumentRight Arrow Icon
    Program Features All programs include some of the following  features: Control structures (sequential, branching,  looping) Data structures (arrays, linked lists, objects,  etc.) Input/output support Variables Constants
Background image of page 2
    Data Structures A common data structure is an array – a list of data  elements that, while composed of individual  members, is  treated as a group. We might consider a class full of EF105 students as  an array. The array itself, EF105Array, contains  individual elements (the names of all EF105  students). We could identify an individual student by referring  to that student's position in the array. Their position  is indicated using an index, which identifies their  unique location in the array. 
Background image of page 3

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

View Full DocumentRight Arrow Icon
    Arrays - Conceptual Example 0 Anne 1 Aaron 2 Michelle 3 Beatrice 4 Jacqueline 5 Gary We would use  EF105Class[5]  to  represent the value  "Gary." To change the value  stored in  EF105Class[5] , we  would do something  like this: EF105Class[5]="Eri n"; Indexes Elements Elements (Values) (Values) Array: EF105Class Array: EF105Class
Background image of page 4
    Programs Here is a problem statement to program: Create a program that asks the user for an initial integer value For five times, count in increments of the seed number, and cause the  values to be printed to the screen For example, if the user types in a 3, you would produce the following 5 digit  series: 6, 9, 12, 15, 18 After displaying the value, thank the user for running your program and  terminate the program. Here is a potential algorithm: Prompt the user to enter an integer value Take the entered value, and add it to itself 5 times Display each interim value Display a message to the user Terminate the program
Background image of page 5

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

View Full DocumentRight Arrow Icon
    Stepwise Refinement Each task now needs to be considered in  finer detail, for example: "Prompt the user to enter a value" Create a variable to hold the number the user will  type in Display a text message to the user to enter a  number “Capture” what the user keys in, convert it from  text to an integer Store the integer in the variable location
Background image of page 6
    More Stepwise Refinement Of all the major subtasks, the “add the seed value to  itself 5 times” is particularly interesting … How can we go about doing this? We want a block of 
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/13/2008 for the course EF 105 taught by Professor Jackson during the Spring '05 term at University of Tennessee.

Page1 / 41

week09 - WELCOME EF 105 Spring 2006 Week 9 Program Features...

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

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