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, 22.06.2019 11:10
The total cost of textbooks for the term was collected from 36 students. create a histogram for this data. $140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285 $285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320 $330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Answers: 2
question
Computers and Technology, 22.06.2019 14:30
The “rule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
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, 06.11.2020 22:20
question
Mathematics, 06.11.2020 22:20
Questions on the website: 13722363