SlideShare a Scribd company logo
Basic Scientific Programming

Design Cycle

1
Binary Systems
Data is stored in the computer in binary format.
Bit:Binary digit, smallest unit to store
0: low voltage,false, off,…
1: high voltage, true, on,…
Byte: 8-bits. Unit is used to express storage capacity.
A byte represents 28=256 (0-255)
00000000 = 0
00000001 = 1
00000010 = 2
.
.
11111111 = 255
2
Binary System
The base in the binary system is (2)
1 KiloByte = 210 = 1024 Bytes
1 MegaByte= 220 = 1,048,576 Bytes
1 GigaByte = 230 = 1,073,741,824 B
000= 0* 22 + 0* 21 + 0* 20 = 0
001= 0* 22 + 0* 21 + 1* 20 = 1
.
.
111= 1* 22 + 1* 21 + 1* 20 = 7

3
Design Cycle



We write programs to help us solve problems.
Program development process:
1) Problem Analysis and Specification.
2) Data Organization and Algorithm Design.
3) Program Coding
4) Execution and Testing.

4
Example /Step 1
Calculate the Area & Circumference of a circle of radius R=5.
* The best approach is to generalize the problem; i.e for any
value of R.
Step 1: Problem Analysis and Specification
Determine the Inputs ( Radius ).
Determine the Outputs (Area, Circumference).

5
Example /Step 2
Step 2: Data Organization and Algorithm Design.
In this step we need to know the formulas to calculate the Area
and Circumference. (A = ᴨR2 , C = 2ᴨR).
A possible algorithm
Input: radius of Circle.
Output: Area and Circumference.
Enter the value of Radius.
Calculate the Area(A) and Circumference(C).
Display A, C.

6
Example /Step 3
Step 3: write a program to implement the algorithm.
Program Circle
Implicit None
Real :: Radius, Area, Circum
Real, Parameter :: pi = 3.141593
Print *, ‘Enter the radius of the circle’
Read *, Radius
Area = pi * Radius**2
Circum= 2* pi * Radius
Print *, ‘Area=‘, Area, ‘ Circumference=‘ , Circum
End

7
Example /Step 4
Step 4: Execution and Testing
1) Compiling the code and correcting errors.
2) Executing the program, and trying different inputs to check
if the algorithm is correct.

8
Errors
Syntax Errors: Errors in the syntax of the language
Ex: Print *, ‘Area = , Area.
Logical Errors: Incorrect output(s) due to wrong algorithm
Ex: Area = pi * Radius**3
Run-time Errors: Errors that occur while running the program.
Ex: C = a/b if the user assigns the value 0 to b the a
divide by zero error well occur, which will
terminate the execution of the program. If the
user enter another value for b the program will
executer correctly.
9
Errors
Syntax Errors: Errors in the syntax of the language
Ex: Print *, ‘Area = , Area.
Logical Errors: Incorrect output(s) due to wrong algorithm
Ex: Area = pi * Radius**3
Run-time Errors: Errors that occur while running the program.
Ex: C = a/b if the user assigns the value 0 to b the a
divide by zero error well occur, which will
terminate the execution of the program. If the
user enter another value for b the program will
executer correctly.
9

More Related Content

PPTX
Binary to Decimal Conversion
PPTX
Decimal to Binary Conversion
PPTX
Octal COnversion
PPTX
Hexadecimal Conversion
PPTX
Measurements and sig figs
PPTX
Number system in Digital Electronics
PDF
Year 2 dsa c++ exercises on user defined functions
PPT
Algorithm
Binary to Decimal Conversion
Decimal to Binary Conversion
Octal COnversion
Hexadecimal Conversion
Measurements and sig figs
Number system in Digital Electronics
Year 2 dsa c++ exercises on user defined functions
Algorithm

What's hot (16)

