Uploaded by ayelefitsum824

sssssssssssssssssssssssssssssssssssssssssss

advertisement
Chapter 4
SYSTEM DESIGN
4.1 Introduction
System design is a process through which requirements are translated into a
representation of software. Initially the representation depicts a holistic view of
software.
Subsequent refinement leads to a design representation that is very close to source c
ode. Design
is a place where quality fostered in software development. Design provides
us with
representation of software that can be assessed for quality; this is the only way
that can
accurately translate the customer requirements into finished software
product or system. System
design serves as the foundation for all software engineering and software maintenance
steps that
follow.
We look the design process from three distinct perspectives:
 Conceptual Design
 Logical Design
 Physical Design
The higher view is the conceptual view, followed by the logical view and finally
the physical view. In designing an application, we generally begin and end each phase in a
sequentially order, although they may overlap one another along the way
.
Conceptual Design:
Conceptual Design is the process of acquiring and
evaluating, documenting
and
then validating what the user envisions to be the business
relation. It
identifies the user and
business requirements of the applicati
on and leads to a business solution as seen by the user.
STUDENT MANAGEMENT SYSTEM
KRISHNA’S PRAGATI INSTITUTE OF TECHNOLOGY
9
All applications are built to solve business problems, and it is important to pay
close
attention to principle that the business need drives applicatio
n
development. At
any point in
the design
process, the
current state of the design should be directly traceable to a business
problem and requirements.
To achieve this conceptual design is driven by developing usage scenarios. These
scenarios are a direct representation of the user’s view of the solution to a specific business
problem. A conceptual view places the emphasize on solving a business
problem and deriving a
solution that corresponds to the needs and requirements of the users.
It is based on deriving the
behavior of the solution with a primary emphasizes on the user. Beginning with a emphasis on
the activities of the business rather than
aspects of software development, underscores the fact
that systems exists to serve the business. A strong focus on the user in the beginning of the
project will help in maintaining a proper perspective throughput the development lifecycle.The
conceptual d
esign results in the first description of what the system does to
solve the business
problem articulated in the vision/scope document.
Logical Design
Logical Design derives business objects and their related services directly from
these usage scenarios. The logical view of the solution provides a basis for evaluating different
physical options. It also formalizes the solution for the project team.
The idea of the application is that the system first emerges i
n logical design.Its
boundaries and business objects and it contains the system definition. Logical design specifies
the interfaces between the system and external entities,such as users and other systems. Within a
system there may be a number of sub
syste
ms, and these boundaries are also specified.
Logical System Design consists of the following steps:

Input/Output Specifications

File Specifications

Processing Specifications
Logical design should be technologically independent as possible, inorder
to separate
system behavior issues from system implementation issues. Implementation constraints should
STUDENT MANAGEMENT SYSTEM
KRISHNA’S PRAGATI INSTITUTE OF TECHNOLOGY
10
only be considered only after the project team verifies that the essential behavior has been
incorporated onto a logical design. This approach does not
establish a technical direction until
the system is well understood and documented.
Physical Design
The purpose of Physical Design is to translate the logical design into a solution
that can be implemented effectively, according t
o performance, administration and development
process requirements. This physical view should correctly implement the desired system
behavior while meeting the constraints imposed by the technology.
In Physical Design, the perspe
ctive shifts from an abstraction of system
behavior to an implementation of the behavior. Whereas the logical design is largely technology
independent, physical design is necessarily tied to chosen set of technologies, these being the
hardware and software
on which the application will run.
The aim of physical design is to specify how to build portioned applications
from software components. The interaction of these components through defined interfaces
results in the desired beha
vior of the system as a whole. The rules for communicating between
components are defined by interaction standards: what a component does and how it
communicates are major considerations in physical design.
Physical design consists of the following steps:
1. Design the physical media

Specify input/output media.

Design the database and specify backup procedures.

Design physical information flow through the system.
2. Plan the system implementation

Prepare a conversion schedule target date.

Determine
training procedure, courses and timetable.
// Function to add the student into the database
void add_student()
{
printf("Add the Students Details\n");
printf("-------------------------\n");
printf("Enter the first name of student\n");
// First name of the student
st[i].fname = "Rahul";
printf("Enter the last name of student\n");
// Last name of the student
st[i].lname = "Kumar";
printf("Enter the Roll Number\n");
// Roll Number of the student
st[i].roll = 1;
printf("Enter the CGPA you obtained\n");
// CGPA of the student
st[i].cgpa = 8;
printf("Enter the course ID"
" of each course\n");
// Storing the courses every student
// is enrolled in
for (int j = 0; j < 5; j++) {
st[i].cid[j] = j;
}
i = i + 1;
}
Below is the implementation of the above approach:

