Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

All about programming (Specially c, c++, VB, Java)

sir patulong nman po about turbo c programming using array
eto po ung sample output

[1] add employee
[2] delete employee
[3] view report
[4] sort employee
[5] exit
----------------------------------------------------
(add employee)
enter employee number:
enter employee name:
enter salary rate:
enter number of days work:
enter another(y/n):
----------------------------------------------------
(delete employee)
enter employee number to delete:
(else kung hindi naeexist ung employee number ipiprint nya is
"EMPLOYEE DOES NOT EXIST")
---------------------------------------------------
(view report)
epm number-emp name-days of work-income- tax -total income
1001 - jonathan- 5 -2000.00- 200.00-1800.00
550 - mark - 5 -1000.00- 100.00-900.00
TOTAL =3000.00=300.00=2700.00
(salary rate nung mark is 200)
---------------------------------------------------
(sort employee)
empoloyee number ung isosort nya una ung mababa tpos mataas
example:
eployee number
500 (then ung mga info nya)
1001 (then ung mga info nya)
--------------------------------------------------
(exit)
exit from the program
--------------------------------------------------
patulong naman po d2 as soon as posible sir
thank you in advance



e2 po sir pahelp naman po about sa delete and ung sa total plss...

# include <stdio.h>
# include <conio.h>
# include <stdlib.h>
# define s scanf
# define p printf
# define max 10
void add (void);
void del (void);
void view (void);
void sort (void);

int empnum [max];
char *empname[10] [max];
float empsal [max];
int empdw [max];


int ctr=0;
int gi,ni,wt;

main()
{
int choice;
clrscr();
p("\tPAYROLL SYSTEM");
p("\n\n MAIN MENU");
p("\n\n[1] ADD EMPLOYEE ");
p("\n[2] DELETE EMPLOYEE");
p("\n[3] VIEW REPORT");
p("\n[4] SORT EMPLOYEE");
p("\n[5] QUIT");
p("\n\n What do you want to do : ");
s("%d",&choice);

switch(choice)
{
case 1: add(); break;
case 2: del(); break;
case 3: view(); break;
case 4: sort(); break;
case 5: exit(choice==5); break;
default:
p("\n\tInvalid Choice!");
p("\n\nPress any key to continue ... ");
{
getch();
main();
}
}
getch();
return 0;
}

void add()
{
int i;
char ans;


for(i=ctr; i< max && ans !='n' && ans != 'N' ; i++)
{
clrscr();
p(" Enter Employee Number: ");
s("%d",&empnum);
ctr++;
p(" Enter Employee Name: ");
s("%s",&empname);
p(" Enter Salary Rate: ");
s("%f",&empsal);
p(" Enter No. of Day(s) Work: ");
s("%d",&empdw);
p(" Enter Another (y/n): ");
ans = getch();

empsal=empsal*empdw;
}
main();
}

void view()
{
int i,c,r;
float tax,net,gi;
clrscr();
gotoxy(22,2);
p("-----------------------------------------");
gotoxy(22,3);
p("| PAYROLL SYSTEM |");
gotoxy(22,4);
p("-----------------------------------------");


gotoxy(1,6);
p("|----------------------------------------------------------------------|");
gotoxy(1,7);
p("| Emp. No | Emp. Name | NDW | Gr. Inc. | W/Tax | Net Inc |");
gotoxy(1,8);
p("|----------------------------------------------------------------------|");




for (i=0;i<ctr;i++)
{

tax=empsal*0.10;
net=empsal-tax;
p("\n| %3d %3s %3d %.2f %.2f %.2f | ",empnum,empname,empdw,empsal,tax,net);
// p("\n|----------------------------------------------------------------------|");

} // for(c= 1;c<=i;c++)
//{
// gi=0;
// for(r=empsal;r<=empsal;r++);
// {
// gi=r+empsal;

// }
// }
p("\n| TOTAL %.2f | ", gi);
p("\n|----------------------------------------------------------------------|");

p("\n\n Press any key to return to main menu ... ");

getch();
main();
}

void del()
{
int delit,temp,i;
int ctr=max;
clrscr();

for (i=0;i<ctr;i++)
{
gotoxy(10,3);
p(" Enter Employee Number to Delete: ");
s("%d",&delit);
for(i=0;i<ctr;i++)
{
temp=empnum;

if(empnum==delit)
{
empnum=empnum[i+1];
empnum[i+1]=temp;


}
else
{
empnum=temp;

}
}
}
ctr--;
main();
}

