subject

Please help me with it ASAP
Please
C++
Lab 2.1 structWrite 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 formatPut 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

#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 object in the heap
input(cPtr);
output(cPtr);
delete cPtr;// pointer gone
cPtr = nullptr;
return 0;

}
void input(Cargo* cPtr)
{
cout << "input called\n";
cout << "Please input Container or Pallet: ";
getline(cin, cPtr->loadType); ///eliminates (*cPtr).loadType

}
void output(Cargo *cPtr)
{ cout << "output called\n";
cout << cPtr->loadType << endl;

}
Please help me with the following coding

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
question
Computers and Technology, 24.06.2019 13:30
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
You know the right answer?
Please help me with it ASAP
Please
C++
Lab 2.1 structWrite a complete program wit...
Questions
question
Mathematics, 26.05.2021 05:00
question
Mathematics, 26.05.2021 05:00
question
Mathematics, 26.05.2021 05:00
question
Mathematics, 26.05.2021 05:00
question
Mathematics, 26.05.2021 05:00
question
Spanish, 26.05.2021 05:00
question
History, 26.05.2021 05:00
Questions on the website: 13722361