473,377 Members | 1,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

can you please locate where is the error in my code?


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


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<ctype.h>
#include<process.h>
#include<dos.h>


FILE*source,*read;
void update();
void report();
void bye();
void maintenance();
void payslip();
void add();
void edit();
void menu();

FILE *fp;
char name[30],lastname[30];
char h,code,hrs,rate;
int choice;

main()
{
clrscr();
{
gotoxy(17,10);printf("WELCOME to Payroll System of");
delay(200);
}

gotoxy(6,13);printf(" ÛÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÜÛÛÛÛÛÜ ");
gotoxy(6,14);printf("ÛÛÛ ÛÛ ÛÛÛ ÛÛÛÛ ÛÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛÛÛ ÛÛ ÜÛÛÛ ÛÛÛÜ ");
gotoxy(6,15);printf("ÛÛÛÝÜÜ ÛÛ ÛÛÛ ÛÛÛÝÛÛ ÛÛÛÝÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ");
gotoxy(6,16);printf("ÛÛÛÛÛÛ ÛÛ ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛÛÛÛÛ ");
gotoxy(6,17);printf("ÛÛÛ ÛÛ ÛÛÛ ÛÛÛÛ ÛÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛÛÛ ÛÛ ÛÛÛ ÛÛÛ ");
gotoxy(6,18);printf(" ÛÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛ ÛÛ ");


// gotoxy(6,20);cprintf("");
h=getch();
gotoxy(23,21);system("pause");
while(h=='y');
main();



getch();
return 0;
}