void sort()
{
int i,j,temp;
for(j=0; j<ctr; j++)
{
for(i=0; i<ctr-1; i++)
{
if (empnum > empnum[i+1])
{
temp= empnum;
empnum=empnum[i+1];
empnum[i+1]=temp;
}
}
}
view();
}
 
Last edited:
Pahelp naman mga kuya. Ano ba syntax ng gotoxy at paano declare. Visual basic 6.
 
Code:
import java.io.*;
public class divisible{
	public static void main(String args[])throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		System.out.print("Enter a number: ");
		int input = Integer.parseInt(br.readLine());
		
		System.out.println();
		System.out.print(input + " is divisible by, ");
		for(int i = 1; i<=input; i++){
				if((input%i) == 0){
					System.out.print(i + ",");
				}
		}
		
	}
	
}


LOGIC : magloop ka ng size ng ininput mo, example nag input ka ng 5 so mag loop ka ng 5 times,
tapos mag control statement ka sa loob ng loop, a number mod to a number is equals to zero if divisible po sya, :) enjoy

click thanks if my program runs the way what you want ^_^

tnx dito.pero kulangT_T
ang magiging result po dapat pg nirun ung program ay eto
ididisplay nya ung divisibles ng 1-5
gn2 po sya pg ni run

1 is divisible by 1
2 is divisible by1,2
3 is divisble by 1,3
4 is divisble by 1,2,4
5 is divisible by 1,5

gnyan po dapat lalabas

1 lng po kse lumalabas dun sa code nyo tska po mgiinput kpa ng number dpt po nde na mgiinput number pg nirun mo labas agad yan mga yan pahelp po sir pls tnx al ot!
 
tnx dito.pero kulangT_T
ang magiging result po dapat pg nirun ung program ay eto
ididisplay nya ung divisibles ng 1-5
gn2 po sya pg ni run

1 is divisible by 1
2 is divisible by1,2
3 is divisble by 1,3
4 is divisble by 1,2,4
5 is divisible by 1,5

gnyan po dapat lalabas

1 lng po kse lumalabas dun sa code nyo tska po mgiinput kpa ng number dpt po nde na mgiinput number pg nirun mo labas agad yan mga yan pahelp po sir pls tnx al ot!

ahhh gnun na po ba agad? edi ganito lang po yan...

Code:
import java.io.*;
public class divisible{
	public static void main(String args[])throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int input = 1;
		
		System.out.println();
	do{
		System.out.print(input + " is divisible by, ");
		
		for(int i = 1; i<=input; i++){
				if((input%i) == 0){
					System.out.print(i + ",");
				}
		}
		input++;
		System.out.println();
	}while(input<6);	
		
	}
	
}


paki try ^_^
 
pano po i set ang database ng data report via code ng gumagamt ng dataenvironment.

kc po may na labas ng pop ups tapos locate database daw pero pag cnet nmn error getting rows daw....
 
sir patulong nman po about turbo c programming using array
eto po ung sample output

[1] add employee
[2] delete employee
[3] view report
[4] sort employee
[5] exit
----------------------------------------------------
(add employee)
enter employee number:
enter employee name:
enter salary rate:
enter number of days work:
enter another(y/n):
----------------------------------------------------
(delete employee)
enter employee number to delete:
(else kung hindi naeexist ung employee number ipiprint nya is
"EMPLOYEE DOES NOT EXIST")
---------------------------------------------------
(view report)
epm number-emp name-days of work-income- tax -total income
1001 - jonathan- 5 -2000.00- 200.00-1800.00
550 - mark - 5 -1000.00- 100.00-900.00
TOTAL =3000.00=300.00=2700.00
(salary rate nung mark is 200)
---------------------------------------------------
(sort employee)
empoloyee number ung isosort nya una ung mababa tpos mataas
example:
eployee number
500 (then ung mga info nya)
1001 (then ung mga info nya)
--------------------------------------------------
(exit)
exit from the program
--------------------------------------------------
patulong naman po d2 as soon as posible sir
thank you in advance
 
post your programming problems here....
tapos sample input and output...,,

i'll do my very best para po matulungan kayo

ang anyone who wants to help you're all welcome here...

welcome

:clap: :excited: :dance: :yipee: :beat:





:salute:
sir patulong nman po about turbo c programming using array
eto po ung sample output

