CSCI 2132 Software Development. Lecture 14: Software Development Life Cycle

Similar documents
Chapter 7. Basic Types

CSCI 2132 Software Development. Lecture 17: Functions and Recursion

COP 3275: Chapter 07. Jonathan C.L. Liu, Ph.D. CISE Department University of Florida, USA

CSCI 2132 Software Development. Lecture 18: Functions

CSCI 2132 Software Development. Lecture 20: Program Organization

THE FUNDAMENTAL DATA TYPES

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

CSCI 2132 Software Development. Lecture 8: Introduction to C

Arithmetic Operators. Portability: Printing Numbers

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

1.3b Type Conversion

19-Nov CSCI 2132 Software Development Lecture 29: Linked Lists. Faculty of Computer Science, Dalhousie University Heap (Free Store)

Chapter 3. Fundamental Data Types

Data Types. Data Types. Integer Types. Signed Integers

25.2 Opening and Closing a File

CSCI 2132 Software Development. Lecture 19: Generating Permutations

Module 2 - Part 2 DATA TYPES AND EXPRESSIONS 1/15/19 CSE 1321 MODULE 2 1

Expressions. Arithmetic expressions. Logical expressions. Assignment expression. n Variables and constants linked with operators

Chapter 7. Expressions and Assignment Statements ISBN

C programming basics T3-1 -

Computers Programming Course 6. Iulian Năstac


ENG120. Misc. Topics

C Programming Language (Chapter 2 of K&R) Variables and Constants

Information Science 1

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

UNIT 3 OPERATORS. [Marks- 12]

The Design of C: A Rational Reconstruction: Part 2

Continued from previous lecture

27-Sep CSCI 2132 Software Development Lecture 10: Formatted Input and Output. Faculty of Computer Science, Dalhousie University. Lecture 10 p.

Chapter 7. Expressions and Assignment Statements (updated edition 11) ISBN

Data Type Fall 2014 Jinkyu Jeong

Software II: Principles of Programming Languages. Why Expressions?

cast.c /* Program illustrates the use of a cast to coerce a function argument to be of the correct form. */

The Design of C: A Rational Reconstruction (cont.)" Jennifer Rexford!

Chapter 7. Expressions and Assignment Statements

Basic Types and Formatted I/O

Outline. Performing Computations. Outline (cont) Expressions in C. Some Expression Formats. Types for Operands

Final Exam 1 /12 2 /12 3 /10 4 /7 5 /4 6 /10 7 /8 8 /9 9 /8 10 /11 11 /8 12 /10 13 /9 14 /13 15 /10 16 /10 17 /12. Faculty of Computer Science

The Design of C: A Rational Reconstruction (cont.)

Chapter 3 Structure of a C Program

COMP 208 Computers in Engineering

Fundamentals of Programming

Expressions & Assignment Statements

Fundamental of Programming (C)

Information Science 1

Muntaser Abulafi Yacoub Sabatin Omar Qaraeen. C Data Types

Representing and Manipulating Integers. Jo, Heeseung

Introduction to C Programming (Part A) Copyright 2008 W. W. Norton & Company. All rights Reserved

Expressions and Assignment Statements

Type Conversion. and. Statements

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

CSE101-lec#12. Designing Structured Programs Introduction to Functions. Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU

Chapter 7. Expressions and Assignment Statements ISBN

Computers Programming Course 5. Iulian Năstac

Chapter 7. Expressions and Assignment Statements

Programming and Data Structures

3. EXPRESSIONS. It is a sequence of operands and operators that reduce to a single value.

BSM540 Basics of C Language

Operators and Expressions:

Chapter 7 Expressions and Assignment statements

Arithmetic and Bitwise Operations on Binary Data

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line

Fundamentals of Programming Session 8

Princeton University Computer Science 217: Introduction to Programming Systems The Design of C

(13-2) Dynamic Data Structures I H&K Chapter 13. Instructor - Andrew S. O Fallon CptS 121 (November 17, 2017) Washington State University

C Refresher, Advance C, Coding Standard, Misra C Compliance & Real-time Programming

Goals of C "" The Goals of C (cont.) "" Goals of this Lecture"" The Design of C: A Rational Reconstruction"

C-LANGUAGE CURRICULAM

LESSON 5 FUNDAMENTAL DATA TYPES. char short int long unsigned char unsigned short unsigned unsigned long

Tokens, Expressions and Control Structures

UNIT- 3 Introduction to C++

Fixed-Point Math and Other Optimizations

Internal representation. Bitwise operators

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Data Conversion & Scanner Class

Internal representation. Bitwise operators

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

CSE 452: Programming Languages. Outline of Today s Lecture. Expressions. Expressions and Control Flow

6.096 Introduction to C++ January (IAP) 2009

Dalhousie University CSCI 2132 Software Development Winter 2018 Midterm Examination II March 12 15:37-16:24

Fundamentals of Programming

INTRODUCTION TO C++ C FORMATTED INPUT/OUTPUT. Dept. of Electronic Engineering, NCHU. Original slides are from

Floating-point lab deadline moved until Wednesday Today: characters, strings, scanf Characters, strings, scanf questions clicker questions

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

