DECISION STRUCTURE IN JAVA TEACHER: MR. HO
AGENDA Review: Software Development Life Cycle Decision Structure in Java Work Period: In-Class Exercise Bonus Question
WHAT IS SOFTWARE DEVELOPMENT LIFE CYCLE?
SOFTWARE DEVELOPMENT LIFE CYCLE User Requirements Planning & Design Implementation in Java Testing Maintenance
DECISION STRUCTURE IN JAVA
USER REQUIREMENTS Write a computer program that: Asks the user for a temperature value (in o C) Outputs that it is cold if the temperature is less than 5 o C
PLANNING & DESIGN IPO temperaturetemperature < 5“cold” InputProcessing Output
PLANNING & DESIGN FLOWCHART Start Prompt & ask for temperature (in o C) temperature < 5 Output “cold” End YES No
IMPLEMENTATION IN JAVA See BlueJ files
TESTING What is testing? Why do we need to do testing?
TESTING – TEST PLAN Temperature (in o C)Expected OutputActual Output 2.4It is cold. 7.5It is warm. 32.5It is hot. Test Cases: Does our program work correctly?
MAINTENANCE Write descriptive comments in the Java code
QUESTIONS & ANSWERS ?
IN-CLASS ACTIVITIES 1.Go to the course web page at Download today’s lesson and “2 – In-Class Activity on Decision Structure.docx” 3.Work on the In-Class Activity: Follow the software development life cycle (i.e., planning & design, implementation, test plan, and maintenance) If you are finished, let Mr. Ho know. 4.Bonus: The temperature program in today’s lesson has a minor design flaw. Identify it and fix it. Then, you will get a bonus mark.