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 (C)</p> Signup and view all the answers

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

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

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

<p>Negative (B)</p> Signup and view all the answers

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

<p>Repetition (C)</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 (B)</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. (C)</p> Signup and view all the answers

What is the purpose of debugging in programming?

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

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

<p>Display 'Negative'. (A)</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 (B)</p> Signup and view all the answers

What is the first step in the selection control structure?

<p>Evaluate a condition. (C)</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. (C)</p> Signup and view all the answers

Which of the following represents a repetition control structure?

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

Which operation would NOT typically be included in stepwise refinement?

<p>Combining multiple subprograms into one. (A)</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. (C)</p> Signup and view all the answers

Which statement is an example of variable declaration?

<p>SET total = 0. (A)</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. (D)</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. (A)</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. (D)</p> Signup and view all the answers

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

<p>Sorting. (A)</p> Signup and view all the answers

Flashcards

Conditional Statement

A code block that executes a specific set of instructions based on whether a condition is true or false.

Loop (Repetition)

A programming structure that repeats a block of code until a specific condition is met.

Subprogram (Function)

A named block of code that performs a specific task.

Debugging

The process of identifying and fixing errors in a program.

Signup and view all the flashcards

Logic Error

An error in a program's logic that causes it to produce incorrect results.

Signup and view all the flashcards

Run-time Error

An error that occurs while a program is running, often due to invalid input or a calculation problem.

Signup and view all the flashcards

Testing (programs)

Evaluating a program's correctness and identifying issues with different inputs.

Signup and view all the flashcards

Calculate average temperature

Input maximum and minimum temperatures, then calculate the average.

Signup and view all the flashcards

Dog's age in human years

Input a dog's age, convert it to a human equivalent.

Signup and view all the flashcards

Room square footage

Calculate the area of a room given its length and width (in inches).

Signup and view all the flashcards

Input maximum temperature

Obtain the highest temperature reading for a day.

Signup and view all the flashcards

Input minimum temperature

Obtain the lowest temperature reading for a day.

Signup and view all the flashcards

Top-Down Design

A problem-solving approach that breaks down a large problem into smaller, more manageable subproblems.

Signup and view all the flashcards

Modularity

The principle of designing a system as a collection of independent modules.

Signup and view all the flashcards

Subprograms

Reusable blocks of code that perform specific tasks.

Signup and view all the flashcards

Stepwise Refinement

A technique to develop a program by progressively adding detail to its design.

Signup and view all the flashcards

Structure Theorem

A theorem stating that any algorithm can be built using sequence, selection, and repetition.

Signup and view all the flashcards

Sequence

A basic control structure where statements are executed in order.

Signup and view all the flashcards

Selection (if-then-else)

A control structure that executes different statements based on a condition.

Signup and view all the flashcards

Repetition (loop)

A control structure that repeats a block of statements until a condition is met.

Signup and view all the flashcards

Basic Control Structure 1: Sequence

A set of instructions executed one after another.

Signup and view all the flashcards

Basic Control Structure 2: Selection

A control structure that allows choices based on conditions(if-then-else).

Signup and view all the flashcards

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