PPT
Int 2 data representation 2010
PDF
Debugging with event replay in microservices
PPTX
Introduction to computer_lec_04_fall_2018
PDF
Python programs
PPTX
Number system
PPTX
Introduction to binary number system
PPTX
Half Adder and Full Adder
DOC
Md university cmis 102 week 4 hands on lab new
PPTX
09 binary number systems
DOC
Md university cmis 102 week 4 hands on lab new
DOCX
Algoritm practice
PPT
BINARY NUMBER SYSTEM
PPTX
Decimal number system
PPT
Half Adder & Full Adder
DOCX
electic mashinary fundamentals 5th edition Lab tasks stack
DOCX
Lesson 1 worksheet
Int 2 data representation 2010
Debugging with event replay in microservices
Introduction to computer_lec_04_fall_2018
Python programs
Number system
Introduction to binary number system
Half Adder and Full Adder
Md university cmis 102 week 4 hands on lab new
09 binary number systems
Md university cmis 102 week 4 hands on lab new
Algoritm practice
BINARY NUMBER SYSTEM
Decimal number system
Half Adder & Full Adder
electic mashinary fundamentals 5th edition Lab tasks stack
Lesson 1 worksheet
Ad

Viewers also liked (14)

PPT
Binary
PPT
binary number system
PPT
Binary Conversion
KEY
Binary number
PPTX
Number system
PDF
Math1003 1.6 - Binary Number System
PPT
basic logic gates
PPT
Numebr system
PPT
Introduction to the Binary Number System
PPTX
Number system
PPTX
Number System
PPTX
number system
PPTX
Number system
PPT
Number System
Binary
binary number system
Binary Conversion
Binary number
Number system
Math1003 1.6 - Binary Number System
basic logic gates
Numebr system
Introduction to the Binary Number System
Number system
Number System
number system
Number system
Number System
Ad

Similar to 4 design (20)

DOCX
COMP 122 Entire Course NEW
PPTX
Basic Programming concepts - Programming with C++
PPTX
Cpp Homework Help
PPT
python libsdafsdsfsdfsdsdfasdfsdsdaffds.ppt
PPTX
Bit-Manipulation for competitive programming
DOCX
EC6612 VLSI Design Lab Manual
PDF
Introduction to Problem Solving Techniques
PDF
Problem solving techniques in c language
DOCX
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
DOC
Gsp 215 Enhance teaching-snaptutorial.com
PPTX
Understanding Basic C++ Program for Arithmetic Operations.pptx
DOC
Gsp 215 Believe Possibilities / snaptutorial.com
PDF
GSP 215 Effective Communication - tutorialrank.com
DOC
Gsp 215 Enthusiastic Study / snaptutorial.com
DOC
GSP 215 Technology levels--snaptutorial.com
DOC
Gsp 215 Massive Success / snaptutorial.com
DOCX
GSP 215 Education Organization - snaptutorial.com
DOCX
Gsp 215 Effective Communication / snaptutorial.com
DOC
Gsp 215 Exceptional Education / snaptutorial.com
DOCX
PT1420 File Access and Visual Basic .docx
COMP 122 Entire Course NEW
Basic Programming concepts - Programming with C++
Cpp Homework Help
python libsdafsdsfsdfsdsdfasdfsdsdaffds.ppt
Bit-Manipulation for competitive programming
EC6612 VLSI Design Lab Manual
Introduction to Problem Solving Techniques
Problem solving techniques in c language
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Gsp 215 Enhance teaching-snaptutorial.com
Understanding Basic C++ Program for Arithmetic Operations.pptx
Gsp 215 Believe Possibilities / snaptutorial.com
GSP 215 Effective Communication - tutorialrank.com
Gsp 215 Enthusiastic Study / snaptutorial.com
GSP 215 Technology levels--snaptutorial.com
Gsp 215 Massive Success / snaptutorial.com
GSP 215 Education Organization - snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
PT1420 File Access and Visual Basic .docx

More from fyjordan9 (17)

