Declare the variable destination of type tourType. Write C++ statements to store the following data in destination: cityName-Chicago, distance-550 miles, hours and 30 minutes. travelTime-9 Write the definition of a function to output that data stored in a variable of type tourType.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 17SA
icon
Related questions
Question

Please solve this question no. 18 also. FromD.s Malik

18.
Suppose that you have the following definitions: (8)
struct timeType
struct tourType
int hr;
string cityName;
int distance;
double min;
int sec;
timeType travelTime;
),
a:
Declare the variable de stination of type tourType.
b.
Write C++ statements to store the following data in destination:
550 miles,
cityName Chicago, distance
hours and 30 minutes,
travelTime-9
Write the definition of a function to output that data stored in a
variable of type tourType.
C:
Copyrgnt 201a.cengage Learning.AliyliS Reserved Hay o De coptestannad or lupicated, in whole or in part WCN 02 200-20
Transcribed Image Text:18. Suppose that you have the following definitions: (8) struct timeType struct tourType int hr; string cityName; int distance; double min; int sec; timeType travelTime; ), a: Declare the variable de stination of type tourType. b. Write C++ statements to store the following data in destination: 550 miles, cityName Chicago, distance hours and 30 minutes, travelTime-9 Write the definition of a function to output that data stored in a variable of type tourType. C: Copyrgnt 201a.cengage Learning.AliyliS Reserved Hay o De coptestannad or lupicated, in whole or in part WCN 02 200-20
| Chapter 9: Records (structs)
Write the definition of a value-returning function that inputs data
into a variable of type tourType.
d.
Write the definition of a void function with a reference parameter
e.
of type tourType to input data in a variable of type tourType.
Transcribed Image Text:| Chapter 9: Records (structs) Write the definition of a value-returning function that inputs data into a variable of type tourType. d. Write the definition of a void function with a reference parameter e. of type tourType to input data in a variable of type tourType.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr