You are on page 1of 21

Requirements and

Estimation Techniques
(Report file)
Submitted to : Ms Ritu

Submitted by:
Ratika Goel
049-cse-07
0592082707
Abstract
Medical store

In this project, I have implemented a medical store managment


system using C++ language which provides a medical store owner to
keep tracks of medicines present in his/her store.

The store owner can add, delete, modify records in the file. He/she
can alse search a particular record on the basis of medicine name, thus
it will give the complete information of that medicine which includes
the batch no,name,category,sales price and purchase price.
To modify a particular record user has to enter the batch no of that
medicine and then the modified name,category,sales price and
purchase price of that item.
It is provides a user friendly interface to perform all the basic
operations required for a medical store thus helps in maintaining the
records with ease.
Source Code
// medical store

#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<stdio.h>
#include<iostream.h>
#include<process.h>
#include<io.h>
#include<dos.h>
#include<string.h>

struct medical
{
int bn,ss,pp;
char mn[20], cat[20];
};
medical s;
void search(medical *s);
void save(medical *s);
void circle()
{
int d,m,r,co;
d=DETECT;
initgraph(&d,&m, "l:\\bgi");
cleardevice ();
for (co=1;co<=35;co++)
{
setcolor(co);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{

setcolor(0);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{
setcolor(1);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{

setcolor(0);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{

setcolor(2);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{

setcolor(0);
circle(300,200,co*10);
delay(50);
}
for (co=1;co<=35;co++)
{

setcolor(3);
circle(300,200,co*10);
delay(50);
}
getch ();
closegraph();
}

// (FUNCTION OF ADD) //

void add(medical *s)


{

int goo = 0;
int goog = 0;
int d,m;
while(goo<1000)
{
cout<<"00101001101010110";
goo++;
}
clrscr();
system("CLS");
d=DETECT;
initgraph(&d,&m,"l:\\bgi");
cleardevice();
cout<<endl<<endl;
system("CLS");
cout<<"PROJECT EDEN";
goo = 0;
goog = 0;
setbkcolor(9);
cout<<" !!! Enter Batch No # Plz !!! ";
cin>>s->bn;
cout<<" !!! Enter Medicine Name # Plz !!! ";
cin>>s->mn;
cout<<" !!! Enter Catagory # Plz !!! ";
cin>>s->cat;
cout<<" !!! Enter Purchase Price # Plz !!! ";
cin>>s->pp;
cout<<" !!! Enter Sale Price # Plz !!! ";
cin>>s->ss;
fflush(stdin);

// (FUNCTION OF SAVE) //

void save(medical *s){

circle ();

clrscr();
FILE *f;
f=fopen("abc.txt","ab");
if(f==NULL){
cout<<" !!! File not created, Try again !!! ";
cout<<" !!! Press Any Key To Continue !!! ";
getch();
}
fwrite(s,sizeof(struct medical),1,f);
s++;
fclose(f);
gotoxy(20,10);
//blink();
cout<<" Your Product has been saved ";
getch();
}
// (FUNCTION OF READ ALL) //

void readall(medical *s){


FILE *f;
fclose(f);
clrscr();
int row=1,c,b;
f=fopen("abc.txt","rb");
if(f==NULL){
cout<<" !!! File not created, Try again !!! ";
cout<<" !!! Press Any Key to Contine !!! ";
getch();
}

b=filelength(fileno(f))/sizeof(struct medical);
gotoxy(1,24);
cout<<" !!! Total records are ===== "<<b;
while(fread(s,sizeof(struct medical),1,f)){
row++;
up:
gotoxy(1,1);
cout<<"Batch No";
gotoxy(1,row);
cout<<s->bn;
gotoxy(12,1);
cout<<"Medicine Name";
gotoxy(12,row);
cout<<s->mn;
gotoxy(30,1);
cout<<"Catagory";
gotoxy(30,row);
cout<<s->cat;

gotoxy(40,1);
cout<<"PurchasePrice";
gotoxy(45,row);
cout<<s->pp;
gotoxy(57,1);
cout<<"SalePrice";
gotoxy(60,row);
cout<<s->ss;
if (row==23)
{
gotoxy(1,25);
cout<<"Press Any Key To Next Page";
getch();
row=2;
clrscr();
goto up;
}
}
//s++;
fclose(f);
getch();

// (FUNCTION OF SEARCH ) //

void search(medical *s){


char rec[20];
int row;
char ch;
do
{

clrscr();
FILE *f;
f=fopen("abc.txt","r");
if(f==NULL)
{
cout<<" !!! Your File is not Found !!!";
cout<<" !!! Press Any Key, Back to the Code !!!";
getch();
}
cout<<"Enter Name for search ““““ ======== ";
cin>>rec;
clrscr();
gotoxy(15,12);
cout<<" !!!! Waite While Your Record is Searching !!!!";
delay(2000);
clrscr();
rewind(f);
while(fread(s,sizeof(struct medical),1,f)){
if(strcmp(s->mn,rec)==0){
row++;
gotoxy(5,2);
cout<<"BatchNo";
gotoxy(5,3);
cout<<s->bn;
gotoxy(20,2);
cout<<"MedicineName";
gotoxy(20,3);
cout<<s->mn;
gotoxy(35,2);
cout<<"Catagory";
gotoxy(35,3);
cout<<s->cat;
gotoxy(45,2);
cout<<"PurchasePrice";
gotoxy(50,3);
cout<<s->pp;
gotoxy(60,2);
cout<<"SalePrice";
gotoxy(63,3);
cout<<s->ss;
fflush(stdin);
}

fclose(f);

gotoxy(15,8);
cout<<"Do You Want to Search Again (Y/N) : ";
ch=getche();
}
while(ch=='y');
}

// (FUNCTION OF DELET ALL) //

void delall(medical *s)


{
char r[20];
clrscr();
FILE *f,*fd;
f=fopen("abc.txt","r");
fd=fopen("del.txt","wb");
if(f==NULL)
{
gotoxy(15,15);
cout<<"File is not created Becacse"<<endl;
cout<<" There is not any Record in your file";
cout<<"Press Any Key, Back To The Code";
getch();
}
cout<<"Enter name for delete";
gets(r);
if(strcmp(s->mn,r)!=0)
{
cout<<"Your Record Is Deleted";
}
/* else
{
cout<<"record not deleted";
getch();
}*/
fflush(stdin);
rewind(f);
while(fread(s,sizeof(struct medical),1,f)==1)
{
if(strcmp(s->mn,r)!=0)
fwrite(s,sizeof(medical),1,fd);
{
fclose(f);
fclose(fd);
remove("abc.txt");
rename("del.txt","abc.txt");
}
}

// (FUNCTION OF DELET ONE RECORD) //

void dele(medical *s)


{
char r[20];
char ch;
do
{
FILE *f,*fd;
clrscr();

fclose(f);
//bar3d(190,40,400,65,0,0);
gotoxy(25,4);
cout<<" Enter Your Record For Deleted ";
f=fopen("abc.txt","r");
fd=fopen("del.txt","wb");
if(f==NULL)
{
cout<<"File not found";
cout<<"Press Any Key, Back to the Code";
getch();
}
gotoxy(13,7);
cout<<" !!!### Enter name for delete ======";
gets(r);
//if(strcmp(s->mn,r)!=0)
if(!s->mn==0)
{
gotoxy(30,10);
cout<<" Record Not Found";

delay(900);

gotoxy(15,12);
cout<<"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛPress Any Key To
ContinueÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ";

}
// if (strcmp(s->mn,r)==0)
if (s->mn==0)
{
gotoxy(30,10);
cout<<" Your Record Is Delet ";

delay(900);
gotoxy(15,12);
cout<<"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛPress Any Key To
ContinueÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ";
}
rewind(f);
while(fread(s,sizeof(struct medical),1,f)==1)
{
if (strcmp(s->mn,r)!=0)
fwrite(s,sizeof(struct medical),1,fd);
}

fclose(f);
fclose(fd);
remove("abc.txt");
rename("del.txt","abc.txt");

gotoxy(20,15);
cout<<"Do You Want to Delete Again (Y/N) ";
ch=getche();
}
while(ch=='y');
getch();
}

//(FUNCTION OF MODIFY)//

void modify(medical *s)


{
int mname,counter;
FILE *f,*fd;
clrscr();
gotoxy(25,4);
cout<<"Modify Record" ;
gotoxy(13,7);
cout<<" ####Enter The Batch Number to modify the recod#### ";

cin>>mname;
f=fopen("abc.txt","rb");
fd=fopen("edit.txt","wb");
if(f==NULL){
cout<<"File Not Open";
cout<<"Press Any Key, Back To The Code";
getch();
}
rewind(f);
counter=0;
while(fread(s,sizeof(struct medical),1,f))
{
if(s->bn==mname){
counter++;
gotoxy(7,12);
cout<<"Enter Name plz = ";
cin>>s->mn;
gotoxy(7,14);
cout<<"Enter Batch Number plz = ";
cin>>s->bn;
gotoxy(7,16);
cout<<"Enter Catagory = ";
cin>>s->cat;

gotoxy(7,18);
cout<<"Enter Purchase Price = ";
cin>>s->pp;
fflush(stdin);
gotoxy(7,20);
cout<<"Enter Sale Price = ";
//gotoxy(7,31);
cin>>s->ss;
}

fwrite(s,sizeof(struct medical),1,fd);
}
if(counter==0)
{
gotoxy(30,10);
cout<<" Record Is Not Found ";
gotoxy(30,12);
delay(900);
cout<<" Press Any Key To Continue ";
}
else
{
clrscr ();
gotoxy(30,10);
cout<<" Record is Modifying ";
}
fclose(f);
fclose(fd);
remove("abc.txt");
rename("edit.txt","abc.txt");
delay(2000);
}
void intro()
{
int d,m,r,co;
d=DETECT;
initgraph(&d,&m,"l:\\bgi");
cleardevice();
setbkcolor(7);
rectangle(100,100,500,300);
settextstyle(7,0,5);
setcolor(1);
outtextxy(200,100,"PROJECT");
outtextxy(250,170,"OF");
outtextxy(130,230,"MEDICAL STORE");
settextstyle(1,0,1);
outtextxy(30,440,"Press Any Key, To Continue");
getch();
cleardevice();
closegraph();
}
void color(){
intro();
int d,m,r,co;
d=DETECT;
initgraph(&d,&m,"l:\\bgi");
setbkcolor(1);
setcolor(3);
outtextxy(30,440,"Press Any Key, To Main Project");
getch();
closegraph();
}
void main()
{
int n;
char y,a;
int d,m;
//clrscr ();
color();
saan:
d=DETECT;
initgraph(&d,&m,"l:\\bgi");
cleardevice();
setbkcolor(25);
setcolor(1);
settextstyle(3,0,6);
outtextxy(100,20,"MEDICAL STORE");
settextstyle(3,0,4);
gotoxy(60,2);
outtextxy(575,20, "P");
outtextxy(575,50, "R");
outtextxy(575,80, "O");
outtextxy(575,110,"J");
outtextxy(575,140,"E");
outtextxy(575,170,"C");
outtextxy(575,200,"T");
outtextxy(575,230," ");
outtextxy(575,260," ");
outtextxy(575,290,"M");
outtextxy(575,320,"E");
outtextxy(575,350,"D);
outtextxy(575,380,"I");
cout<<"\n\n\n\n\n\n\n\n";
gotoxy(15,9);
cout<<"-------------------------------";
gotoxy(17,10);
cout<<"Select Your Option Plz";
gotoxy(15,11);
cout<<"-------------------------------";
gotoxy(20,15);
cout<<"Press a for Add New Record "<<endl;
gotoxy(20,16);
cout<<"Press r for Read All Records"<<endl;
gotoxy(20,17);
cout<<"Press d for Delete One Reocrd"<<endl;
gotoxy(20,18);
cout<<"Press l for Delete All Reocrds"<<endl;
gotoxy(20,19);
cout<<"Press m for Modify Reocrd"<<endl;
gotoxy(20,20);
cout<<"Press s for Search The Reocrd"<<endl;
gotoxy(20,21);
cout<<"Press e for Exit From The Window " <<endl;
gotoxy(31,23);
cout<<"======";
gotoxy(31,25);
cout<<"======";
gotoxy(31,24);
cout<<"|";
gotoxy(36,24);
cout<<"|";
gotoxy(33,24);
cin>>a;
closegraph();
switch (a)
{
case 'a': case 'A':
add(&s);
cout<<"Do You Want to Save It (Y/N)????? ";
cin>>y;
if (y=='y'|| y=='Y'){
goto save ;
save:
save(&s);
goto saan;
}
else
goto exit;
break;
case ('r') : case ('R'):
readall(&s);
goto saan;
break;
case ('m') : case ('M'):
modify(&s);
goto saan;
break;
case ('d') : case ('D'):
dele(&s);
goto saan;
break;
case ('l') : case ('L'):
delall(&s);
goto saan;
break;
case ('s') : case ('S'):
search(&s);
goto saan;
case ('e') : case ('E'):

exit(0);
default:
cout<<"Your Press Wrong Key, Plz Press The Option keys"<<endl;
clrscr ();
gotoxy(15,10);

cout<<"You Press Wrong Key, Plz Press The Option Keys";


delay(2000);
clrscr ();
goto saan;

}
exit(0);
getch();

}
Lines of Code (LOC):

The simplest way of problem size is lines of code. This metric is very popular
primarily
due to the fact that it is simple to use. This metric measure the number of source
instructions required to solve a problem. While counting the number of source
instructions, lines used for commenting and blank lines are ignored.

Token Count:
Operands and operator of any computer language is called tokens. Any symbol
or keyword in a program that specifies an algorithmic action is considered an
operator, while a symbol used to represent data is considered an operand.
Halstead at Purdue University developed software sciences family of measures
that survive till today. These measures are:

Program Length (N):

N=N1+N2

Here,
N1: total occurrence of operators
N2: total occurrence of operands

Program Vocabulary (n):

n= n1 + n2

Here,
n1: no of unique of operators
n2: no of unique operands
Operators and it’s occurrences

S.no Operators(n1) Occurrences(N1)


1 ; 406
2 { 48
3 Struct 10
4 int 12
5 , 231
6 char 7
7 [ 5
8 ] 5
9 } 48
10 void 13
11 ( 328
12 ) 328
13 * 84
14 DETECT 5
15 intigraph 5
16 & 19
17 “ 278
18 : 25
19 Cleardevice 5
20 for 17
21 <= 8
22 ++ 15
23 setcolor 10
24 circle 9
25 Delay 13
26 getch 15
27 Closegraph 4
28 while 9
29 << 105
30 clrscr 15
31 System 2
32 cout 89
33 == 34
34 = 76
35 Setbkcolor 4
36 Endl 14
37 cin 14
38 -> 29
39 FILE 6
40 If 18
41 fopen 9
42 NULL 6
43 fclose 11
44 Fwrite 4
45 sizeof 10
46 Gotoxy 61
47 fread 5
48 goto 10
49 Do 2
50 rewind 4
51 Strcmp 6
52 stdin 4
53 Fflush 4
54 else 3
55 Outtextxy 22
56 settextstyle 6
57 Switch 1
58 case 14
59 Break 5
60 default 1
61 gets 2
Total
Operands and its occurrences

S.no Operands(n2) No of occurrences(N2)


1 medical 22
2 bn 6
3 ss 5
4 pp 5
5 mn 13
6 cat 5
7 s 59
8 d 17
9 m 12
10 r 17
11 co 32
12 add 2
13 search 4
14 save 5
15 goo 4
16 goog 4
17 f 37
18 row 11
19 c 1
20 b 3
21 up 2
22 rec 3
23 ch 6
24 delall 2
25 fd 12
26 modify 2
27 n 9
28 y 7
29 A 4
30 dele 2
31 readall 2
Total
COCOMO II

Constructive Cost Model II (COCOMO II) is a model that allows one to


estimate the cost, effort, and schedule when planning a new software
development activity. COCOMO II is the latest major extension to the original
COCOMO (COCOMO 81) model published in 1981. It consists of three sub
models, each one offering increased fidelity the further along one is in the
project planning and design process. Listed in increasing fidelity, these sub
models are called the Applications Composition, Early Design, and Post-
architecture models.

COCOMO II can be used for the following major decision situations

 Making investment or other financial decisions involving a software


development effort
 Setting project budgets and schedules as a basis for planning and control
 Deciding on or negotiating tradeoffs among software cost, schedule,
functionality, performance or quality factors
 Making software cost and schedule risk management decisions
 Deciding which parts of a software system to develop, reuse, lease, or
purchase
 Making legacy software inventory decisions: what parts to modify, phase
out, outsource, etc
 Setting mixed investment strategies to improve organization's software
capability, via reuse, tools, process maturity, outsourcing, etc
 Deciding how to implement a process improvement strategy, such as that
provided in the SEI CMM

The original COCOMO model was first published by Dr. Barry Boehm in 1981,
and reflected the software development practices of the day. In the ensuing
decade and a half, software development techniques changed dramatically.
These changes included a move away from mainframe overnight batch
processing to desktop-based real-time turnaround; a greatly increased emphasis
on reusing existing software and building new systems using off-the-shelf
software components; and spending as much effort to design and manage the
software development process as was once spent creating the software product.

These changes and others began to make applying the original COCOMO
model problematic. The solution to the problem was to reinvent the model for
the 1990s. After several years and the combined efforts of USC-CSSE, ISR at
UC Irvine, and the COCOMO II Project Affiliate Organizations, the result is
COCOMO II, a revised cost estimation model reflecting the changes in
professional software development practice that have come about since the
1970s. This new, improved COCOMO is now ready to assist professional
software cost estimators for many years to come.

About the Nomenclature:

The original model published in 1981 went by the simple name of COCOMO.
This is an acronym derived from the first two letters of each word in the longer
phrase Constructive Cost Model. The word constructive refers to the fact that
the model helps an estimator better understand the complexities of the software
job to be done, and by its openness permits the estimator to know exactly why
the model gives the estimate it does. Not surprisingly, the new model
(composed of all three sub models) was initially given the name COCOMO 2.0.
However, after some confusion in how to designate subsequent releases of the
software implementation of the new model, the name was permanently changed
to COCOMO II. To further avoid confusion, the original COCOMO model was
also then re-designated COCOMO 81. All references to COCOMO found in
books and literature published before 1995 refer to what is now called
COCOMO 81. Most references to COCOMO published from 1995 onward refer
to what is now called COCOMO II.

If in examining a reference you are still unsure as to which model is being


discussed, there are a few obvious clues. If in the context of discussing
COCOMO these terms are used: Basic, Intermediate, or Detailed for model
names; Organic, Semidetached, or Embedded for development mode, then the
model being discussed is COCOMO 81. However, if the model names
mentioned are Application Composition, Early Design, or Post-architecture; or
if there is mention of scale factors Precedentedness (PREC), Development
Flexibility (FLEX), Architecture/Risk Resolution (RESL), Team Cohesion
(TEAM), or Process Maturity (PMAT), then the model being discussed is
COCOMO II.

You might also like