04/12/2013, 10:24
|
| | Fecha de Ingreso: diciembre-2013
Mensajes: 2
Antigüedad: 10 años, 11 meses Puntos: 0 | |
Mi codigo no le funcionan unas partes #include <iostream>
using namespace std;
int main(){
while (true){
int option = 0;
int i = 0;
int j = 0;
float pumkimps[1][19];
float price = .85;
float total = 0;
float smallest = 10000000000000000;
float biggest = 0;
int dimencion = 0;
float average = 0;
cout << "Pumkimp Patch " << endl;
cout << "Welcome, enter the quantity of pumkings to work with: ";
cin >> dimencion;
cout << "option" << endl;
cout << "1.Add" << endl;
cout << "2.Average" << endl;
cout << "3.Inventoy Cost" << endl;
cout << "4.Biggest" << endl;
cout << "5.Smallest" << endl;
cout << "Su opcion es: ";
cin >> option;
while (option >= 1 && option <= 5)
{
while (option == 1)
{
while (j < 1)
{
while (i < dimencion)
{
cout << "Entre el peso de la calabaza en la posicion: " << j << "," << i << endl;
cin >> pumkimps[j][i];
i++;
}
j++;
}
cout << "Entre otra opcion del menu: ";
cin >> option;
}
while (option == 2)
{
while (j < 1)
{
while (i < dimencion)
{
total = (total + pumkimps[j][i]);
i++;
}
j++;
}
average = (total / dimencion);
cout << "El average de esta cosecha es: " << average << endl;
cout << "Entre otra opcion del menu:";
cin >> option;
}
while (option == 3)
{
while (j < 1)
{
while (i < dimencion)
{
total = (total + pumkimps[j][i]);
i++;
}
j++;
}
total = (total * price);
cout << "El costo del inventario es: " << total << endl;
cout << "Entre otra opcion del menu: ";
cin >> option;
}
while (option == 4)
{
while (j < 1)
{
while (i < dimencion)
{
if (pumkimps[j][i] < smallest)
smallest = pumkimps[j][i];
i++;
}
j++;
}
cout << "La calabaza mas pequena pesa: " << smallest << endl;
cout << "Entre otra opcion del menu: ";
cin >> option;
}
while (option == 5)
{
while (j < 1)
{
while (i < dimencion)
{
if (pumkimps[j][i] > biggest)
biggest = pumkimps[j][i];
i++;
}
j++;
}
cout << "La calabaza mas grande pesa: " << biggest << endl;
cout << "Entre otra opcion del menu: ";
cin >> option;
}
}
cout << "Invalid Command" << endl;
system("pause");
system("cls");
}
system("pause");
return 0;
} |