CSC 1029 Week 05: Software Development Lifecycle
22 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What type of input is required to calculate the average temperature in the temperature monitoring program?

  • Floating point numbers
  • Boolean values
  • Strings of text
  • Integer values (correct)
  • Which arithmetic operation is performed to find the average temperature?

  • Subtraction
  • Multiplication
  • Division (correct)
  • Addition
  • What is the expected output when calculating the age of a dog in human years?

  • A string describing the dog's traits
  • A boolean indicating if the dog is old
  • A floating-point number of the dog's age
  • An integer representing the dog's human age (correct)
  • In the room square footage calculation, which inputs are required?

    <p>Length and width in inches</p> Signup and view all the answers

    What type of variable should be declared to store temperature readings in the program?

    <p>Integer variables</p> Signup and view all the answers

    What will be displayed if the variable 'num' is less than or equal to 0?

    <p>Negative</p> Signup and view all the answers

    What type of control structure is used in the statement 'WHILE Condition DO Statement1'?

    <p>Repetition</p> Signup and view all the answers

    Which error occurs when an invalid operation, such as dividing by zero, is encountered during program execution?

    <p>Run-time error</p> Signup and view all the answers

    Which statement is true regarding a subprogram?

    <p>It is a collection of sequences, selections, loops, and subprograms.</p> Signup and view all the answers

    What is the purpose of debugging in programming?

    <p>To locate and correct errors in the algorithm.</p> Signup and view all the answers

    If the condition 'num > 0' evaluates to false, what will the program do next?

    <p>Display 'Negative'.</p> Signup and view all the answers

    What type of data type is most likely used for the variable 'num' in the given conditional statement?

    <p>Integer</p> Signup and view all the answers

    What is the first step in the selection control structure?

    <p>Evaluate a condition.</p> Signup and view all the answers

    In a sequence control structure, how are the statements executed?

    <p>One after the other, from top to bottom.</p> Signup and view all the answers

    Which of the following represents a repetition control structure?

    <p>DO statement WHILE condition.</p> Signup and view all the answers

    Which operation would NOT typically be included in stepwise refinement?

    <p>Combining multiple subprograms into one.</p> Signup and view all the answers

    What is the main purpose of modularity in programming?

    <p>To promote the use of cohesive and maintainable code.</p> Signup and view all the answers

    Which statement is an example of variable declaration?

    <p>SET total = 0.</p> Signup and view all the answers

    What output would the following sequence of statements produce? 'DISPLAY "Enter Name"; INPUT name; DISPLAY "Hello" name.'

    <p>&quot;Hello&quot; followed by the name without space.</p> Signup and view all the answers

    What is the correct order of control structures as outlined in the Structure Theorem?

    <p>Sequence, Selection, Repetition.</p> Signup and view all the answers

    In the context of programming, what does 'top-down design' refer to?

    <p>Dividing the problem into smaller parts from the start.</p> Signup and view all the answers

    Which of the following is NOT a basic control structure mentioned?

    <p>Sorting.</p> 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.

    Quiz Team

    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.

    More Like This

    Use Quizgecko on...
    Browser
    Browser