Question: Writing data to an output file, reading data from an input file. Write a program which prompts a user for 5 2-D (x, y coordinates

 Writing data to an output file, reading data from an input

Writing data to an output file, reading data from an input file. Write a program which prompts a user for 5 2-D (x, y coordinates and writes them to a file "points.txt'', one point (x, y) coordinate pair per line. Be sure to close the file before exiting the program. (Don't write parentheses or put a comma, just write 2 floating point values per line). Write a second program to open the same file C points.txt"), read the two vectors (10 numbers) back in, calculates whether the points are inside a circle centered at the origin with radius 20. (i.e., is the Euclidean distance (square root of sum of squares less than 20?0 Have your program print out a to the console the original coordinates, the length of each vector from the origin to the point, and whether it is inside a circle with radius 20. Name your programs points_out.cpp and points in.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!