Payroll Management System in C++
Payroll Management System in C++
PROJECT REPORT
IDENTIFICATION
Faculty: Computer Science and Electronics
Reviewed
Rating
Table of contents
1. Theme ...................................................................................................................... 3
2. Objectives ...............................................................................................................3
General Objective
.................................................................................................... 3
Specific objectives .......................................................................................... 3
3. Description of the problem ........................................................................... 3
4. Scope ...................................................................................................................4
5. Justification or proposed solution ................................................. 5
6. Theoretical Framework .................................................................................................... 6
7. Project Design .....................................................................................19
8. Coding in C++ .................................................................................... 20
Graphic Mode....................................................................................................... 20
General Code .................................................................................................. 23
9. Main program screen .......................................................... 46
10. Conclusions ........................................................................................ 47
11. Recommendations ............................................................................. 47
12. Bibliography ............................................................................................ 48
2
1. TOPIC: Payroll for the Santa María supermarket company.
2. OBJECTIVES
a. General objective
Develop a management system that allows generating a role of
Payments for the Santa María supermarket company using
the C++ language.
b. Specific objectives
Analyze each of the requirements required by the
user.
Design a global structure for the functioning of the
program, specify what each one of its should do
parts and how they will relate.
Develop and implement the necessary algorithms for the
compliance with the requirements of the user based on
what was learned in class.
3
At the Santa María supermarket company, generate a payroll.
includes a lot of paperwork and time, so the people in charge of
this procedure requests that their work be made a little easier.
While conducting certain research about the functioning of this
a greater problem has been detected in the payment role in the company
which this research topic has focused on.
4. SCOPE
Exit
4
5. JUSTIFICATION OR PROPOSAL OF SOLUTION
To carry out this project, the steps of the model will be followed.
waterfall for software development, in the same way the
necessary information about payment role management and finally
the knowledge and skills that each of us possess will be applied
we
5
THEORETICAL FRAMEWORK
Borland C++
6
scientific. Previously, the name 'C with classes' had been used. In C++, the
"C++" means "increment of C" and refers to the fact that C++ is
an extension of C.
What is an algorithm?
7
language of different programming. The algorithm is the infrastructure of
any solution, written later in any programming language.
PARTS OF AN ALGORITHM
TECHNIQUES OF REPRESENTATION
8
Thealgorithmit's finished: The algorithm that we will develop
it must necessarily have a certain set of
instructions.
The algorithm is precise: The algorithm is constituted by a
set of instructions that will be executed step by step.
The algorithm is defined: The algorithm followed two or more times
shows similar results.
Sentences
The if statement
Its syntax:
if (expression) {
sentence_1;
else /* Optional */
Switch:
switch (variable) {
case 1:
9
sequence of sentences;
break;
default:
sequence of statements;
break;
While
while (condition)
Instruction block
};
Do while
10
It is about repeating the body of the loop (group of statements),
until the condition becomes false (null value), or rather,
we are going to execute the group of statements while the condition
if true (non-null value), then, at a minimum always
we will execute the loop body at least once.
Operation block;
For loop
A for loop is an iterative control structure that allows us to
execute a block of instructions repeatedly
knowing in advance a starting value, a step size and
a final value for the cycle.
Registers in C++
11
(integer, real, character), or other data structures. To each
one of those elements is called field.
Files in C++
portable programs.
BASIC DEFINITIONS
File opening
Before writing or reading data from a file, it is necessary to open it. When opening
the file establishes communication between the program and the system
operation on how to access it. It is necessary for the program to
12
provide the operating system with the full name of the file and the
intention of use (reading or writing data), then areas are defined
communication between them.
Text files
They are those that can contain any kind of data and in such a way
so that they are "understandable" for the people. The data in a file of
text is stored using ASCII code, in which each character is
represented by a simple byte.
Binary files
This type of files store numerical data with its
binary representation. They can be files that contain instructions
in machine language ready to be executed.
Sequential files
As its name suggests, in this type of files the records are
they are recorded in sequence or consecutively and must be accessed from that
13
in the same way, that is, as new records are inserted,
these are stored at the end of the last stored record;
Direct files (relative, direct access or random access)
Unlike sequential files, in direct files it is not
it is necessary to go through it completely to access a record in
In particular, if the internal pointer of the file cannot be placed
directly in the desired register, allowing for greater
speed of access.
FUNCTIONS:
Functionfopen:
Syntax:
This function is used to open and create files on disk. The return value is a
pointer to a structureFILE.
Functionfclose:
Syntax:
14
It is important to close the open files before leaving the
fffapplication. This function serves for that.
Functionfwrite:
Syntax:
15
Figure 8. Function fseek
Functionftell:
Syntax:
The ftell function is used to find out the current position of the cursor.
reading/writing a file.
GRAPHICAL MODE
#include<graphics.h>
16
Most used functions:
rectangle (int X1, int Y1, int X2, int Y2);
Draw a rectangle without fill on the screen marked by the
points (X1, Y1) and (X2, Y2), where X1 is the leftmost edge of
rectangle, Y1 is the upper end, X2 is the right end and
Y2 the lower end of the rectangle.
• ellipse (int X, int Y, int stangle, int endangle, int xradius, int
yradius);
Draw an ellipse centered at the points X, Y. stangle and endangle
they indicate the initial and final angle of the elliptical arc to be drawn.
AVAILABLE COLORS
17
Figure 10. Colors in graphic mode
Set text size and style
To indicate the format of the text that will appear on screen during the
In graphic mode, the settextstyle function is used:
settextstyle(int font, int direction, int charsize);
Once the format of the text is indicated, we can display it on the screen.
18
outtextxy (100,200,"This is graphic mode");
7. PROJECT DESIGN
The program features a start screen, where you will be asked for the
username and password, for access to the main menu.
The main menu will display a screen that will contain the
following options:
Enter data into the registry
Consult a record
List
Modify a record
Delete a record
Show total to pay
Help and instructions of the program
Leave
The following submenu is found in the option to consult a record,
with the following options:
Consultation by ID number
Consult by last name
Inquiry by department
Back to main menu
19
8. CODING IN C++
8.1. GRAPHICAL MODE
# include<graphics.h>
#include<conio.h>
#include<dos.h>
#include<stdio.h>
#include <stdlib.h>
main()
{
20
setcolor(3);
settextstyle(7,0,2); /* Text style */
outtextxy(300,120," MEMBERS: "); /* To put text */
setcolor(15);
settextstyle(2,0,5);
LOURDES GUAMAN
settextstyle(4,0,0);
setcolor(15);
settextstyle(2,0,5);
LEIDY JUMBO
setcolor(15);
set text style(2,0,5);
ANASTASIA MININA
setcolor(1);
rectangle(25,45,605,430);
settextstyle(4,0,0);
rectangle(50,65,580,410);
setcolor(3);
settextstyle(7,0,2);
PARALLEL:
settextstyle(4,0,0);
setcolor(15);
settextstyle(2,0,5);
2° 'B' SYSTEMS
settextstyle(4,0,0);
setcolor(3);
settextstyle(7,0,2);
THEME:
settextstyle(4,0,0);
setcolor(15);
settextstyle(2,0,5);
PAYROLL
settextstyle(4,0,0);
int angles=0;
while(angles<=360)
{
setcolor(BLACK); /*Assign a color */
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+1,55); /* Arc of circles with different
dimensions */
setcolor(13);
getarccoords(&a); /* Coordinates */
circle([Link],[Link],8); /*Draws a circle*/
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+1,39);
setcolor(5);
getarccoords(&a);
circle([Link],[Link],8);
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+2,31);
setcolor(12);
21
getarccoords(&a);
circle([Link],[Link],8);
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+2,19);
setcolor(4);
getarccoords(&a);
circle([Link],[Link],8);
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+1,9);
setcolor(6);
getarccoords(&a);
circle([Link], [Link], 8);
arc(getmaxx()/4.5,getmaxy()/3.1,angles,angles+1,70);
getarccoords(&a);
setcolor(3);
circle([Link], [Link], 8);
angles = angles + 5;
delay(50);
}
int angless=0;
while(angless<=360)
{
setcolor(BLACK); /*Assigns a color */
arc(getmaxx()/4.5,getmaxy()/1.45,angless,angless+3,55); // Arc with different dimensions
setcolor(15);
getarccoords(&a); /* Coordinates */
circle([Link],[Link],4); /* Draw a circle */
arc(getmaxx()/4.5,getmaxy()/1.45,angless,angless+3,40);
setcolor(1);
getarccoords(&a);
circle([Link], [Link], 4);
arc(getmaxx()/4.5,getmaxy()/1.45,angless,angless+3,17);
setcolor(15);
getarccoords(&a);
circle([Link], [Link], 4);
arc(getmaxx()/4.5,getmaxy()/1.45,angless,angless+3,5);
setcolor(1);
getarccoords(&a);
circle([Link], [Link], 6);
settextstyle(7,0,3);
arc(getmaxx()/4.5,getmaxy()/1.45,angless,angless+3,70);
setcolor(1);
getarccoords(&a);
circle([Link],[Link],4);
angless = angless + 5;
delay(50);
}
getch(); /* Wait a moment */
closegraph(); /* Closes */
}
22
8.2. GENERAL CODE
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <conio.h>
#include <iostream.h>
#include <windows.h>
#include <fstream>
#include <iostream>
#include <string>
#include <iomanip>
#include <cstring>
#include <stdlib.h>
manager
santa maria
#define S cout<<
#define L 100
23
while (i < j && sw == 0)
{
if (isdigit(number[i]) != 0)
{
i++;
}
else
{
sw=1;
}
}
return sw;
}
return sw;
24
{
if (isalpha(linea[i])!=0)
{
i++;
}
else
{
sw=1;
}
}
else
i++;
}
return sw;
return sw;
}
struct cargo_ocupa
{
char cargo[L];
int num_hours;
};
struct record_type
{
char num_ced[L];
char name[L];
char surname[L];
char depar[L];
cargo_occupies occupation;
int c_fam;
int h_ext;
float salary;
char insurance;
25
};
Record
FILE *alias;
Line text color with windows.h that will allow writing the color in a single line
void t(int n)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), n);
}
Emulated gotoxy with windows.h that will allow you to write on the line you want without doing a
Clear Screen.
void g(int x, int y)
{
HANDLE coss = GetStdHandle(STD_OUTPUT_HANDLE);
COORD Pcoss;
Pcoss.X = x;
Pcoss.Y = y;
SetConsoleCursorPosition(coss, Pcoss);
}
if(i%2==0)
26
{
if(j<lim)
{
j++;
g(1,j); printf("%c",186);
g(78,j); printf("%c",186);
}
}
g(78,lim); printf("%c",188);
g(1,lim); printf("%c",200);
}
g(1,1); printf("%c",201);
g(78,1); printf("%c",187);
g(78,lim); printf("%c",188);
g(1,lim); printf("%c",200);
gt(28,23,3); printf(" ");
void REGISTER_EMPLOYEE(void)
{
int num_ced;
char line[L];
27
char hours[L];
bool isNumeric(string);
frame(18,62,3,5);
Limit(22);
gotoxy(23,4);
textcolor(5);
<<< PERSONAL REGISTRATION RECORDS >>>
alias=fopen("[Link]","rb+");
if(alias==NULL)
alias=fopen("[Link]","wb");
do
{
gotoxy (23,9);
cprintf(" ");
gotoxy(4,9);
textcolor(8);
printf("ID number (10 digits): "); gets(line);
} while (validate_id(line)!=0);
fread(&Record,sizeof(Record),1,alias);
while(!feof(alias))
{
if(strcmp(Registro.num_ced,linea)==0)
{
gotoxy(20,11);
textcolor(3);
Duplicate record!
gotoxy(20,12);
Press any key to continue . . .
fclose(alias);
getch();
return;
}
fread(&Record,sizeof(Record),1,alias);
strcpy(Registro.num_ced,linea);
do
{
gotoxy(13,10);cprintf(" ") ");
gotoxy(4,10); cprintf("Name (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
28
do
{
gotoxy(15,11);cprintf(" ") ");
gotoxy(4,11); cprintf("Last name (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(36,12);cprintf(" ") ");
gotoxy(4,12);cprintf("Department (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(22,13);cprintf(" ") ");
gotoxy(4,13);cprintf("Position (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(32,14);cprintf(" ") ");
gotoxy(4,14); cprintf("Daily hours (Number 1-24): ");
gets(line); [Link].num_hours = atoi(line);
}while(validate_numbers(line)!=0 || ([Link].num_hours<1 ||
[Link].hours_num > 24);
do
{
gotoxy(27,15);cprintf(" ");
gotoxy(4,15); cprintf("Extra hours (number): "); gets(linea);
}while (validate_numbers(line)!=0);
Registro.h_ext=atoi(line);
do
{
gotoxy(21,16);cprintf(" ") ");
gotoxy(4,16); cprintf("Salary (number and points): "); gets(linea);
}while(validate_salary(line)!=0);
atof(linea);
do
{
gotoxy(32,17);cprintf(" ") ");
gotoxy(4,17); cprintf("Family dependents (number): "); gets(linea);
}while(validate_numbers(line)!=0);
Registro.c_fam=atoi(line);
29
do
{
gotoxy(18,18);cprintf(" ") ");
gotoxy(4,18); cprintf("Sure (Y/N): "); gets(line);
}while(validate_insurance(line)!=0);
linea[0];
void CONSULTATION_ID(void)
{
char num_ced[L];
Limit(22);
frame(18,62,3,5);
gotoxy(28,4);
textcolor(5);
<<< QUERY BY ID >>>
alias=fopen("[Link]","rb");
if(alias==NULL)
{
g(18,8); printf("File not found!");
g(18,9); printf("Press any key to continue . . .");
getch();
return;
}
gotoxy(18,6);
textcolor(8);
printf("Number of ID to consult: ");cin >> num_ced;
fread(&Record, sizeof(Record), 1, alias);
while(!feof(alias))
{
if(strcmp(Registro.num_ced, num_ced)==0 )
{
g(3,7); ID card printf("Name");g(23,7);
printf("Last Name");g(33,7); printf("Department");g(44,7); printf("Position");g(54,7); printf("H.");
[Link] Suel CF
Print 'Seg.';
30
g(3,8);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßßßßß");
t(8);
g(3,9);cout<<Registro.num_ced;g(14,9);cout<<[Link];g(23,9);
cout<<[Link];g(33,9);cout<<[Link];g(44,9);
cout << [Link]; g(54,9); cout << [Link].num_hours;
g(59,9); cout << Registro.h_ext; g(64, 9); cout << [Link]; g(70,9);
cout<<Registro.c_fam; g(74,9); cout<<[Link];
fclose(alias);
t(3);
g(20,11); printf("Press any key to continue . . .");
getch();
return;
}
fread(&Record,sizeof(Record),1,alias);
}
fclose(alias);
g(18,8); printf("Record not found!");
g(18,9); printf("Press any key to continue . . .");
getch();
return;
}
void CONSULTA_LASTNAME(void)
{
int comparison, n;
char last_name[L];
Limit(22);
frame(18,62,3,5);
gotoxy(28,4);
textcolor(5);
<<< QUERY BY LAST NAME >>>
alias=fopen("[Link]","rb");
if(alias==NULL)
{
g(18,8); printf("File not found!");
Press any key to continue . . .
getch();
return;
}
gotoxy(18,6);
textcolor(8);
Last name to inquire:
n = strlen(last_name);
31
g(3,7); printf("Cedula");g(14,7); printf("Nombre");g(23,7); printf("Apellido");g(33,7);
Depart. Cargo H.
[Link] Suel CF Seg.
g(3,8);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßßßßß");
fread(&Record,sizeof(Record),1,alias);
int f=9;
while(!feof(alias))
{
strncmpi(lastName, [Link], n);
t(8);
if(comparacion==0)
{
g(3,f); cout << Registro.num_ced; g(14, f);
cout << [Link]; g(23, f); cout << [Link]; g(33, f);
cout << [Link];g(44, f); cout << [Link]; g(54, f);
cout << [Link].num_horas;
g(59,f); cout<<Registro.h_ext;g(64,f); cout<<[Link];g(70,f);
cout<<Registro.c_fam; g(74,f); cout<<[Link];
f++;
}
fclose(alias);
t(3);
g(3,f);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßßßßß");
g(18,20); printf("Press any key to continue . . .");
getch();
return;
}
void DEPARTMENT_QUERY(void)
{
int comparison, n;
char depar[L];
Limit(22);
frame(18,62,3,5);
gotoxy(25,4);
textcolor(5);
<<< CONSULTATION BY DEPARTMENT >>>
alias=fopen("[Link]","rb");
32
if(alias==NULL)
{
g(18,8); printf("File not found!");
g(18,9); printf("Press any key to continue . . .");
getch();
return;
}
gotoxy(18,6);
textcolor(8);
printf("Department to consult: ");cin >> depar;
n=strlen(depar);
g(3,7); Print ID card; g(14,7); printf("Name");g(23,7); print("Last Name");g(33,7);
Depart. Cargo H.
[Link] Suel CF Seg.
g(3,8);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßß");
fread(&Record,sizeof(Record),1,alias);
int f=9;
while(!feof(alias))
{
comparison = strncmpi(depar, [Link], n);
t(8);
if(comparison==0)
{
g(3,f); cout<<Registro.num_ced;g(14,f); cout<<[Link];g(23,f);
cout << [Link]; g(33, f); cout << [Link];g(44,f);
cout << [Link]; g(54,f); cout << [Link].num_hours;
g(59,f); cout<<Registro.h_ext;g(64,f); cout<<[Link];g(70,f);
cout << Registro.c_fam; g(74,f); cout << [Link];
f++;
}
fclose(alias);
t(3);
g(3,f);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßß");
Press any key to continue . . .
getch();
return;
}
33
void LISTADO(void)
{
Limit(22);
frame(18,62,3,5);
gotoxy(30,4);
textcolor(5);
<<< GENERAL LIST >>>
alias=fopen("[Link]","rb");
if(alias==NULL)
{
g(18,8); printf("File not found!");
Press any key to continue . . .
getch();
return;
}
t(8);
fclose(alias);
t(3);
g(3,f);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßß");
g(18,20); printf("Press any key to continue . . .");
34
getch();
return;
}
void MODIFICATION(void)
{
char num_ced[L];
char line[L];
char hours[L];
bool repeat = true;
bool isNumeric(string);
Limit(30);
square(18,62,3,5)
textcolor(5);
cprintf("<<< RECORDS MODIFICATION >>>");
alias=fopen("[Link]","rb+");
if(alias==NULL)
{
g(18,8); printf("File not found!");
Press any key to continue...
getch();
return;
}
gotoxy(20,9);
textcolor(8);
printf("ID number: ");cin >> num_ced;
fread(&Record,sizeof(Record),1,alias);
while(!feof(alias))
{
if(strcmp(Registro.num_ced, num_ced) == 0)
{
t(8);
g(3,9);cout<<Registro.num_ced;g(14,9);cout<<[Link];g(23,9);
cout << [Link]; g(33,9); cout << [Link]; g(44,9);
cout << [Link]; g(54,9); cout << [Link].num_hours;
35
g(59,9); cout<<Registro.h_ext;g(64,9); cout << [Link]; g(70,9);
cout<<Registro.c_fam; g(74,9); cout<<[Link];
t(3);
g(3,10);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßß");
gotoxy(4,13); textcolor(3); cprintf("Modify your record: ");
textcolor(8);
do
{
gotoxy(13,15);
cprintf(" ");
gotoxy(4,15); cprintf("Name (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(15,16);cprintf(" ");
gotoxy(4,16); cprintf("Last name (letters and spaces): "); gets([Link]);
} while (validate_letters(Record.last_name) != 0);
do
{
gotoxy(36,17);cprintf(" ") );gotoxy(4,17);
printf("Department (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(22,18);cprintf( ");
gotoxy(4,18);cprintf("Position (letters and spaces): "); gets([Link]);
} while (validate_letters([Link]) != 0);
do
{
gotoxy(32,19);cprintf(" ") ");
gotoxy(4,19); cprintf("Hours ")daily (Number 1-24): ");
gets(line); [Link].num_hours = atoi(line);
}while(validate_numbers(line)!=0 || ([Link].num_hours<1 ||
[Link].num_hours>24);
do
{
gotoxy(27,20);cprintf(" " ) ");
36
gotoxy(4,20); cprintf("Overtime (number): "); gets(linea);
} while (validate_numbers(line)!=0);
Registro.h_ext = atoi(line);
do
{
gotoxy(21,21);cprintf( ");
gotoxy(4,16); cprintf("Salary (number and points): "); gets(linea);
} while(validate_salary(line)!=0);
[Link] = atof(line);
do
{
gotoxy(32,22);cprintf(" ") ");
gotoXY(4,22); cprintf("Family burdens (number): "); gets(line);
} while(validate_numbers(line)!=0);
Registro.c_fam=atoi(line);
do
{
");
gotoxy(4,23); cprintf("Sure (Y/N): "); gets(line);
} while(validate_insurance(line)!=0);
linea[0];
37
frame(18,62,3,5);
gotoxy(28,4);
textcolor(5);
cprintf("<<< RECORD DELETION >>>");
alias=fopen("[Link]","rb");
if(alias==NULL)
{
g(18,8); printf("File not found!");
Press any key to continue . . .
getch();
return;
}
gotoxy(18,6);
textcolor(8);
printf("ID number to delete: ");cin >> n;
fread(&Record, sizeof(Record), 1, alias);
while(!feof(alias))
{
if(strcmp(Registro.num_ced, n)==0 )
{
g(3,7); Print ID card; g(14,7); printf("Name");g(23,7);
printf("Last Name");g(33,7); printf("Department");g(44,7); printf("Position");g(54,7); printf("H.");
[Link] Suel CF
print("Seg.");
g(3,8);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßß");
t(8);
g(3,9); cout<<[Link];g(14,9); cout<<[Link];g(23,9);
cout<<[Link];g(33,9); cout << [Link]; g(44,9);
cout << [Link]; g(54,9); cout << [Link].num_hours;
g(59,9); cout<<Registro.h_ext;g(64,9); cout<<[Link];g(70,9);
cout<<Registro.c_fam; g(74,9); cout<<[Link];
fclose(alias);
t(3);
do{
g(48,11);printf(" Do you want to delete this record?
gets(line);
} while (validate_insurance(line)!=0);
op=linea[0];
return;
}
fread(&Record,sizeof(Record),1,alias);
}
fclose(alias);
38
g(18,8); printf("Record not found!");
g(18,9); printf("Press any key to continue . . .");
getch();
return;
}
while(!feof(alias))
{
if(strcmp(Registro.num_ced, n) != 0)
{
fwrite(&Record, sizeof(Record), 1, temporary);
}
close all();
remove("[Link]");
rename("[Link]","[Link]");
gotoxy(34,20); textcolor(3); cprintf("Record deleted!");
gotoxy(34,21); textcolor(3); cprintf("Press any key to continue . . . ");
getch();
op=='n';
return;
}
void TOTAL_TO_PAY(void)
{
float n, load, Sum, Total, insurance=0;
Limit(22);
square(18,62,3,5);
gotoxy(30,4);
textcolor(5);
<<< PAYROLL >>>
alias=fopen("[Link]","rb");
39
if(alias==NULL)
{
g(18,8); printf("File not found!");
Press any key to continue . . .
getch();
return;
}
t(8);
n = (((([Link] / 20) / [Link].num_hours) * 0.75) * Record.h_ext);
if ([Link]<277.16)
load=10.84*Record.c_fam;
if ([Link] >= 277.17 && [Link] < 404.61)
6.65 * Registro.c_fam
if ([Link] >= 404.61)
2.10 * Registro.c_fam;
if (toupper([Link])=='S')
insurance=[Link]*0.17;
else
0
40
g(69,f); printf("%.2f",Total);printf("$");
Sum = Sum + Total;
f++;
fclose(alias);
t(3);
g(3,f);
ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
ßßßßßßßßßß");
g(18,20); printf("Press any key to continue . . .");
getch();
return;
}
void help()
{
ifstream F;
[Link]("[Link]");
string line;
getline(F,linea);
while (![Link]())
{
cout << line << endl;
getline(F,linea);
}
getch();
return ;
}
void main()
{
int op, op1, t;
char n[L];
char option='n';
char user[L + 1];
char password[L + 1];
char input = 0;
int i = 0;
char character;
int current_length;
char line[L];
do
41
{
system("cls");
frame(22,58,3,5);
box(14,66,6,21);
Limit(22);
i = 0;
character = getch();
while (i < L && character != 13)
{
if (character != 8)
{
password[i] = character;
i++;
printf('*');
}
else
{
current_length = strlen(password);
if (current_longitude > 0)
{
printf("\b \b");
password[actual_length - 1] = '\0';
i--;
}
}
character = getch();
}
password[i] = '\0';
system ("cls");
while (op!=8)
42
{
box(22,58,3,5);
frame(14,66,6,21)
Limit(22);
switch (op)
{
case 1:
system("cls");
REGISTER_EMPLOYEE();
system("cls");
break;
case 2:
op1=9 ;
while (op1!=4)
{
system("cls");
square(22,58,3,5);
frame(14,66,6,18);
Limit(22);
textcolor(11);
gotoxy(30,4); cprintf("<<< QUERY MENU >>>");
textcolor(8);
gotoxy(20,9); cprintf("<<< 1.- CONSULTATION BY ID NUMBER >>>");
gotoxy(20,10); cprintf("<<< 2.- CONSULTATION BY LAST NAME >>>");
gotoxy(20,11); cprintf("<<< 3.- CONSULTATION BY DEPARTMENT >>>");
gotoxy(20,12); cprintf("<<< 4.- RETURN TO MAIN MENU >>>");
textcolor(11);
gotoxy(34,14); cprintf("SELECT AN OPTION . . . "); gets(linea);
op1=atoi(line);
43
switch (op1)
{
case 1:
system("cls");
CHECK_ID();
system("cls");
break;
case 2:
system("cls");
CONSULT_LAST_NAME();
system("cls");
break;
case 3:
system("cls");
DEPARTMENT_QUERY();
system("cls");
break;
case 4:
system("cls");
break;
default
system("cls");
Limit(22);
g(18,8); printf("Invalid option");
g(18,9); printf("Press any key to return . . .");
getch();
system("cls");
}
}
break;
case 3:
system("cls");
LISTING();
system("cls");
break;
case 4:
system("cls");
MODIFICATION();
system("cls");
break;
case 5:
system("cls");
DELETE1(n,option);
if (toupper(option) == 'S')
DELETE2(n,option);
44
system("cls");
break;
case 6:
system("cls");
TOTAL_TO_PAY();
System("cls");
break;
case 7:
system("cls");
help();
break;
case 8:
system("cls");
Limit(22);
Until next time :)
g(18,9); printf("Press any key to close the program . . .");
break;
default
system("cls");
Limit(22);
g(18,8); printf("Invalid option");
Press any key to return . . .
getch();
system("cls");
}
}
getch();
}
45
9. MAIN SCREENS OF THE PROGRAM
46
Figure 13. Listing option screen
10. CONCLUSIONS
11. RECOMMENDATIONS
A proper analysis of each component must be done to
a good operation and take advantage of all the benefits
necessary that comes with the implemented program.
47
When running the program it must be done in a
proper way to avoid any type of error.
execute you can turn to the help that will be found in the
main menu.
12. BIBLIOGRAPHY
[Link]
The provided text is a URL and cannot be translated.
c_4493.html
[Link]
DF
Unable to translate URL content directly. Please provide text for translation.
The provided text is a URL, and there is no text to translate.
Unable to access external content.
Unable to access the specified URL.
Unable to access the content of the provided URL.
The provided text is a URL and cannot be translated.
ivos/Notes/Basic_Concepts.PDF
[Link]
48