[1] add employee
[2] delete employee
[3] view report
[4] sort employee
[5] exit
----------------------------------------------------
(add employee)
enter employee number:
enter employee name:
enter salary rate:
enter number of days work:
enter another(y/n):
----------------------------------------------------
(delete employee)
enter employee number to delete:
(else kung hindi naeexist ung employee number ipiprint nya is
"EMPLOYEE DOES NOT EXIST")
---------------------------------------------------
(view report)
epm number-emp name-days of work-income- tax -total income
1001 - jonathan- 5 -2000.00- 200.00-1800.00
550 - mark - 5 -1000.00- 100.00-900.00
TOTAL =3000.00=300.00=2700.00
(salary rate nung mark is 200)
---------------------------------------------------
(sort employee)
empoloyee number ung isosort nya una ung mababa tpos mataas
example:
eployee number
500 (then ung mga info nya)
1001 (then ung mga info nya)
--------------------------------------------------
(exit)
exit from the program
--------------------------------------------------
patulong naman po d2 as soon as posible sir
thank you in advance
 
wow pd pagawa ng payroll system ng call center...desgn po mna ng normalizatio at erd tpos ga2win sa vb6 then connect sa ms access..kng pd lng po mgpagawatnx
 
w0w.. galing naman d2...

meron po kayu Inventory System po?? plsss... neded badly

Thx ng marami!!
 
sir ano pong site merong tutorial ng pag-add ng mga data sa sql db...
un pong mga data n ilalagay q sa form ay mag-store sa db....

ur help will be much appreciated...:pray::thumbsup:
 
sir, recommend nmn po kau ng site n merong tutorial ng vb & sql connection...
ung paano mai-store sa sql ung mga input sa form ng vb.net..tenk u sir...
itll be much appreciated...
 
tulong nmn po :[
project lng nmin.. c++ program na nag-aaccept ng basic mathematical expressions po.
kunwari, input ko 1+1
mag-ouput sya ng 2.
as in 1+1 ung input...

dpat din nagaaccept ng parenthesis.
like
(1+1)*2
output
4

ganun..
help po. msdev c++

paPM n lng po sakin kung pede kasi minsan lng ako online.bka matabunan ng post. tnx,
 
try this sir. gumagana yan paki edit nlng

#include<stdio.h>
#include<conio.h>
#include<dos.h>


main() /*main program starts here ^_^*/
{
char go,choice1,choice2,exit_choice,deposit,withdraw;
int t=0,amt_deposit,amt_withdraw,x;
float pin,i_pin,balance=100000;


clrscr();
gotoxy(28,8);
printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
gotoxy(28,9);
printf("-=ATM namen=-");
gotoxy(28,10);
printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
gotoxy(31,12);
printf("Please Insert Your Card...");
gotoxy(7,15);
printf("\t ATM 1f g1: 2010-2011 Finals Project I.T.-TC");
printf("\n\t\t Presented to Ms. jane suarez");
delay(3000);
gotoxy(23,12);
printf("Card Detected. Verifying Your Card. Please Wait...");
delay(3000);


introduction: /*intro*/
clrscr();
gotoxy (28,10); printf("[1] To Enter Pin");
gotoxy (28,12); printf("[2] To Exit.");
gotoxy(26,20);
printf("Please Select An Option.");
go=getche();

switch(go)
{
case'1':
{
clrscr();
gotoxy(35,12);printf("Enter Pin:");
scanf("%f",&i_pin);
goto insert_pin;
}
{
case'2':
{
clrscr();
goto exit;
}
}
default:
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto introduction;
}


insert_pin: /*pincode*/

pin=72610;

{
if(i_pin==pin)
{
clrscr();
gotoxy(30,12);
printf("PIN accepted...");
delay(2000);
gotoxy(18,14);
printf("Accessing Your Account. Please Wait...");
delay(2000);
goto menu;
}
else
{
t=t+1;
gotoxy(23,12);
printf("Invalid PIN!Please try Again...");
gotoxy(25,14);
printf("Press any key to continue...");
}
if (t<3)
{
getch();
goto introduction;
}
else
{
clrscr();
gotoxy(17,10);
printf("You have reached the maximum of 3 pin attempts.");
printf("\n\n\t\t Your Account has been blocked for safety.");
printf("\n\n\t\t Please contact the ATM technical support team.");
printf("\n\n\t\t Via CP: 09062460929...");
delay(5000);
goto exit;
}

}

menu: /*selecting choices here ^_^*/

{
clrscr();
gotoxy(28,7);
printf("Types Of Transaction Available:");
gotoxy(28,9);
printf("[1]Cash Deposit");
gotoxy(28,11);
printf("[2]Cash Withdraw");
gotoxy(28,13);
printf("[3]Balance Inquiry");
gotoxy(28,15);
printf("[4]Exit");
gotoxy(28,17);
gotoxy(26,20);
printf("Please Select An Option.");
choice1=getche();

switch(choice1)
{
case'1':
{
menu_deposit: /*deposit*/
clrscr();
gotoxy (28,8); printf("[1] To Enter Amount of Deposit.");
gotoxy (28,10); printf("[2] To Cancel.");
gotoxy (28,15); printf("Note: You Can Only Deposit Amount \n\t\t\t\t That Is Divisible by 100.");
gotoxy (28,17); printf("Maximum of P30,000.00 per deposit.");
gotoxy(26,20);
printf("Please Select An Option...");
deposit=getche();

switch (deposit)
{
case '1':
{
clrscr();
gotoxy(34,8);
printf("Transaction: Deposit");
gotoxy(22,10);
printf("How Much Would You Like To Deposit?");
gotoxy(22,11);
printf("Enter Amount: P");
scanf("%d",&amt_deposit);
delay(1000);
gotoxy(22,12);
printf("Cash Deposit Detected. Please Wait...");
delay(1000);
gotoxy(22,13);
printf("Checking Deposit Amount. Please Wait...");
delay(3000);
if (amt_deposit<=30000)
if (amt_deposit%100==0)
{
balance=balance+amt_deposit;
delay(2000);
gotoxy(22,15);
printf("P%d.00 Is Added To Your Account...",amt_deposit);
delay(1000);
gotoxy(22,17);
printf("Press Any Key To Continue...");
getch();
goto menu;
}
if (amt_deposit>30000)
{
clrscr();
gotoxy(18,9);
printf("Please Make Your Sure That Your Deposit \n\t\t\tWas Divisible By 100 ");
printf("\n\t\t And Doesn't Exceed The Maximum Deposit \n\t\t\tThen Try Again");
printf("\n\n\t\t Press Any Key To Return...");
getch();
delay(2000);
goto menu_deposit;
}

else
{
clrscr();
gotoxy(18,9);
printf("Please Make Your Sure That Your Deposit \n\t\t\tWas Divisible By 100 ");
printf("\n\t\t And Doesn't Exceed The Maximum Deposit \n\t\t\tThen Try Again");
printf("\n\n\t\t Press Any Key To Return...");
getch();
delay(2000);
goto menu_deposit;
}
}
case '2':
{
goto menu;
}
default:
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto menu_deposit;
}}

case'2':
{
menu_withdraw: /*withdraw*/
clrscr();
gotoxy (28,10); printf("[1] To Enter Amount of Withdraw.");
gotoxy (28,11); printf("[2] To Withdraw Fast Cash (P500).");
gotoxy (28,12); printf("[3] To Cancel.");
gotoxy (28,15); printf("Note: You Can Only Withdraw Amount \n\t\t\t\t That Is Divisible by 100 \n");
printf("\t\t\tMaximum of P30,000.00 Per Withdrawal. ");

gotoxy(26,20);
printf("Please Select An Option.");
withdraw=getche();

switch (withdraw)
{
case'1':
{
clrscr();
gotoxy(34,8);
printf("Transaction: Withdraw");
gotoxy(22,11);
printf("How Much Would You Like To Withdraw?");
gotoxy(22,12);
printf("amount:P");
scanf("%d",&amt_withdraw);

if(amt_withdraw>balance)
{
delay(2000);
gotoxy(22,15);
printf("Sorry,You Don't Have Enough Balance In Your Account...");
getch();
goto menu_withdraw;
}
else if(amt_withdraw>30000)
{
delay(2000);
gotoxy(22,15);
printf("Withdrawal Beyond P30000.00 is not allowed.");
getch();
goto menu_withdraw;
}
if (amt_withdraw<100)
{
clrscr();
gotoxy (20,10);
printf("Make Sure That You Withdraw At Minimum of P100.00");
gotoxy (20,12);
printf("Make Sure That You Withdraw At The Maximum of P30000.00");
getch();
goto menu_withdraw;
}
if (amt_withdraw%100!=0)
{
clrscr();
gotoxy (20,10);
printf("Please Make Sure That Your Withdraw\n\t\t\t Amount Is Divisible by 100.");
getch();
goto menu_withdraw;
}
else

balance=balance-amt_withdraw;
gotoxy(22,13);
printf("Transaction in Process, Please Wait...");
delay(3000);
gotoxy(22,15);
printf("Get Your Cash And Transaction Receipt...");
delay(2000);
gotoxy(22,17);
printf("Pess Any Key To Go to Menu...");
getch();
goto menu;
}
case '2':
{
clrscr();
if(balance>500)
{
balance=balance-500;
gotoxy(22,9);
printf("Transaction In Progress...");
delay(1000);
gotoxy(22,11);
printf("Get Your Cash And Transaction Receipt.");
gotoxy(22,15);
printf("Pess Any Key To Go to Menu...");
getch();
goto menu;
}
else
{
delay(1000);
gotoxy(22,12);
printf("Sorry,You Don't Have Enough Balance in Your Account...");
getch();
goto menu_withdraw;
}
}

case '3':
{
goto menu;
}
default:
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto menu_withdraw;

}
case'3':
{ /*balance check*/
clrscr();
gotoxy(28,8);
printf("Transaction: Balance Inquiry");
gotoxy(22,11);
printf("Transaction in progress...");
delay(1000);
gotoxy(22,13);
printf("Your Account Balance:P%.2f",balance);
gotoxy(22,16);
printf("Press Any Key to Continue...");
getch();
goto menu;
}
case'4': /*extended menu*/
{
exit_menu: /*exit menu*/
clrscr();
gotoxy(28,8);
printf("Want Another Transaction?");
gotoxy(28,11);
printf("[1] Go Back to Menu.");
gotoxy(28,14);
printf("[2] Exit.");
choice2=getch();
switch(choice2)
{
case '1':
{
goto menu;
}
case '2':
{
exit_final:
clrscr();
gotoxy(28,10);
printf("Are You Sure?");
gotoxy(30,11);
printf("[1] Yes.");
gotoxy(30,12);
printf("[2] No. Return to Menu.");
exit_choice=getche();
switch(exit_choice)
{
case'1':
{clrscr();
gotoxy(25,14);
printf("Securing Your Account...");
delay(3000);
goto exit;
}
case'2':
{
goto menu;
}
default:
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto exit_menu;
}
}
}
{
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto exit_menu;
}
}
default:
gotoxy(16,20);
printf("Sorry, But You Have Entered An Invalid Choice!");
gotoxy(30,21);
printf("Please Try Again...");
getch();
goto menu;
}
}

exit:
clrscr();
gotoxy(28,8); printf("Thank You For Banking With Us...");
delay(2000); gotoxy(28,11); printf("Please Don't Forget Your Card...");
delay(2000);gotoxy(28,14); printf("Truly Yours ATM naten");
delay(2000);
getch();
return(0);

}}


tnx po for this. it helps a lot.:salute:
 
tnx po for this. it helps a lot.:salute:

Kung wala ka ambisyon maging programmer ok lang yung code na binigay sayo. Pero kung may balak ka mag programmer in the future, then beware kasi yung style na yan ay matagal nang itinapon dahil walang kwenta.

"Goto Considered Harmful." Yung binigay sayong code ay example nito.
 
konting effort nmn guys please try nyo muna iprogram bago kayo mag ask and gumawa ng bagong account, wag kayong mahiya na ipakita ang tunay nyong username


--programmers

wag po natin tulungan ung mga walang effort na sumubok icode ^+^
 
guys sinu na po d2 ng JJAVA??

pa help nmn po sa animation using JApplet sa JCreator..

proj. po kc namin.

ung mga simple lng po na pinapagalaw ung mga shapes heheh thanks po ^_^
 
Boss bka pwede po magpatulong magdagdag ng codes sa program ko case study ko kasi sa monday na pass march 7,2011, payroll sytem po program ko, tatanawin ko pong malaking utang na loob maitutulong nyo :pray:
problem:
1. kelangan po nka labas ung deduction ng GSIS,PAG-IBIG,TAX,SSS at PHILHEALTH kayo nlang po magdagdag ng codes.
2. Sa Civil Status po kung married gagawing mas mababa ung TAXES at kung ilang dependents meron.

:praise::praise::praise::praise::praise::praise:

eto po ung codes ko:


#include<iostream.h>
#include<conio.h>
#include<ctype.h>
#include<stdio.h>
#define g gotoxy
#define c cout
#define n cin
#define v void
#include<string.h>

int x,j,y,ctr,pid, num;
char ans,sw,ans2;

//////////////////////////////////struct//////////////////////////////////
struct rec
{

int id[5], c,d,i;
char bday[5][10],medicare[5];
float nhw[5],ot[5],ded[5],rph[5],sss[5],tax[5];
float npay[5],gpay[5],bpay[5];
char name[5][50], sex[5][20],status[5][20],gender[5][6],a,user[10],pass[10];
};
rec mp;

v start();
v menu1();
v exit();
v msg();
v addpay();
v editpay();
v viewpay();
v deleteAll();
//v main();
//v sec();

/////////////////////////////////////security///////////////////////////////
//v sec()
//v main()
//{
//clrscr();
//cout<<"\t\tUsername:";
//gets(user);
//cout<<"\t\tPassword:";
//while((a=getch())!=0x0d)
//{
//cout<<"*";
//pass=a;
//i++;
//}
//pass='\0';

//d=strcmp(pass,"archie");
//c=strcmp(user,"archie");
//if ((c==0)&&(d==0))
//puts("\n\n\t\t\t\tWelcome!");
//else if((c==0)&&(d!=0);
//puts("\n\n\t\t\t\tYour password is wrong!");
//else if((c!=0)&&(d==0);
//puts("Your username is wrong1");
//else
//puts("\n\n\t\t\t\tYou are not Welcome her!");
//getch();

//default:start();break;
//}

//////////////////////////////////////main//////////////////////////////////
int main()
{
start();
return(0);
}

//////////////////////////////////////box////////////////////////////////////
v box(int c1,int c2,int r1,int r2)
{
int x,y;
for(x=c1;x<=c2;x++)
{
g(x,r1);c<<"Í";
g(x,r2);c<<"Í";
}
for(y=r1;y<=r2;y++)
{
g(c1,y);c<<"º";
g(c2,y);c<<"º";
}
g(c1,r1);c<<"É";
g(c2,r1);c<<"»";
g(c1,r2);c<<"È";
g(c2,r2);c<<"¼";
}
///////////////////////////////////start////////////////////////////////////
v start()
{
clrscr();
box(11,68,4,25);
box(28,52,21,23);
box(20,60,5,24);
textcolor(YELLOW);
textbackground(BLUE);
g(34,6);c<<"Mister Donut";
g(32,7);c<<"Sangitan Branch";
g(34,11);c<<"[P]=Payroll";
g(34,15);c<<"[E]=Exit";
g(30,22);c<<"Choose your choice: ";
n>>ans;
ans=toupper(ans);
switch(ans)
{
case'P':menu1();break;
case'E':exit();break;
default:msg();break;
}
}
//////////////////////////////////////msg/////////////////////////////////////
v msg()
{
clrscr();
box(22,58,9,12);
g(33,10);c<<"Invalid Input!";
g(28,11);c<<"Press any key to continue";

}
///////////////////////////////////payroll////////////////////////////////////
v menu1()
{
clrscr();
box(11,68,4,23);
box(29,48,6,8);
box(30,48,19,21);
g(35,7);c<<"Payroll";
g(32,10);c<<"[A]=Add Record";
g(32,12);c<<"[E]=Edit Record";
g(32,14);c<<"[V]=View Record";
g(32,16);c<<"[D]=Delete Record";
g(32,18);c<<"=Back to main";
g(32,20);c<<"Your choice: ";
g(46,20);n>>ans;
ans=toupper(ans);
switch(ans)
{
case'A':addpay();break;
case'E':editpay();break;
case'V':viewpay();break;
case'D':deleteAll();break;
case'B':start();break;
default:msg();break;
}start();
}

////////////////////////////////////addpay////////////////////////////////////
v addpay()
{
ans='Y';
clrscr();
box(21,57,5,9);
while(ans=='Y')
{
clrscr();
box(1,80,1,24);
g(30,3);c<<" Adding of Records ";
g(22,22);c<<" Please fill up correctly! ";
if(x==5)
{
clrscr();
box(25,50,12,16);
g(30,14);c<<"Memory is full!";ans='N';
}
else
{
g(5,7);
c<<"Employee Number: ";
n>>mp.id[x];
for(ctr=0;ctr<x;ctr++)
{
while(mp.id[ctr]==mp.id[x])
{
g(22,22);c<<"Employee's number already exist!";
g(22,22);c<<" Press any key to continue! ";
g(22,22); c<<" Please fill up correctly! ";
g(5,7);c<<"Employee Number: ";
n>>mp.id[x];
ctr--;
}
}
g(5,9);c<<"Name: ";gets(mp.name[x]);
g(5,11);c<<"Birth Day: ";gets( mp.bday[x]);
g(5,13);c<<"Gender: ";cin >> mp.gender[x];
g(5,15);c<<"Civil Status: ";n>>mp.status[x];
g(40,7);c<<"Rate per hour: ";n>>mp.rph[x];
g(40,9);c<<"Number of hours worked: ";n>>mp.nhw[x];
mp.bpay[x] = mp.nhw[x]*mp.rph[x];
g(40,11);c<<"Basic Pay: "<<mp.bpay[x];
g(40,13);c<<"Overtime : ";n>>mp.ot[x];
mp.gpay[x] = mp.bpay[x]+mp.ot[x];
g(40,15);c<<"Gross Pay: "<<mp.gpay[x];
g(40,17);mp.sss[x]=mp.bpay[x]*0.1;
mp.medicare[x]=20;
mp.tax[x]=mp.bpay[x]*0.12;
mp.ded[x]=mp.sss[x]+mp.medicare[x]+mp.tax[x];
c<<"Deduction: "<<mp.ded[x];
mp.npay[x] =mp.gpay[x]-mp.ded[x];
g(40,19);c<<"Net Pay: "<<mp.npay[x];
g(22,22);c<<" Press any key to continue!";
g(22,22);c<<" Add another record?(y/n): ";
g(52,22);n>>ans;
ans=toupper(ans);
x++;
}
}
}
///////////////////////////////////editpay///////////////////////////////////
v editpay()
{
box(29,48,6,8);
ans='Y';
clrscr();
while (ans=='Y')
{
if (x==0)
{
clrscr();
box(22,58,9,12);
g(33,10);c<<"No Current Record!";
g(28,11);c<<"Press any key to continue";
}
else
{
clrscr();
box(25,55,14,16);
g(28,15);
c<<"Enter Employee Number: ";
n>>pid;
for(j=0;j<x;j++)
{
if(pid==mp.id[j])
{
clrscr();
sw='T';
box(1,80,1,24);
g(30,3);c<<" Editing of Records ";
g(5,7);c<<"Employee Number: "<<mp.id[j];
g(22,22);c<<" Please fill up correctly! ";
g(5,9);c<<"Name: "<<mp.name[j];
g(5,11);c<<"Birth Day: "<<mp.bday[j];
g(5,13);c<<"Gender: "<<mp.gender[j];
g(5,15);c<<"Civil Status: "<<mp.status[j];
g(40,7);c<<"Rate per hour: "<<mp.rph[j];
g(40,9);c<<"Number of hours worked: "<<mp.nhw[j];
g(40,11);c<<"Basic Pay: "<<mp.bpay[j];
g(40,13);c<<"Overtime Pay: "<<mp.ot[j];
g(40,15);c<<"Gross Pay: "<<mp.gpay[j];
g(40,17);c<<"Deduction: "<<mp.ded[j];
g(40,19);c<<"Net Pay: "<<mp.npay[j];
g(22,22);c<<" Edit This Record(y/n)?: ";
n>>ans2;
ans2=toupper(ans2);
if (ans2=='Y')
{
clrscr();
box(1,80,1,24);
g(30,3);c<<" Editing of Records ";
g(5,7);c<<"Employee Number: ";c<<mp.id[j];
g(22,22);c<<" Please fill up correctly! ";
g(5,9);c<<"Name: ";
gets(mp.name[j]);
g(5,11);c<<"Birth Day: ";n >> mp.bday[j];
g(5,13);c<<"Gender: ";n >> mp.gender[j];
g(5,15);c<<"Civil Status: ";n>>mp.status[j];
g(40,7);c<<"Rate per hour: ";n>>mp.rph[j];

g(40,9);c<<"Number of hours worked: ";n>>mp.nhw[j];
mp.bpay[j] = mp.nhw[j]*mp.rph[j];
g(40,11);c<<"Basic Pay: "<<mp.bpay[j];
g(40,13);c<<"Overtime Pay: ";n>>mp.ot[j];
mp.gpay[j] = mp.bpay[j]+mp.ot[j];
g(40,15);c<<"Gross Pay: "<<mp.gpay[j];
g(40,17);c<<"Deduction: "<<mp.ded[j];
mp.npay[j] =mp.gpay[j]-mp.ded[j];
g(40,19);c<<"Net Pay: "<<mp.npay[j];
g(22,22);c<<" Press any key to continue! ";

}
break;
}
else
{
sw='F';
}
}
}
if(sw=='T')
{
clrscr();
g(22,22);c<<" Edit another record?(y/n): ";
g(52,22);n>>ans;
ans=toupper(ans);
}
if(sw=='F')
{
clrscr();
box(20,52,12,19);
box(21,51,13,18);
g(28,15);c<<"No Current Record!";
g(23,16);
ans='N';c<<"Press any key to continue";
}
}
}
//////////////////////////////////viewpay/////////////////////////////////////
v viewpay()
{
box(21,57,5,9);
if (x==0)
{
clrscr();
box(22,58,9,12);
g(33,10);c<<"No Current Record!";
g(28,11);c<<"Press any key to continue";
getch();
}

for(y=0;y<x;y++)
{
clrscr();
g(33,3);c<<" Viewing of Records ";
g(5,7);c<<"Employee Number: "<<mp.id[y];
g(5,9);c<<"Name: "<<mp.name[y];
g(5,11);c<<"Birth Day: "<<mp.bday[y];
g(5,13);c<<"Gender: "<<mp.gender[y];
g(5,15);c<<"Civil Status: "<<mp.status[y];
g(40,7);c<<"Rate per hour: "<<mp.rph[y];
g(40,9);c<<"Number of hours worked: "<<mp.nhw[y];
g(40,11);c<<"Basic Pay: "<<mp.bpay[y];
g(40,13);c<<"Overtime Pay: "<<mp.ot[y];
g(40,15);c<<"Gross Pay: "<<mp.gpay[y];
g(40,17);c<<"Deduction: "<<mp.ded[y];
g(40,19);c<<"Net Pay: "<<mp.npay[y];
g(22,22);c<<" Press any key to continue! ";
getch();

}
}

//////////////////////////////////deleteall///////////////////////////////////
v deleteAll()
{
char del;
del='Y';
clrscr();
box(1,80,1,4);
g(24,3);cout<<"Deleting All Employee's Records";
g(5,7);c<<"Employee Number: ";n>>num;
if(num==mp.id[y])
g(5,9);c<<"Name: "<<mp.name[y];
g(5,11);c<<"Birth Day: "<<mp.bday[y];
g(5,13);c<<"Gender: "<<mp.gender[y];
g(5,15);c<<"Civil Status: "<<mp.status[y];
g(40,7);c<<"Rate per hour: "<<mp.rph[y];
g(40,9);c<<"Number of hours worked: "<<mp.nhw[y];
g(40,11);c<<"Basic Pay: "<<mp.bpay[y];
g(40,13);c<<"Overtime Pay: "<<mp.ot[y];
g(40,15);c<<"Gross Pay: "<<mp.gpay[y];
g(40,17);c<<"Deduction: "<<mp.ded[y];
g(40,19);c<<"Net Pay: "<<mp.npay[y];
g(22,22);c<<" Do you want to delete the Record?[y/n] ";n>>del;
del=toupper(del);
if (del=='Y')
{clrscr();
mp.id[y]=0;
mp.name[y];
mp.bday[y]=1;
mp.gender[y];
mp.status[y];
mp.rph[y]=0;
mp.nhw[y]=0;
mp.bpay[y]=0;
mp.ot[y]=0;
mp.gpay[y]=0;
mp.ded[y]=0;
mp.npay[y]=0;
g(25,20);c<<"Record Deleted";
}
else
{
clrscr();
g(25,20);c<<"Record not delete..";
}
}

///////////////////////////////////exit/////////////////////////////////////
v exit()

{
int z;
clrscr();
box(31,47,4,6);
g(33,5);c<<"E-X-I-T-I-N-G";
g(25,8);c<<"Are you sure you want to exit?";
g(28,9);c<<"If Yes press any letter";

}



MARAMING SALAMAT PO..
 
Kung wala ka ambisyon maging programmer ok lang yung code na binigay sayo. Pero kung may balak ka mag programmer in the future, then beware kasi yung style na yan ay matagal nang itinapon dahil walang kwenta.

"Goto Considered Harmful." Yung binigay sayong code ay example nito.

medyo masakit, pero totoo yan. avoid using goto statement as much as possible.

konting effort nmn guys please try nyo muna iprogram bago kayo mag ask and gumawa ng bagong account, wag kayong mahiya na ipakita ang tunay nyong username


--programmers

wag po natin tulungan ung mga walang effort na sumubok icode ^+^

totoo rin to :thumbsup:
 
konting effort nmn guys please try nyo muna iprogram bago kayo mag ask and gumawa ng bagong account, wag kayong mahiya na ipakita ang tunay nyong username


--programmers

wag po natin tulungan ung mga walang effort na sumubok icode ^+^

totally agreed!!


Remember people, DO NOT BE A CARGO-CULT PROGRAMMER!!!!
 
Back
Top Bottom