PPT
17recursion
PPT
16 subroutine
PPT
15 functions
PPT
14 arrays
PPT
13 arrays
PPT
12 doloops
PPT
11 doloops
PPT
10 examples for if statement
PPT
9 case
PPT
8 if
PPT
7 files
PPT
6 read write
PPT
5 format
PPT
3 in out
PPT
2 int real
PPT
1 arithmetic
PDF
PHYS303
17recursion
16 subroutine
15 functions
14 arrays
13 arrays
12 doloops
11 doloops
10 examples for if statement
9 case
8 if
7 files
6 read write
5 format
3 in out
2 int real
1 arithmetic
PHYS303

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Pharma ospi slides which help in ospi learning
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
RMMM.pdf make it easy to upload and study
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Lesson notes of climatology university.
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Structure & Organelles in detailed.
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Pharma ospi slides which help in ospi learning
human mycosis Human fungal infections are called human mycosis..pptx
Computing-Curriculum for Schools in Ghana
VCE English Exam - Section C Student Revision Booklet
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
A systematic review of self-coping strategies used by university students to ...
RMMM.pdf make it easy to upload and study
Chinmaya Tiranga quiz Grand Finale.pdf
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Lesson notes of climatology university.
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Structure & Organelles in detailed.

4 design

  • 2. Binary Systems Data is stored in the computer in binary format. Bit:Binary digit, smallest unit to store 0: low voltage,false, off,… 1: high voltage, true, on,… Byte: 8-bits. Unit is used to express storage capacity. A byte represents 28=256 (0-255) 00000000 = 0 00000001 = 1 00000010 = 2 . . 11111111 = 255 2
  • 3. Binary System The base in the binary system is (2) 1 KiloByte = 210 = 1024 Bytes 1 MegaByte= 220 = 1,048,576 Bytes 1 GigaByte = 230 = 1,073,741,824 B 000= 0* 22 + 0* 21 + 0* 20 = 0 001= 0* 22 + 0* 21 + 1* 20 = 1 . . 111= 1* 22 + 1* 21 + 1* 20 = 7 3
  • 4. Design Cycle   We write programs to help us solve problems. Program development process: 1) Problem Analysis and Specification. 2) Data Organization and Algorithm Design. 3) Program Coding 4) Execution and Testing. 4
  • 5. Example /Step 1 Calculate the Area & Circumference of a circle of radius R=5. * The best approach is to generalize the problem; i.e for any value of R. Step 1: Problem Analysis and Specification Determine the Inputs ( Radius ). Determine the Outputs (Area, Circumference). 5
  • 6. Example /Step 2 Step 2: Data Organization and Algorithm Design. In this step we need to know the formulas to calculate the Area and Circumference. (A = ᴨR2 , C = 2ᴨR). A possible algorithm Input: radius of Circle. Output: Area and Circumference. Enter the value of Radius. Calculate the Area(A) and Circumference(C). Display A, C. 6
  • 7. Example /Step 3 Step 3: write a program to implement the algorithm. Program Circle Implicit None Real :: Radius, Area, Circum Real, Parameter :: pi = 3.141593 Print *, ‘Enter the radius of the circle’ Read *, Radius Area = pi * Radius**2 Circum= 2* pi * Radius Print *, ‘Area=‘, Area, ‘ Circumference=‘ , Circum End 7
  • 8. Example /Step 4 Step 4: Execution and Testing 1) Compiling the code and correcting errors. 2) Executing the program, and trying different inputs to check if the algorithm is correct. 8
  • 9. Errors Syntax Errors: Errors in the syntax of the language Ex: Print *, ‘Area = , Area. Logical Errors: Incorrect output(s) due to wrong algorithm Ex: Area = pi * Radius**3 Run-time Errors: Errors that occur while running the program. Ex: C = a/b if the user assigns the value 0 to b the a divide by zero error well occur, which will terminate the execution of the program. If the user enter another value for b the program will executer correctly. 9
  • 10. Errors Syntax Errors: Errors in the syntax of the language Ex: Print *, ‘Area = , Area. Logical Errors: Incorrect output(s) due to wrong algorithm Ex: Area = pi * Radius**3 Run-time Errors: Errors that occur while running the program. Ex: C = a/b if the user assigns the value 0 to b the a divide by zero error well occur, which will terminate the execution of the program. If the user enter another value for b the program will executer correctly. 9