Flow Char TTTTT

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

FLOWCHART

start
K

Print “Options”

Print “Add new employee”

Print “Display Employee”

Print “Update Employee”

Print “Delete Employee”

Print “Delete All File”

Print “Employee logs”

Print “Play Employee”

Print “Enter Choice”

Read Choice

Switch Choice

Case 1
Input
Break

Case2

displayall

Break

Case 3
DeleteFIle

Break

Case4

InputRecord
Break

Case 5

Pay
Employee

Break
A

While recread +
recno + newfname
+ newlname + age+
gender + newpost
+ rph

System “cls”

Totalrec++

Print “Enter first Name”

Read newfname

Print “Enter last name”

Read lname

Print “Enter Age”

Read Age

Print “Enter gender: m –


male, f – female “

Read gender

Print “Enter position

Read newpos

A
A

If
(newpos=
=”waiter”

Else if
rph=100 (newpos=
=”cashier”

Else if
rph=130
(newpos==”
frontdesk”

Else if
rph=120
(newpos==”
janitor”

A Else
rph=90 if(newpos==” A
dishwasher”

Refilename=newfname+
newlname+ “txt”

rph=80

System “cls”

ofstream
newrectable(recfilename)

recno = totalrec++;

newrec+recno+newfname+newlname+age+gen
der+newpos+rph

newrec.close

recread.close

A
A

System “pause”

Ifstream showPerson(“persons.txt”)

string fname, lname,newpos, sfname,


slname;

int age,recno, totalrec = 0;

float rph, erph;

char gender;

int input_empnum;

string fullname, recfilename;

system “cls”

Print "Personnels: "

while
(showPerson+rec
no+fname+lname
+age+gender+ne
wpos+rph

Print recno+fname+lname+age+gender+newpos+rph
showPersons.close();

B
B

Print "Employee number to log :"

Read input_empnum

ifstream showPersons2("persons.txt")

while (showPersons2
+recno + fname+
lname+ age + gender
+newpos +rph

if(recno ==
input_empnu
m)

sfname = fname

slname = lname

erph = rph

fullname = sfname+slname

if(fullname
== " "

Print "No employee


found!"

recfilename = fullname+".txt"
B
B

Print "Employee Name = "


+sfname + slname

showPersons2.close()

ofstream newrec(recfilename, ios::app)

string timein, timeout

float timeval,salary

"Enter time in (24 hr Format)


:"

Read timein

Print "Enter time out(24 hr


Format) : "

Read timeout

timeval = time_difference(timein,timeout);

salary = erph * timeval;

Cx
C

Print "time worked = " + timeval + " hrs"

Print "today's salary = " + salary

newrec + timein + timeout + timeval+salary

newrec.close()

system ("pause")
D

ifstream delperson("persons.txt")
ofstream writetemp("temPerson.txt")

string delfname, dellname


int input, age,
recno,recnew = 1

if(delpers
on.good

Print "Enter no to Print "item not


delete:" found"

Read Input
delperson.close()
writetemp.close()

D
D

delperson
+recno
+delfname+
dellname+ age

input !=
recno

int rc = recnew++

writetemp + rc + delfname +
dellname +age;
E

string decision

Print "Are you sure?[Y]es[N]o"

Read decision

if
(decision
== "y")

ofstream pers("persons.txt")
ofstream tmp("temPerson.txt")

system("cls");

Print "Successfully Deleted!"

pers.close()
tmp.close()

system("pause")
; E
E

Read get
F

ifstream
showPersons("persons.txt")

string fname, lname,newpos, sfname,


slname
int age,recno, totalrec = 0;
float rph, erph
char gender
int input_empnum
string fullname, recfilename

system ("CLS")

Print"Personnels: "

Read input_empnum

Ifstream showPerson2(“person.txt”)

While (showPerson2
+recno +fname +
lname+ agae +
gender+newpos+ rph)
F
F

if(recno ==
input_empnum)

sfname = fname

slname =lname

erph = rph

Fullname =sfname + slname

(fullname
== )

Print “ No employee
found!”

Else recfilename
= fullname +
“.txt”

Print “ Employee
Name=” +sfname
+slname

F
F

showPerson2.close

Ofstream newrec (recfilename,ios::app)

String timein,timeout

Float timeval,salary

Print “Enter time in (24hr


format)”

Read timein

Print “ Enter time out


(24hr format)”

Read timeout

Timeval = time_difference (timein,timeout)

Salary = erph * timeval

F
F

Print “timeworked =”timeval +”hrs”

Print “todaysalary =” +salary

Newrec + timein + timeout +timeval + salary

Newrec.close

System “pause”

Ifstream showPersons (“persons.txt”)

String fname,lname,newpos,sfname,slname

Int age recno,totalrec = 0

Float rph erph

Char gender

Int input_empnum

String fullname,recfilename;

G
G

System “cls”

while
(showPersons +
recno + fname +
lname + age +
gender +
newpos +rph

Print recno+ fnmae + lname


+ age + gender +newpos +
rph

totalrec++

showPersons.close

Print “ Employee number to


pay”

Read input_empnum

G
G

Ifstream showPerson2 (“persons.txt”)

while
(showPersons +
recno + fname +
lname + age +
gender +
newpos +rph

If ( recno ==
Fullname = sfname + slname
input_empnum)

Sfname = fnmae

Slname = lname

If (fullname ==)

Print “ No employee
found!”

Else recfilename
= fullname +
“txt”

G
G

Print “ Employee
Name = + sfname +
slname

showPersons2.close

Ifstream readrec ( recfilename)

String time in, time out

Float timeval,slary,totalsalary= 0
totaltimeval = 0

Float sss, phil, totaldec, sal = 0

while (readrec +
timein +timeout
+timeval + salary

sss = 0.05 * totalsalary

phil = 0.04 * totalsalary

Print “ GrossIncome + totalsalary”

Print “ this is you sss deduction “+ sss

Print “ this is you philhealth


deduction” + phil

G
G

Totaldec = sss + phil

Print “ total deduction” +


totaldec

Sal = totalsalary - totaldec

Print “ NET INCOME “ +


sal

Readrec.close

String decision

Print “DO you want pay “


+ sfname +slname +
Now? [y]es [N]o”

Read decision

G
G

If (decision ==
“Y” II decision
== “X”)

Ofstream pers (recfilename)

System “cls”

Print “Successfully Paid!”

Pers.close

System”pause”

K
Case 2
Display
all

Break

Case 3
editfile

break

Case 4

Delete
items
break

Case 5

Delete
file
break

You might also like