Download - 259201 Computer Programming for Engineers Week 7 Basic Programming.

Transcript

259201 Computer Programming for Engineers

Week 7

Basic Programming

Outline

• Introduction to Software Engineering– Software development life cycle (SDLC)– SDLC VS 259201

• A programming assignment, involving:– Variable declaration (int and string)– if-else-elseif– for-while

Crisis in Software Industry

• Needs for competitive software are increasing rapidly at the moment– More functionalities– Better performance– Higher expectation– Needs of innovative ideas– Needs of competent programmers– Smaller world– Etc.

Introduction to Software Engineering

• Software engineering is a systematic approach to the engineering of software.

• Software engineering involves development, management and other issues on the engineering of software.

• The process of software development is called Software Development Life Cycle (SDLC).

Basic SDLC

Requirement

Analysis

Design

Development

Testing

What we do in 259201

SDLC vs 259201

Requirement

Analysis

Design

Development

Testing

Understanding

questions &

assignments

Algorithm

development &

Flowcharts

Programming

Debugging

Question #1

• A grading system– This grading system is based on criterion

referenced evaluation– The criteria are as follows:

• 80-100 → A• 70-79 → B• 60-69 → C• 50-59 → D• 0-49 → F

Question #1-1

• Develop the grading system which:– Run for 5 rounds– Accept one input [score] per round

Question #1-1 Concept OutputPlease enter your score: 75Your grade is B

Please enter your score: 43Your grade is F

Please enter your score: 66Your grade is C

Please enter your score: 71Your grade is B

Please enter your score: 49Your grade is F

Question #1-2

• Develop the grading system which:– Run for n rounds– Accept one input [round]– Accept one input [score] per round

Question #1-2 Concept Output

Please input the number of students: 3

Please enter your score: 75

Your grade is B

Please enter your score: 43

Your grade is F

Please enter your score: 66

Your grade is C

Question #1-3

• Develop the grading system which:– Run forever unless told to stop– Accept one input [score] per round– Accept one input [continue or not] per round

Question #1-3 Concept Output

Please enter your score: 75Your grade is BWould you like to continue? (y/n): y

Please enter your score: 43Your grade is FWould you like to continue? (y/n): y

Please enter your score: 66Your grade is CWould you like to continue? (y/n): n

Assignment

• Develop the grading system which:– Run forever unless 999 is input as a score– Accept one input [score] per round– Count and display the total of each grade– Calculate and display the average score– Calculate and display the average GPA of the

class

Assignment Concept OutputPlease enter your score: 75Your grade is B

Please enter your score: 43Your grade is F

Please enter your score: 999Program end. Calculating the scores…

Total students with A: 0Total students with B: 1Total students with C: 0Total students with D: 0Total students with F: 1Average student score: 59Average student GPA: 1.5