Professional Documents
Culture Documents
Estimation Techniques
(Report file)
Submitted to : Ms Ritu
Submitted by:
Ratika Goel
049-cse-07
0592082707
Abstract
Medical 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) //
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) //
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) //
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 ) //
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');
}
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)//
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);
}
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:
N=N1+N2
Here,
N1: total occurrence of operators
N2: total occurrence of operands
n= n1 + n2
Here,
n1: no of unique of operators
n2: no of unique operands
Operators and it’s occurrences
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.
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.