Introduction to Problem Solving and Programming Languages: Lecture Notes, Study Guides, Projects, Research of Programming Languages

Problem solving and introduction to programming languages

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 02/17/2022

nguyen-ly-6
nguyen-ly-6 🇻🇳

4.8

(10)

43 documents

1 / 55

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 01
INTRODUCTION TO PROBLEM SOLVING AND
PROGRAMMING LANGU AGES
TEA C H E R : D O A N TRU N G TUN G ( T U N G DT 2 7 @ F E . EDU .V N )
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37

Partial preview of the text

Download Introduction to Problem Solving and Programming Languages: Lecture Notes and more Study Guides, Projects, Research Programming Languages in PDF only on Docsity!

Lecture 01 INTRODUCTION TO PROBLEM SOLVING ANDPROGRAMMING LANGUAGES T EACHE R: DOAN T R UN G T UN G ( T UN GDT27@ FE. EDU.VN)

Objectives

Basic concepts of problem solving

Steps involved in program development

Top-down programming

Programming languages, their types, and features

PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Problem solving

It’s a creative process, it is an act of

Defining a problem  Determining the cause of the problem  Identifying, prioritizing, and selecting alternative for asolution  Implementing a solution PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Strategies for problem solving

There is no universal method for solving a given

problem

Different strategies are good for different problems

Some of the well-known strategies are

Divide and conquer  Greedy method  Dynamic programming  Backtracking  Branch and Bound PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Steps in ProgramDevelopment

The various steps involved are

Defining or Analyzing the problem  Design (Algorithm)  Coding  Documenting the program  Compiling and running the program  Testing and Debugging  Maintenance PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Analyzing or Defining theProblem

The problem is defined by doing a preliminary

investigation

Defining a problem helps us to understand

problem clearly

It is also known as Program Analysis

PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Specifying the inputrequirements

The input specification is obtained by answering

following questions

What specific values will be provided as input to theprogram?  What format will the values be?  For each input item, what is the valid range of values thatit may assume?  What restrictions are placed on the use of these values? PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Specifying the outputrequirements

The output specification is obtained by answering

the following questions

What values will be produced?  What is the format of these values?  What specific annotation, headings, or titles are requiredin the report?  What is the amount of output that will be produced? PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Activity: Find Factorial Number

Input?

Output?

Process?

PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Activity Find Factorial Number

Input

: Positive integer number

Output

: Factorial of that number

Process

: Solution technique which transforms

input to output. Factorial of a number can becalculated by the formula n!=123n PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Main elements of use-case diagram PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Activity: Draw use-casediagram

You are hired to develop FAI’s library system withfollowing description -

Admin who could

Manage books, readers (staff, lecturers, and students), etc. - Manage borrow/return books

Users (staff, lecturers, students) who could

View/search books - Reserve books - Borrow/return books

Please draw Use-case diagram for this scenario

PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Modular Design

Once the problem is defined clearly, several

design methodologies can be applied

An important approach is Top-Down program

design

It is structured design technique

It breaks up the problem into a set of sub-problems calledModules  It creates a hierarchical structure of the modules PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES

Developing a solutiontechnique: Algorithm

An algorithm is a step-by-step description of the

solution to a problem

An algorithm must be

Definite  Finite  Precise and Effective  Implementation independent (only for problem not forprogramming languages) PROBLEM SOLVING & INTRODUCTION TO PROGRAMMING LANGUAGES