In C programming Create a structure called Car with the fields string brand int speed in km/hr. Create a function timeCar that accepts a Car type of parameter and a distance in km. Return the time needed for the car to reach the distance in minutes. In the main function, create a Car instance called car1 and ask the user to input the details for the car1's brand and speed. Also ask for an integer input, distance, then call the timeCar function while passing in the car1 instance and the inputted value of distance. Print the return value and interpolate it in this sentence: "It will take a Lopus car [ time_in_minutes ] minutes to reach a distance of [ distance ] ." Input 1. One line containing a string brand 2. One line containing an integer speed in km/hr 3. One line containing an integer distance in km Output Enter brand: Lopus Enter speed: 70 Enter distance: 140 It will take a Lopus car 120 minutes to reach a distance of 140.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.4: A Case Study: Constructing A Date Class
Problem 9E
icon
Related questions
Question
In C programming Create a structure called Car with the fields string brand int speed in km/hr. Create a function timeCar that accepts a Car type of parameter and a distance in km. Return the time needed for the car to reach the distance in minutes. In the main function, create a Car instance called car1 and ask the user to input the details for the car1's brand and speed. Also ask for an integer input, distance, then call the timeCar function while passing in the car1 instance and the inputted value of distance. Print the return value and interpolate it in this sentence: "It will take a Lopus car [ time_in_minutes ] minutes to reach a distance of [ distance ] ." Input 1. One line containing a string brand 2. One line containing an integer speed in km/hr 3. One line containing an integer distance in km Output Enter brand: Lopus Enter speed: 70 Enter distance: 140 It will take a Lopus car 120 minutes to reach a distance of 140.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Variables
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr