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
|
#include<iostream>
#include<cmath>
#include<string>
#include<istream>
using namespace std;
struct Cargo
{
string label;
double weight;
int height, width, length;
int cargo[100];
void initCargo(Cargo cargo[], int height, int width, int length,
double weight, string label)
{
}
double cargoWeight(Cargo cargo)
{
}
int cargoVolume(Cargo cargo)
{
}
void printCargo(Cargo cargo)
{
}
};
void loadPlane(Cargo allCargo[],int size, double maxWeight, double usedWeight, int
maxVolume, int usedVolume );
void printWeight( double maxWeight, double usedWeight);
void printVolume( int maxVolume, int usedVolume);
void printHeaviest(Cargo allCargo);
void printLargest(Cargo allCargo);
void printCargo(Cargo allCargo);
void main()
{
Cargo allCargo[100];
double maxWeight=50000;
int usedWeight=0;
int maxVolume=3000000;
int usedVolume=0;
int size;
for(int i=0;i<100;i++)
{
cout<<"Input label: ";
cin>>allCargo[i].label;
if(allCargo[i].label=="quit")
break;
cout<<"Input weight: ";
cin>>allCargo[i].weight;
cout<<"Input height: ";
cin>>allCargo[i].height;
cout<<"Input width: ";
cin>>allCargo[i].width;
cout<<"Input length: ";
cin>>allCargo[i].length;
cout<<endl;
size=i+1;
usedWeight=usedWeight+allCargo[i].weight;
}
cout<<endl;
loadPlane(allCargo,size,maxWeight,usedWeight,maxVolume,usedVolume);
printWeight(maxWeight,usedWeight);
printVolume(maxVolume,usedVolume);
printHeaviest(allCargo);
printLargest(allCargo);
printCargo(allCargo);
}
void loadPlane(Cargo allCargo[],int size, double maxWeight, double usedWeight, int
maxVolume, int usedVolume)
{
}
void printWeight( double maxWeight, double usedWeight)
{
double unusedWeight;
cout<<"Maximum Cargo Weight: "<<maxWeight<<endl;
unusedWeight=maxWeight-usedWeight;
cout<<"Unused Cargo Weight: "<<unusedWeight<<endl;
}
void printVolume( int maxVolume, int usedVolume)
{
}
void printHeaviest(Cargo allCargo[])
{
}
void printLargest(Cargo allCargo[])
{
}
void printCargo(Cargo allCargo[])
{
}
|