void menu()
{
clrscr();


gotoxy(5,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(5,7);cprintf( "º EDEECA º");
gotoxy(5,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(5,9);cprintf( "º º");
gotoxy(5,10);cprintf("º [1] Report º");
gotoxy(5,11);cprintf("º º");
gotoxy(5,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(23,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(23,7);cprintf( "º EDEECA º");
gotoxy(23,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(23,9);cprintf( "º º");
gotoxy(23,10);cprintf("º [2] Pay Slip º");
gotoxy(23,11);cprintf("º º");
gotoxy(23,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(41,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(41,7);cprintf( "º EDEECA º");
gotoxy(41,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(41,9);cprintf( "º º");
gotoxy(41,10);cprintf("º [3] Update º");
gotoxy(41,11);cprintf("º º");
gotoxy(41,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(59,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(59,7);cprintf( "º EDEECA º");
gotoxy(59,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(59,9);cprintf( "º º");
gotoxy(59,10);cprintf("º [4] Maintenace º");
gotoxy(59,11);cprintf("º º");
gotoxy(59,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(32,14);cprintf("ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(32,15);cprintf("º EDEECA º");
gotoxy(32,16);cprintf("ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(32,17);cprintf("º º");
gotoxy(32,18);cprintf("º [5] Exit º");
gotoxy(32,19);cprintf("º º");
gotoxy(32,20);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");



gotoxy(29,22);cprintf("Choice: ");
scanf("%d",&choice);

switch(choice)
{
case 1:{
report();
}
case 2:{
payslip();
}
case 3:{
update();
}
//case 4:{
// maintenance();
// }
case 5:{
bye();
}

// getch();
}


void report()
{

char timein[5];
char timeout[5];
char in_hour[3];
char out_hour[3];
char in_min[3];
char out_min[3];
float gross_pay;

char *days[5]={"Monday","Tuesday","Wednesday","Thursday","Frida y"};

clrscr();


read=fopen("rose.txt","a+");

for(int day=0;day<5;day++)
{
if(day==0)
{
fprintf(read,"%s,",code);

gotoxy(12,26);cprintf("Enter time-in for %s : ",days[0]);
scanf("%s",&timein);
gotoxy(12,27);cprintf("Enter time-out for %s : ",days[0]);
scanf("%s",&timeout);
}
if(day==1)
{
gotoxy(12,29);cprintf("Enter time-in for %s : ",days[1]);
scanf("%s",&timein);
gotoxy(12,30);cprintf("Enter time-out for %s : ",days[1]);
scanf("%s",&timeout);
}
if(day==2)
{
gotoxy(12,32);cprintf("Enter time-in for %s: ",days[2]);
scanf("%s",&timein);
gotoxy(12,33);cprintf("Enter time-out for %s: ",days[2]);
scanf("%s",&timeout);
}
if(day==3)
{
gotoxy(12,35);cprintf("Enter time-in for %s : ",days[3]);
scanf("%s",&timein);
gotoxy(12,36);cprintf("Enter time-out for %s : ",days[3]);
scanf("%s",&timeout);
}
if(day==4)
{
gotoxy(12,38);cprintf("Enter time-in for %s : ",days[4]);
scanf("%s",&timein);
gotoxy(12,39);cprintf("Enter time-out for %s : ",days[4]);
scanf("%s",&timeout);
}
}


for(int i=0;i<2;i++)

in_hour[i]=timein[i];
in_min[i]=timein[i+3];
out_hour[i]=timeout[i];
out_min[i]=timeout[i+3];

float conv_outmin;
conv_outmin=atof(out_min);
if(conv_outmin>0){
if(conv_outmin<15){
conv_outmin=0;}}

float conv_inmin,conv_inhour;
conv_inmin=atof(in_min);
conv_inhour=atof(in_hour);
if(conv_inhour<=7){
if(conv_inhour>0){
conv_inhour=8;}
conv_inmin=0;}

float total_timein=0,total_timeout=0;
total_timein=conv_inhour+conv_inmin/60;
total_timeout=atof(timeout)+conv_outmin/60;

float total_time=total_timeout-total_timein;

if(total_time>4)
total_time=total_time-1;

hrs=hrs+total_time;

{

fprintf(read,"%s %s,\n",timein,timeout);

}


gotoxy(12,45);cprintf("Total hours present : %.2f",hrs);
{
gross_pay=(rate/8)*hrs;
gotoxy(12,47);cprintf("Gross Salary : %.2f",gross_pay);
gotoxy(12,49);cprintf("------------------------------------------------------");
}



fclose(read);

}


void payslip()
{
clrscr();
if((fp=fopen("edeeca.txt","r"))==NULL)
{
cprintf("Error opening student.txt\n");
}
else
{
cprintf("Names int file are: \n\n");
while(!feof(fp))
{
fflush(stdin);
fscanf(fp,"%s %s",&lastname,&name);
fflush(stdin);
cprintf("\n %s %s\n",lastname,name);
}
system("pause");
main();
}
}

void update()
{
char up;

clrscr();
gotoxy(5,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(5,7);cprintf( "º EDEECA º");
gotoxy(5,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(5,9);cprintf( "º º");
gotoxy(5,10);cprintf("º [1] Add Data º");
gotoxy(5,11);cprintf("º º");
gotoxy(5,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(23,6);cprintf( "ÉËÍÍËÍÍËÍÍËÍÍËÍÍË»");
gotoxy(23,7);cprintf( "º EDEECA º");
gotoxy(23,8);cprintf( "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹");
gotoxy(23,9);cprintf( "º º");
gotoxy(23,10);cprintf("º [2] Edit Data º");
gotoxy(23,11);cprintf("º º");
gotoxy(23,12);cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");

gotoxy(10,25);printf("Enter your choice:");
scanf("%c",&up);

switch(up)
{
case 1:
// {
// add();
// }
//case 2:
// {
// edit();
// }
//}
}

void add()

{

do{


if((fp=fopen("studgie.txt","a+"))==NULL)

{
cprintf("Error opening student.txt\n");
}
else
{
fflush(stdin);
gotoxy(23,12);cprintf("Enter complete name: ");
fflush(stdin);
gotoxy(23,14);scanf("%s %s",&lastname,&name);
gotoxy(23,16);fprintf(fp,"%s %s\n",lastname,name);

fclose(fp);
}
gotoxy(23,18);cprintf("Add another data?[y/n]");
h=getch();
gotoxy(23,21);system("pause");
}while(h=='y');
main();
} }

//void edit()
//{






void bye()
{
clrscr();

gotoxy(24,14);printf("ÛÛ ÛÛ ÛÛÛÛÛ ÜÛÛÛÛÛÛÜ ÛÛÛÛÛÛÛÛ ");
gotoxy(24,15);printf("ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛß ÛÛÛÛ ÛßßßßßÛÛÛ");
gotoxy(24,16);printf("ÛÛÛÛ ÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛ ÜÛÛß ÛÛÛ ");
gotoxy(24,17);printf("ÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÜ ÜÛÛß ");
gotoxy(24,18);printf("ÛÛ ÛÛÛ ÛÛ ÛÛÛ ÛÛÛ ÛÛ ÛÛÛ ÜÛßß Û");
gotoxy(24,19);printf("ÛÛ ß ÛÛ ÛÛ ÛÛ ÛÛ ÛÛÛÜ ÛÛÛÛÛÛÛÛÛ");

//getch();
}}
[/center]
[/left][/left]
Sep 14 '10 #1
2 1237
can you please..
Sep 14 '10 #2
whodgson
542 512MB
What error, compiling, run time, logic?
Where is the output unexpected?
Expand|Select|Wrap|Line Numbers
  1. Also please enclose your code in code tags like this by selecting and pressing #
Sep 14 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike Fisher | last post by:
I'm seeing an error when I try to run/debug a web service. Although it doesn't happen every time, it does occur more than half of the times I hit F5. It appears to be returned by the the JIT...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
4
by: Jack Wright | last post by:
Dear All, At some customers we are facing a problem when the user tries to launch any aspx page from IE. We are getting "Compiler failed with error code 2000". Is this bcos of some missing...
3
by: Hamilton | last post by:
Hi there, I've seen this error appear a few times in newsgroups but unfortunately I haven't found one that actually provides a solution. I'm basically deploying a new website into an area at a...
1
by: Razzie | last post by:
Hi all, I was working on a little project, worked fine, but now all of a sudden I get: The compiler failed with error code -1073741502 as an error message (when running the site, not...
0
by: jeffpriz | last post by:
We've got an issue here where we regularly receive an error page with the message "Compiler Error Message: The compiler failed with error code 2000." when we begin debug on our projects. The...
1
by: Terrance | last post by:
Hello, I was wondering if someone can help me understand something. Below is some code that I got from the MS website that is suppose to authenticate for the username and password on the local...
1
by: bhanupoornakumar | last post by:
Hi .. when i am setting a website i am getting the following error.. The compiler failed with error code -1073741819. This is the full error .. u can see below. Compilation Error ...
3
by: Yash | last post by:
Hi all, I found that while we are updating our application, the application is not known to tomcat, untill it is completed. So tomcat sends 503 page as resource not found. I want to know is...
4
by: jdom | last post by:
i have been struggling with this error for a while , i changed to many times to make sure no error but no luck Error on line 29 strsql.Parameters("@columna") = strmake <%
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.