Documente Academic
Documente Profesional
Documente Cultură
TASK 1:
Procedural Programming:
Procedural Programming Paradigm
Procedural programming mean is a programming paradigm. It
is extracted from structures are the base of all program.
Imperative programming will show us how to accomplish it.
Procedures and modularity
Modularity is the most part attractive. It is particularly in
enormous, complex projects. Its sources of info are generally
planned as contentions and the yields give return values.
Scoping: You can think sco ping is rule to protect and keeping
modular from the action of accessing the variables.
Procedures can do a simple interface and reused. It is a
convenient tool for making pieces of code written or group,
including programming libraries.
Comparison with imperative programming
Procedural programming language is also imperative
languages. It give the required computer to computer run
smoothly during instruction.
TASK 2:
2.1 Identify the program units and data and file
structures required to implement a given design:
a. Variables and data types required:
Variable: In programming, a variable is a place in memory where
you can store information. Its like a little box or bucket to put stuff
in. At any point in time, you can look up the contents of the variable
or rewrite the contents of the variable with new stuff. When you do
this, the variable itself doesnt need to change, just the contents in
the box. Each variable has a name and a type. The name is what
youll use in your program when you want to read its contents or
put new stuff in it.
( Source: The C# Players Guide)
Data type: Data types are declarations for memory locations or
variables that determine the characteristics of the data that may be
stored and the methods (operations) of processing that are permitted
involving them. The variables type indicates what kind of
information you can put in it. C has a large assortment of types that
you can use, including a variety of integer types, floating point (real
valued) types, characters and a whole lot more.
(Source: The C# Players Guide)
b. Selection structures:
switch...case: a type of selection control mechanism used to
allow the value of a variable or expression to change the control
flow of program execution via a multiway branch. (Wikipedia)
if...else: features of a programming language, which perform
different computations or actions depending on whether a
programmer-specified boolean condition evaluates to true or false.
(Wikipedia)
c. iteration constructs:
for: a control flow statement for specifying iteration, which
allows code to be executedrepeatedly. (Wikipedia)
white: a control flow statement that allows code to be
executed repeatedly based on a condition. (Wikipedia)
d. Modules and functions:
Modules : stdio.h , stdlib.h
SEARCH BOOKS
DELETE BOOKS
UPDATE BOOK
Manager
EXIT
START
F
T
Input book title
Input publisher
Input authors
END
View all book: void viewallbook(int i, int n)
START
F
i<n
T
Print information of the book
i++
END
Search book: void searchbook (char bookname, int
i, int n)
START
F
i<n
END
START
do
printf:
1. Add new book
2. View all books
3. Search books
4. Delete books
5. Update book
6. Exit
switch(choice)
T
CASE1 addnewbook(...),
count++
F
T
CASE2 Viewallbook(...)
F
T
CASE3 Searchbook(...)
F T F
Print the book to
the screen
Input bookname
again and recheck
T
CASE4 Searchbook(...)
T
F F
Delete the book
Input bookname
again and recheck
T F
CASE5 Searchbook(...)
T Delete the book
F
addnewbook(...)
Input bookname
again and recheck
END