
error en programa que calcula salario en C
Publicado por brigitte (4 intervenciones) el 10/05/2015 08:55:08
Hola, estoy dando programación en la U y este es un laboratorio:
Me salen los siguientes errores:
Y:\Documents\DEV C\j.cpp In function `int main()':
32 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
33 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
34 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
35 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
Y disculpen mi ignorancia pero no logro ver el error y no puedo pedir ayuda al profesor pues pierdo valiosos puntos...
Les agradezco de antemano la ayuda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Description: CALCULADORA DE SALARIO, PARCIAL Nº2
*/
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define IS = 0.15
#define SS = 0.0925
#define SE = 0.0125
#define OTROS = 0.10
int main ()
{
char NOM [20], CED [10];
float salhora, horalab, tIS, tSS, tSE, tOTROS, salnet, salbrut;
printf ("\t\tCALCULADORA DE SALARIO\n");
printf ("Ingrese los siguientes datos:");
printf("\nNOMBRE:");
scanf ("%s", NOM);
printf("\nCEDULA:");
scanf ("%s", CED);
printf("\nRATA POR HORA:");
scanf ("%f", &salhora);
printf("\nHORAS LABORADAS:");
scanf ("%f", &horalab);
salbrut=salhora*horalab;
tIS=salbrut*IS;
tSS=salbrut*SS;
tSE=salbrut*SE;
tOTROS=salbrut*OTROS;
salnet=salbrut-(tIS+tSS+tSE+tOTROS);
system ("cls");
printf ("\tESULTADO");
printf("\nEl empleado %s con cedula %s tiene:", NOM, CED);
printf("\nRATA POR HORA: %4.2f", salhora);
printf("\nHORAS LABORADAS: %6.2f", horalab);
printf("\nSALARIO BRUTO: %8.2f", salbrut);
printf("\nDEDUCCIONES:");
printf("\n\tISR: %5.2f", tIS);
printf("\n\tSS: %5.2f", tSS);
printf("\n\tSE: %5.2f", tSE);
printf("\n\tOTROS: %5.2f", tOTROS);
printf("\n\nSALARIO NETO A DEVENGAR: %8.2f", salnet);
getch ();
}
Me salen los siguientes errores:
Y:\Documents\DEV C\j.cpp In function `int main()':
32 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
33 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
34 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
35 Y:\Documents\DEV C\j.cpp expected primary-expression before '=' token
Y disculpen mi ignorancia pero no logro ver el error y no puedo pedir ayuda al profesor pues pierdo valiosos puntos...
Les agradezco de antemano la ayuda

Valora esta pregunta


0