Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Welcome to Itty Bitty Airfreight. We are a small, one airplane, local, airfreight company. We specialize in freight charters, special handling and quick turnaround shipments.

Welcome to Itty Bitty Airfreight. We are a small, one airplane, local, airfreight company. We specialize in freight charters, special handling and quick turnaround shipments. If you need something delivered in the West, we are your solution. We do the smaller, local airports as well as the major airports.

What we need from you, the programmer is the following:

An object oriented, Unit Load Delivery (ULD), setup and tracking program. A Unit Load is one unit, either Container or Pallet to be loaded onto our Boeing 737. Heres your data to setup and manage

Unit and type: Container or Pallet: AYF, AYK, AAA, AYY type Containers

and PAG, PMC, PLA type Pallets (a pallet is a flat platform for holding strapped down cargo).

Unit ID: Container or Pallet type: a five digit + airline code; our ID code is IB, e.g. AYF12345IB

Aircraft type: Ours is a 737; we are planning on adding more planes in the future of course.

Weight: The weight, in pounds, of the loaded container or pallet.

Destination: A three alpha character IATA string, e.g. MFR (Medford, OR), or PDX (Portland, OR)

Refer to the file airfreight.doc or airfreight.docx for sample struct or class information

Lab 2.1 struct

Write a complete program with a struct to hold the data for one unit (container or pallet). Load the pertinent data and then output it to the screen. Use the following functions:

main

* Uses new to obtain space for the data structure

* Calls the other two functions

* Deletes the space obtained using new

input

* Reads all the data from the user

* Puts all this data into the structure

output

* Prints the data in a neat format

Put the main function first.

Use the function names and specified above.

Arrange the functions in the order listed above.

Use the following data and field names:

uld - Pallet

abbreviation - PMC

uldid - PMC46890IB

aircraft - 737

weight - 1289

destination BFL

Unfinished Code I would Like you to finish!

Please use the code provided

Only thing that needs to be finished is the output and input functions!

Thank you

// 2.1

#include

#include

using namespace std;

struct Cargo

{

string loadType;

string abbreviation;

string identification;

int aircraft;

int weight;

string destination;

};

void input(Cargo* cPtr);

void output(Cargo* cPtr);

int main ()

{

Cargo* cPtr = new Cargo; // Cargo struct on the heap

input(cPtr);

output(cPtr);

delete cPtr;// pointer gone

cPtr = nullptr;

return 0;

}

void input(Cargo* cPtr)

{

cout << "Please input Container or Pallet: ";

getline(cin,(*cPtr).loadType);

cout << "Please input" << cPtr-> abbreviation << " abbreviation: ";

getline(cin, cPtr->abbreviation);

cout << "Please input " << cPtr-> identification << "aircraft identification: ";

getline(cin, cPtr->identification);

}

void output(Cargo *cPtr)

{

cout << "output called ";

cout << cPtr->loadType << endl;

cout << cPtr->abbreviation << endl;

cout << cPtr->identification << endl;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions