Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given variables cargoLabel, cradleCount, and cradleWeight, declare and assign the following pointers: character pointer cargoLabelPointer is assigned with the address of cargoLabel. integer pointer cradleCountPointer

Given variables cargoLabel, cradleCount, and cradleWeight, declare and assign the following pointers:

character pointer cargoLabelPointer is assigned with the address of cargoLabel.

integer pointer cradleCountPointer is assigned with the address of cradleCount.

double pointer cradleWeightPointer is assigned with the address of cradleWeight.

Ex: If the input is B 178 181.5, then the output is:

Cargo B contains 178 cradles of 181.5 pounds each.

#include #include using namespace std;

int main() { char cargoLabel; int cradleCount; double cradleWeight; /* Your code goes here */ cin >> cargoLabel; cin >> cradleCount; cin >> cradleWeight;

cout << fixed << setprecision(1); cout << "Cargo " << *cargoLabelPointer << " contains " << *cradleCountPointer; cout << " cradles of " << *cradleWeightPointer << " pounds each." << endl;

return 0; }

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

Calculate the lifetime value (LTV) of a loyal customer.

Answered: 1 week ago