Home / Expert Answers / Computer Science / include-lt-iostream-gt-include-lt-iomanip-gt-using-namespace-std-int-main-nbsp-nbsp-d-pa511

(Solved): #include <iostream> #include <iomanip> using namespace std; int main() {    d ...



CHALLENGE
ACTIVITY
1.1.3: Pointer basics.
415564.2002904.qx3zqy7
Start
Given variables distance, road, and direction, declare

#include <iostream>
#include <iomanip>
using namespace std;

int main() {
   double distance;
   int road;
   char direction;
   
   /* Your code goes here */
   
   cin >> distance;
   cin >> road;
   cin >> direction;

   cout << "Distance: " << fixed << setprecision(1) << *distancePointer << " miles" << endl;
    cout << "Route: " << *roadPointer << "-" << *directionPointer << endl;

   return 0;
}

CHALLENGE ACTIVITY 1.1.3: Pointer basics. 415564.2002904.qx3zqy7 Start Given variables distance, road, and direction, declare and assign the following pointers: • double pointer distancePointer is assigned with the address of distance. integer pointer roadPointer is assigned with the address of road. • character pointer direction Pointer is assigned with the address of direction. ? Ex: If the input is 0.5 49 N, then the output is: Distance: 0.5 miles Route: 49-N


We have an Answer from Expert

View Expert Answer

Expert Answer


NOTE: I have commented the code wherever needed. . . CODE: #include #include using namespace std; // main method begins int main() { // required variables are decl
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe