Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hello, please make a c++ coding file for this question. please use basic coding skills as possible with comments. it would be great if you
hello, please make a c++ coding file for this question. please use basic coding skills as possible with comments. it would be great if you could do data abstraction, input, output, process and assumptions.
Program 11 "GPS" Write a C+program that will process a stream of GPS data. Each line of data starts with a command, followed by the data for that command. There will be one command per line Your program should 1. Ask the user for the name of a data file echo print the file name 2. Open the data file 1. if the file fails to open, return to step1 3. Skip the first two lines of the data file 4. Process each command in the data file 5. Report the following to both the screen (cout) and a file named GPS.report: 1. Final Location 2. Total distance traveled (rounded to one decimal place) 3. Distance to starting point (rounded to one decimal place) Commands START indicates the starting location of the trip STOP -indicates the ending location of the trip DATA - indicates a turning point. Assume 1. All coordinates are in a two dimension cartesian coordinate plane 2. All numerical output should be rounded to 1 decimal places Sample Input GPS Data File Command x-coordinate y-coordinate START 0 0 DATA 24 24 DATA 4 24 DATA 4 124 DATA-25 12 DATA 0 0 STOP 195 215 Sample Output Please Enter The Name Of The Data File: data.txt Final Location: (195.0, 215.0) Total distance traveled 587.6 iDistance to starting point 290.3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started