Answer to Question #202405 in C++ for jay

Question #202405

Vogue Motor Corporation has decided to add a new app to their latest Vogue VII models. The designers require the app to give beep notifications to indicate the total miles on route to the driver’s inputted destination, based on the total distance that the car will drive. Use the following formula to obtain miles: miles = kilometres × 0.62137 You are required to implement a C++ solution that will: ● Get the destination’s name and the kilometres to be travelled, from the driver ● Output, using the “beep” notifications, the amount of miles to be travelled to the destination; i.e., if the driver enters 13 for the kilometres to their Half-way Tree destination and Jane for their name, your solution will beep 8 times to indicate 8 miles to the driver’s destination while outputting the following message:


1
Expert's answer
2021-06-05T23:50:47-0400
#include <iostream>


using namespace std;


int main()
{
    string dest_name;
    float distance;
    
    cout<<"\nEnter the destination's name: ";
    cin>>dest_name;
    cout<<"\nEnter the distance: ";
    cin>>distance;
    
    float dist_miles= distance*0.62137;
    int n=int(dist_miles);
    
    for (int i=0;i<n;i++)
        cout<<"\nThe distance to be travelled to destination is miles is: "<<dist_miles;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog