Ayuda con declaracion de variables
Publicado por GNZ (1 intervención) el 01/02/2019 14:47:08
Hola, hice un diagrama de flujo que da la opcion de convertir a C++, el problema es que al momento de compilarlo me salen muchos errores, pero en el programa de diagramas de flujo se ejecuta perfectamente.
lo que no entiendo es si deberia quitar el "string raptor_prompt_variable_zzyz;" y declarar mis variables dentro del main...
codigo completo
lo que no entiendo es si deberia quitar el "string raptor_prompt_variable_zzyz;" y declarar mis variables dentro del main...
codigo completo
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float promedio;
float totalHoras;
int mes;
char empleado;
float difDecimal;
float horas;
char runagain;
float decimal;
int cptDias;
int nDias;
cout << "Horas del Staff" << endl; cout << "************************************" << endl; runagain ="si";
while (!(runagain=="no"))
{
raptor_prompt_variable_zzyz ="Empleado: ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> empleado;
raptor_prompt_variable_zzyz ="Mes: ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> mes;
raptor_prompt_variable_zzyz ="Total de dias trabajados en el mes: ";
cout << raptor_prompt_variable_zzyz << endl;
cin >> nDias;
cptDias =0;
totalHoras =0;
difDecimal =0;
while (!(cptDias==nDias))
{
cptDias =cptDias+1;
raptor_prompt_variable_zzyz ="Numero de horas para el dia "+cptDias;
cout << raptor_prompt_variable_zzyz << endl;
cin >> horas;
if (horas % 1==0)
{
totalHoras =totalHoras+horas;
}
else
{
decimal =horas % 1;
if (decimal>=0.45)
{
difDecimal =(decimal-0.45)+difDecimal;
horas =(horas-decimal)+0.75;
totalHoras =totalHoras+horas;
}
else
{
if (decimal>=0.3)
{
difDecimal =(decimal-0.3)+difDecimal;
horas =(horas-decimal)+0.5;
totalHoras =totalHoras+horas;
}
else
{
if (decimal>=0.15)
{
difDecimal =(decimal-0.15)+difDecimal;
horas =(horas-decimal)+0.25;
totalHoras =totalHoras+horas;
}
else
{
difDecimal =decimal+difDecimal;
horas =horas-decimal;
totalHoras =totalHoras+horas;
}
}
}
}
}
while (!(difDecimal<0.6))
{
}
if (difDecimal>0.44)
{
}
else
{
if (difDecimal>0.29)
{
totalHoras =totalHoras+0.5;
difDecimal =difDecimal-0.3;
}
else
{
if (difDecimal>0.14)
{
totalHoras =totalHoras+0.25;
difDecimal =difDecimal-0.15;
}
else
{
}
}
}
cout << "-Empleado: "+empleado << endl; cout << "-Mes: "+mes << endl; cout << "-Dias trabajados : "+nDias << endl; cout << "-Horas : "+totalHoras+"HRS" << endl; cout << "-Diferencia de minutos no rendondeados en favor del empleado : "+difDecimal+"Min" << endl; promedio =totalHoras/nDias;
cout << "-Promedio diario : "+promedio+"HRS" << endl; raptor_prompt_variable_zzyz ="Nuevo Empleado (si/no)";
cout << raptor_prompt_variable_zzyz << endl;
cin >> runagain;
}
return 0;
}
Valora esta pregunta
0