C
// C program for the implementation of
// menu driven program for student
// management system
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Variable to keep track of
// number of students
int i = 0;
// Structure to store the student
struct sinfo {
char fname[50];
char lname[50];
int roll;
float cgpa;
int cid[10];
} st[55];
// Function to add the student
void add_student()
{
printf("Add the Students Details\n");
printf("-------------------------\n");
printf("Enter the first "
"name of student\n");
scanf("%s", st[i].fname);
printf("Enter the last name"
" of student\n");
scanf("%s", st[i].lname);
printf("Enter the Roll Number\n");
scanf("%d", &st[i].roll);
printf("Enter the CGPA "
"you obtained\n");
scanf("%f", &st[i].cgpa);
printf("Enter the course ID"
" of each course\n");
for (int j = 0; j < 5; j++) {
scanf("%d", &st[i].cid[j]);
}
i = i + 1;
}
// Function to find the student
// by the roll number
void find_rl()
{
int x;
printf("Enter the Roll Number"
" of the student\n");
scanf("%d", &x);
for (int j = 1; j <= i; j++) {
if (x == st[i].roll) {
printf(
"The Students Details are\n");
printf(
"The First name is %s\n",
st[i].fname);
printf(
"The Last name is %s\n",
st[i].lname);
printf(
"The CGPA is %f\n",
st[i].cgpa);
printf(
"Enter the course ID"
" of each course\n");
}
for (int j = 0; j < 5; j++) {
printf(
"The course ID are %d\n",
st[i].cid[j]);
}
break;
}
}
// Function to find the student
// by the first name
void find_fn()
{
char a[50];
printf("Enter the First Name"
" of the student\n");
scanf("%s", a);
int c = 0;
for (int j = 1; j <= i; j++) {
if (!strcmp(st[j].fname, a)) {
printf(
"The Students Details are\n");
printf(
"The First name is %s\n",
st[i].fname);
printf(
"The Last name is %s\n",
st[i].lname);
printf(
"The Roll Number is %d\n ",
st[i].roll);
printf(
"The CGPA is %f\n",
st[i].cgpa);
printf(
"Enter the course ID of each course\n");
for (int j = 0; j < 5; j++) {
printf(
"The course ID are %d\n",
st[i].cid[j]);
}
c = 1;
}
else
printf(
"The First Name not Found\n");
}
}
// Function to find
// the students enrolled
// in a particular course
void find_c()
{
int id;
printf("Enter the course ID \n");
scanf("%d", &id);
int c = 0;
for (int j = 1; j <= i; j++) {
for (int d = 0; d < 5; d++) {
if (id == st[j].cid[d]) {
printf(
"The Students Details are\n");
printf(
"The First name is %s\n",
st[i].fname);
printf(
"The Last name is %s\n",
st[i].lname);
printf(
"The Roll Number is %d\n ",
st[i].roll);
printf(
"The CGPA is %f\n",
st[i].cgpa);
c = 1;
break;
}
else
printf(
"The First Name not Found\n");
}
}
}
// Function to print the total
// number of students
void tot_s()
{
printf("The total number of"
" Student is %d\n",
i);
printf("\n you can have a "
"max of 50 students\n");
printf("you can have %d "
"more students\n",
50 - i);
}
// Function to delete a student
// by the roll number
void del_s()
{
int a;
printf("Enter the Roll Number"
" which you want "
"to delete\n");
scanf("%d", &a);
for (int j = 1; j <= i; j++) {
if (a == st[j].roll) {
for (int k = j; k < 49; k++)
st[k] = st[k + 1];
i--;
}
}
printf("The Roll Number"
" is removed Successfully\n");
}
// Function to update a students data
void up_s()
{
printf("Enter the roll number"
" to update the entry : ");
long int x;
scanf("%ld", &x);
for (int j = 0; j < i; j++) {
if (st[j].roll == x) {
printf("1. first name\n"
"2. last name\n"
"3. roll no.\n"
"4. CGPA\n"
"5. courses\n");
int z;
scanf("%d", &z);
switch (z) {
case 1:
printf("Enter the new "
"first name : \n");
scanf("%s", st[j].fname);
break;
case 2:
printf("Enter the new "
"last name : \n");
scanf("%s", st[j].lname);
break;
case 3:
printf("Enter the new "
"roll number : \n");
scanf("%d", &st[j].roll);
break;
case 4:
printf("Enter the new CGPA : \n");
scanf("%f", &st[j].cgpa);
break;
case 5:
printf("Enter the new courses \n");
scanf(
"%d%d%d%d%d", &st[j].cid[0],
&st[j].cid[1], &st[j].cid[2],
&st[j].cid[3], &st[j].cid[4]);
break;
}
printf("UPDATED SUCCESSFULLY.\n");
}
}
}
// Driver code
void main()
{
int choice, count;
while (i = 1) {
printf("The Task that you "
"want to perform\n");
printf("1. Add the Student Details\n");
printf("2. Find the Student "
"Details by Roll Number\n");
printf("3. Find the Student "
"Details by First Name\n");
printf("4. Find the Student "
"Details by Course Id\n");
printf("5. Find the Total number"
" of Students\n");
printf("6. Delete the Students Details"
" by Roll Number\n");
printf("7. Update the Students Details"
" by Roll Number\n");
printf("8. To Exit\n");
printf("Enter your choice to "
"find the task\n");
scanf("%d", &choice);
switch (choice) {
case 1:
add_student();
break;
case 2:
find_rl();
break;
case 3:
find_fn();
break;
case 4:
find_c();
break;
case 5:
tot_s();
break;
case 6:
del_s();
break;
case 7:
up_s();
break;
case 8:
exit(0);
break;
}
}
}
Download