Programming Methodology Checking
Programming Methodology Checking
Introduction to Programming
The structured programming method is used to improve the clarity and quality of a software
program by using flow controls such as selection and repetition.
Top-down analysis is a way of approaching a problem. As it means the big picture of the
problem is identified first. Through an eagle-eye approach. After the problem is divided. Those
problems are divided again into smaller parts which are known as subdivisions. These
subdivisions are solved and coded each by each. So finally, the whole problem will be solved.
Importantly to solve the whole problem subdivisions can be used repeatedly.
Modular Programming
In modular programming, the functionality of the program is done using smaller independent
units. these units are designated to do a specific function. Each module contains all the variables
and data relevant to the function.
Multiple programmers code separate modules, which will make the coding productive.
Further modules can be used in other projrcts also, which makes those modules reusable.
Structured Coding
Selection structures -If, If-else, Nested If-else, Ternary Operator, Switch Case
In OOP instead of deviding procedures program is seperated around objects. related variables
and functions are combined to a single unit known as an object. Object is a representation of a
item thet the program must handle.
Object is a member of a class. A class specifies the properties of an object. Object behavior is
also described by a class.
Encapsulation
Abstraction
Inheritance
Polymorphism
Selection
If Statement checks whether the condition is true or false. If the condition is true, the code will
be executed.
If-else
In If Statement if only the expression is true. But what if another set of code should run when
the expression is false. If-else is used for that.
Nested If-else
If-else statement can execute two different code segments based on whether test expression is
tru or false. But if there are more possibilities than two, the Nested If-else statement can be
used.
If the first condition is true relevant code segment will run. Else if the second condition is true
relevant code segment will run. Else if the second condition is true relevant code segment will
run. According to that Nested If-else statement will allow to check multiple expressions and
choose one.
In Nested If-else, until the condition become true the selection structure will run. This better
when it is really hard to determine the code segment that needs to run.
But among multiple options, or selections if we know what is the code we need to run exactly
at the beginning, it is better to use switch case statements. Because for this kind of requirement
switch case is proven to be the fastest option to choose.
Ternary Operator
Ternary operator is also a kind of a if-else statement. But instead of writing a lengthy code the
conditions can be checked by a single conditional statement.
But this structure more suitable and readable for short conditions.
Repetition
Instead of just executing the code only once if the statement is true, repetition structures allow
running the code block until the condition becomes false.
This is a loop. Until the condition breaks, the code block will repeat.
For
The most important part of a repetition structure is that the programmer must decide how many
times the block must repeat. This will help to stop the loop.
The programmer exactly knows how many times the code must repeat.
Or when the program is running the number of repetition times could be changed.
While
Do While
This is also a while loop. But the difference is the test expression is checked only after the code
block is executed once. If the condition is true code block will repeat again until the condition
become false.
Modularization
Modularization is a concept. That is used to break a complex program into smaller units. These
units are formed based on the procedural aspect of the program. Therefore, mostly these
modules are known as functions.
These types of functions are also known as library functions. “Library” is a file where the
keywords and syntaxes of the programming language are stored. Some most common functions
are pre-defined and stored in a library file. Such as cos(x), exp(x), sqrt(x) are already pre-
defined and stored in a library file named <cmath>.
User-Defined Functions
The user of the language, in other words, the programmer, also can define functions. These are
known as user-defined functions.
A programmer can construct a function out of the main body of the program that can be used
whenever needed like a library function.
User-defined functions can be divided into two categories based in their returning type.
Void functions and Value returning functions. This type of function does not return any data
back to the function call. Value-returning functions will return some data back to the function
call.
System Design Specifications
Pseudocode is a method of writing the algorithm using normal language. This will be helpful
for the to understand the algorithms of the system easily in order to develop the program.
main ( )
BEGIN
DISPLAY “********LOGIN**********”
“2. Signup”
INSERT choice
IF choice IS 1
IF choice IS 2
ELSE
END
Pseudocode for signup ( )
BEGIN
INSERT reguser
INSERT regpass
END
Pseudocode for Login ( )
BEGIN
INSERT user
INSERT pass
CHECK WHETHER
IF YES
END
IF NOT
END
Pseudocode mainMenu ( )
BEGIN
DISPLAY
"4. Logout"
INSERT choice
DEFAULT
END
Pseudocode viewFurniture
BEGIN
DISPLAY
"**********View Furnitures**********"
"Please select the item you want to view from below options,"
“1 Tables 4 Wardrobes
2 Chairs 5 Sofas
INSERT choice
DEFAULT
END
Pseudocode updateStore
BEGIN
DISPLAY
"Please select the item you want to add from below options,"
“1 Table 4 Wardrobe
2 Chair 5 Sofa
INSERT choice
IF choice IS 1
ELSE IF choice IS 2
ELSE IF CHOICE IS 4
ELSE IF CHOICE IS 5
ELSE IF CHOICE IS 99
ELSE
END
Pseudocode billCustomer ( )
BEGIN
INSERT cxname
INSERT cxphone;
INSERT size
START
FOR LOOP
ADD 1 TO COUNTER
INSERT invoice[i].icode
INSERT invoice[i].itype
CALCULATE
invoice[i].iTotal = invoice[i].iquantity*invoice[i].iprice
START
FOR LOOP
ADD 1 TO COUNTER
“========INVOICE=========”
ADD 1 TO COUNTER
OUTPUT
OUTPUT subtotal
END
Pseudocode void logout ( )
BEGIN
END
Pseudocode viewTables ( )
BEGIN
.........................Chairs.......................
_______________________________________________________________________
_______________________________________________________________________
WHILE input IS x
CLOSE text.file
END
Pseudocode insertData (furniture f)
DISPLAY
_______________________________________________________________________
INSERT f.icode;
DISPLAY
INSERT f.iname;
DISPLAY
INSERT f.icolor
DISPLAY
INSERT f.iqt;
DISPLAY
INSERT f.iprice;
END
Software Requirements Specification
Introduction
Supreme Furniture is a famous furniture seller in the city. The management of the company
has decided to implement a software system to manage the main processes of the company.
Purpose
The system could be able to store inventory details and view them, bill customers and print
invoices, and view company details and sales details.
Scope
Currently, the company is not automated. Therefore, the system must be a fundamental
platform. The system must be password protected, must be user-friendly, and easily
accessible. The system must have the capacity to enhance features in the future.
Requirements
Functional Requirements
Cashier
• Logout.
• View Company Details.
• Go back through the system
Non- Functional Requirements
A user of the system can log in to the Supreme Furniture Operations Management System
using his/her saved username and password.
The logout option is available on the main menu of the system. Users can walk through the
system using these options by entering the desired choice number.
The system can be used to view available furniture. Furniture can be viewed according to five
categories. Such as Tables, Chairs, Beds, Wardrobes, and Sofas.
If needed new types of items can be added to the system. There is an “update furniture”
option on the main menu.
A customer can be billed using the same system. Multiple items can be added to the customer
bill. According to that, an invoice will be printed.
Sales details are also can be viewed using the system. All the data are saved on a file text file
document.
User details, sales details, and furniture details must be protected by the system. Additionally,
the system must be able to handle a minimum of 100 users at a time. And a cloud database is
much needed for the system to cater to company expansions.
Implementation of the Proposed Solution
#include <iostream>
#include <istream>
#include <fstream>
#include <string.h>
#include <string>
#include <iomanip>
Test Plan of the System
Test Case ID 01
6 Screenshot
7 Conclusio
n
Test Case ID 02
1 Signup
2 A new username and password can be saved
3 Username = “reguser”
Password = “regpass”
4 Registration is Successful
Please 'enter' to login
Login function
5
6
7