110 likes | 241 Views
CS 0004 –Lecture 8. Jan 24 , 2011 Roxana Gheorghiu. Software Development Cycle. Analyze Design Choose the Interface Build Interface and Write Code Test and Debug Complete Documentation. Analyze. Analyze...
E N D
CS 0004 –Lecture 8 Jan 24, 2011 Roxana Gheorghiu
Software Development Cycle • Analyze • Design • Choose the Interface • Build Interface and Write Code • Test and Debug • Complete Documentation
Analyze • Analyze... • the problem; determine the events that the controls on the window should respond to • what inputs are needed and supplied • what output is required • Design • Choose the Interface • Build Interface and Write Code • Test and Debug • Complete Documentation
Design • Analyze • Design... • an algorithm • a sequence of steps to solve the problem • Choose the Interface • Build Interface and Write Code • Test and Debug • Complete Documentation
Design techniques • Three design techniques • Flowchart • Show graphically the steps needed to complete a task and how they relate to each other • Pseudocode • Outline the task using English-like and Visual Basic-like phrases • Hierarchy Chart • Shows how the different parts of a program relate to each other
Pseudocode Ask the user for a number. If it's 0 (zero) print “no zero, pls”. If it's not zero, display the result of 70/number. -------------------------------- PRINT "Enter number: " READ number IF number IS 0 PRINT "Enter number: ” ELSE PRINT 70/number
Choose the Interface • Analyze • Design • Choose the Interface • how to obtain input from the user • text box, combo box, list, menu, button, etc. • how to display any results to the user • text box, table, graphics, etc. • Build Interface and Write Code • Test and Debug • Complete Documentation
Building Interface and Write Code • Analyze • Design • Choose the Interface • Build Interface and Write Code • Create interface using VB controls • Adjust settings of controls; write the handlers for the events defined in step 2 (design phase) • Translate algorithm into VB • Comment Code • Test and Debug • Complete Documentation
Test and Debug • Analyze • Design • Choose the Interface • Build Interface and Write Code • Test and Debug • Testing: Finding errors in your program • Run program on expected input • Run program on unexpected input • Debugging: Fixing errors in your program • Complete Documentation
Complete Documentation • Analyze • Design • Choose the Interface • Build Interface and Write Code • Test and Debug • Complete Documentation • Finalize comments in code • Create document describing: • What program does • What its input and output are
Rock/Paper/Scissors Game ***************** Write a program that will simulate the rock/paper/scissors game. You will play against the computer. The program will display who won.