More File Operations. Lecture 17 COP 3014 Spring april 18, 2018

Physics 2660: Fundamentals of Scientific Computing. Lecture 3 Instructor: Prof. Chris Neu

CSCI 2132 Software Development Lecture 35: Dynamically Allocated Arrays, Course Review

by Pearson Education, Inc. All Rights Reserved. 2

Structured programming. Exercises 3

CSCI 2132 Software Development. Lecture 29: Dynamic Memory Allocation

Fundamental of Programming (C)

LECTURE 3 C++ Basics Part 2

Data Types, Variables and Arrays. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

MODULE 3: Arrays, Functions and Strings

CS 33. Data Representation, Part 2. CS33 Intro to Computer Systems VIII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

A Fast Review of C Essentials Part I

Declaration. Fundamental Data Types. Modifying the Basic Types. Basic Data Types. All variables must be declared before being used.

CS110: PROGRAMMING LANGUAGE I

Transcription:

CSCI 2132 Software Development Lecture 14: Software Development Life Cycle Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 5-Oct-2018 (14) CSCI 2132 1

Previous Lecture (Fire Alarm) Integer and floating-point representation Character types 5-Oct-2018 (14) CSCI 2132 2

Reading Characters scanf can be used to read a character, but it does not ignore white space For example, the following statements are not equivalent. (Find an input example.) scanf("%c", &ch); scanf(" %c", &ch); getchar and putchar are used for input and output at the character level; e.g.: int ch = getchar(); putchar(ch); int is used as return to detect EOF 5-Oct-2018 (14) CSCI 2132 3

#include <stdio.h> Code Example int main() { int ch; while (EOF!= (ch = getchar()) && ch!= \n ) { if ( a <= ch && ch <= z ) ch = ch - a + A ; putchar(ch); } putchar( \n ); return 0; } 5-Oct-2018 (14) CSCI 2132 4

Code Example Consider: EOF!= (ch = getchar()) && ch!= \n Are brackets necessary? 5-Oct-2018 (14) CSCI 2132 5

Type Conversions Consider the following code: float f = 3.4; Works in C (not in Java) due to implicit type conversion Implicit type conversion takes place in: operands, and assignments 5-Oct-2018 (14) CSCI 2132 6

Example with Operands Example float f; double d; int i; d = d + f; f = f + i; f is promoted to double, and i is promoted to double operands are promoted to narrowest type which will accomodate both 5-Oct-2018 (14) CSCI 2132 7

Implicit Conversion in Assignment Example: int i = 8.92; The right side is converted to the type of the left side 5-Oct-2018 (14) CSCI 2132 8

Type Casting Type Casting, or explicit type conversion Syntax: (type) expression Example float f, frac_part; frac_part = f - (int)f; What is calculated in frac_part? 5-Oct-2018 (14) CSCI 2132 9

Another Example float quotient; int dividend = 5; int divisor = 4; quotient = dividend / divisor; quotient = (float) dividend / divisor; quotient = (float) (dividend / divisor); quotient = 1.0f * dividend / divisor; What values are assigned in these four statements to quotient? 5-Oct-2018 (14) CSCI 2132 10

Type Definitions Using typedef We can define types using: typedef typename alternative_name One example: typedef int Bool; Bool flag; Particularly useful with more complex types, as we will see later 5-Oct-2018 (14) CSCI 2132 11

The sizeof Operator Size of many C types are implementation-defined sizeof operator = number of bytes required to store a type Syntax: sizeof(type) Example: sizeof(char) sizeof can also be applied to variables; e.g.: int i; printf("%d\n", sizeof(i)); 5-Oct-2018 (14) CSCI 2132 12

Software Development Life Cycle (SDLC) SDLC is a general term that describes structure imposed on the development of a software product Purpose To reduce the risk of missing the deadline To ensure product quality To prevent scope creep, etc. Many models have been proposed to describe SDLC 5-Oct-2018 (14) CSCI 2132 13

The Waterfall Model A sequential design process Requirements Analysis (Software) Design Implementation (Coding) Verification (Testing) Maintenance (Patches...) 5-Oct-2018 (14) CSCI 2132 14

Waterfall: Advantages and Disadvantages Advantages Natural and easy to understand Widely used Reinforces notion of design before coding Clear milestones Disadvantages Often not practical Clients may change requirements Designers may not be aware of implementation difficulties 5-Oct-2018 (14) CSCI 2132 15

The Rapid Prototyping Model 1. Gathering preliminary requirements 2. Fast prototyping 3. User evaluation of the prototype 4. Repeat the above steps if necessary 5. Discard the prototype and develop the software using a formal process 5-Oct-2018 (14) CSCI 2132 16

Rapid Prototyping: Advantages and Disadvantages Advantages Ensure that software product meets client s requirements Reduce time and cost if client requests changes during the process Disadvantages Adequate and appropriate user involvement may not always be possible Cost of prototype development 5-Oct-2018 (14) CSCI 2132 17

More about Models There are many other models To be studied in the Software Engineering course Choose an appropriate model depending on the particular software to be developed 5-Oct-2018 (14) CSCI 2132 18