Podcast
Questions and Answers
What type of input is required to calculate the average temperature in the temperature monitoring program?
What type of input is required to calculate the average temperature in the temperature monitoring program?
Which arithmetic operation is performed to find the average temperature?
Which arithmetic operation is performed to find the average temperature?
What is the expected output when calculating the age of a dog in human years?
What is the expected output when calculating the age of a dog in human years?
In the room square footage calculation, which inputs are required?
In the room square footage calculation, which inputs are required?
Signup and view all the answers
What type of variable should be declared to store temperature readings in the program?
What type of variable should be declared to store temperature readings in the program?
Signup and view all the answers
What will be displayed if the variable 'num' is less than or equal to 0?
What will be displayed if the variable 'num' is less than or equal to 0?
Signup and view all the answers
What type of control structure is used in the statement 'WHILE Condition DO Statement1'?
What type of control structure is used in the statement 'WHILE Condition DO Statement1'?
Signup and view all the answers
Which error occurs when an invalid operation, such as dividing by zero, is encountered during program execution?
Which error occurs when an invalid operation, such as dividing by zero, is encountered during program execution?
Signup and view all the answers
Which statement is true regarding a subprogram?
Which statement is true regarding a subprogram?
Signup and view all the answers
What is the purpose of debugging in programming?
What is the purpose of debugging in programming?
Signup and view all the answers
If the condition 'num > 0' evaluates to false, what will the program do next?
If the condition 'num > 0' evaluates to false, what will the program do next?
Signup and view all the answers
What type of data type is most likely used for the variable 'num' in the given conditional statement?
What type of data type is most likely used for the variable 'num' in the given conditional statement?
Signup and view all the answers
What is the first step in the selection control structure?
What is the first step in the selection control structure?
Signup and view all the answers
In a sequence control structure, how are the statements executed?
In a sequence control structure, how are the statements executed?
Signup and view all the answers
Which of the following represents a repetition control structure?
Which of the following represents a repetition control structure?
Signup and view all the answers
Which operation would NOT typically be included in stepwise refinement?
Which operation would NOT typically be included in stepwise refinement?
Signup and view all the answers
What is the main purpose of modularity in programming?
What is the main purpose of modularity in programming?
Signup and view all the answers
Which statement is an example of variable declaration?
Which statement is an example of variable declaration?
Signup and view all the answers
What output would the following sequence of statements produce? 'DISPLAY "Enter Name"; INPUT name; DISPLAY "Hello" name.'
What output would the following sequence of statements produce? 'DISPLAY "Enter Name"; INPUT name; DISPLAY "Hello" name.'
Signup and view all the answers
What is the correct order of control structures as outlined in the Structure Theorem?
What is the correct order of control structures as outlined in the Structure Theorem?
Signup and view all the answers
In the context of programming, what does 'top-down design' refer to?
In the context of programming, what does 'top-down design' refer to?
Signup and view all the answers
Which of the following is NOT a basic control structure mentioned?
Which of the following is NOT a basic control structure mentioned?
Signup and view all the answers
Study Notes
CSC 1029 Week 05 Class Session
- Topic: Responsible Software Development
- Sections: The Software Development Lifecycle
Learning Objectives
- Students will describe the security development lifecycle (SDL).
- Students will illustrate the analysis phase of the software development lifecycle (SDLC) for simple problems.
- Students will recognize the three basic control structures.
Overview
- Topics: Software development lifecycle (SDLC), Security development lifecycle (SDL), Programming languages, Structured programming, Defining the problem
Software Development Lifecycle (SDLC)
- Step 1: Define the problem (analysis)
- Step 2: Design the solution (algorithm)
- Step 3: Code solution (program)
- Step 4: Test and debug
- Step 5: Maintain and document
Software Development Lifecycle (continued)
- Phases: Analysis, Design, Implement, Test, Maintain
Security Development Lifecycle (SDL)
- SDL takes each element of the software development lifecycle (SDLC) and considers how it pertains to security.
- Each phase of the SDL considers security.
Analysis
- WHAT?: Defining the problem, Requirements, Most common cause of software failures is poor requirements gathering, Generate and document a clear problem statement, Use IPO diagram, Consider security
Design
- HOW?: Planning, Algorithm—expansion of steps in the IPO diagram, Flowchart, Pseudocode, Consider security
Design Tools
- Pseudocode: Can be easily done on a word processor, Implements structured design elements well, Not visual, No standard
- Flowchart: Standardized, Visual, Difficult to modify, Requires special software to do on computer
Flowchart and Pseudocode
- Example of both flowchart and pseudocode are provided depicting input of pay rate and hours worked, calculating net pay, and outputting net pay
Algorithm
- Step-by-step procedures for solving a problem in a finite amount of time.
- Computer is a tool to implement algorithms.
- Algorithm is an ordered set of instructions with finite steps, takes finite time, precise steps, and solves a general class of problems.
Implement
- Choose language, Edit—create source program, Code responsibly, Compile (translate) and Link, Syntax error—violation of programming language rules, Compiler error messages, Example: semicolon missing from programming language statement
Implement (continued)
- Create an executable program.
- Consider security.
Structured Programming
- Top-down Design—divide and conquer
- Modularity, Subprograms, Stepwise refinement
- The Structure Theorem—use three basic control structures to solve any problem:
- Sequence
- Selection (if-then-else)
- Repetition (loop)
Basic Control Structure 1: Sequence
- Statement, Statement, Statement
Basic Control Structure 2: Selection (Branch)
- IF condition THEN Statement1 ELSE Statement2
- Example: If (num > 0) Display "Positive" Else Display "Negative"
Basic Control Structure 3: Repetition (Loop)
- WHILE condition DO Statement1
Subprogram (Function)
- Meaningful collection of sequences, selections, loops, and subprograms.
Test and Debug
- Test with variety of data.
- Debugging: locating and correcting errors
- Logic error, flaw in the algorithm
- Run-time error (e.g., divide by zero)
- Programming packages usually have debugger software to help programmers.
- Consider security.
Maintain and Document
- Maintenance—changing and maintaining existing programs.
- Most coding is actually maintenance.
- Documentation—sometimes done by technical writers.
- Reliable documentation is a must.
- Helps keep track of all aspects of an application.
- Makes complex programs easier to read and understand.
- Key in knowledge transfer.
- Consider security.
Example charts for steps in software development lifecycle
- Examples of IPO chart tables and their elements, and several examples (Example 1 to 4) for practice exercises.
- Example charts are included to practice identifying the input, process, and output for solving problems to construct computer programs.
Computing Profession Ethics
- Copy software only with permission.
- Give credit to programmers.
- Use computer resources only with permission.
- Guard confidential data.
- Use software engineering principles to make error-free programs.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
This quiz covers the Responsible Software Development topic, focusing on the Software Development Lifecycle (SDLC) and the Security Development Lifecycle (SDL). Students will learn the phases of the SDLC, including analysis, design, coding, testing, and maintenance, while also recognizing basic control structures essential in programming.