Question
The program will need to accept two input arguments: the path of the input file and the path of the output file. See etc/cpp/example.ifstream.cpp for
The program will need to accept two input arguments: the path of the input file and the path of the output file. See etc/cpp/example.ifstream.cpp for the basis of how to do this. Once the input and output file paths have been received, the program will need to open the input and output files, read and process each input file line and create a corresponding output file line, close the input and output files, and then create and output some summary lines to the console. Note that the summary lines can be output to the console before or after the input and output files are closed, but it would be best to output them to the console after the files have been closed. Each input line will either be a comment line or shape specification line. Your program will need to ignore the comments lines and process the shape specification lines. There will be three types of shapes: a circle, a triangle, and a square. Each shape specification lines will be in this form, with the different values separated by spaces: The shape identifier will be an integer, the shape type will be a string, and the shape measure will be a double. So, for example, you might encounter lines like this: # this line is a comment and can be ignoredit starts with the pound/hash character 1 circle 3.51 2 triangle 4.62 3 square 5.73 For comments lines, lines that start with the pound/hash character, you can ignore them. For the other lines, you should calculate the shapes area and create an output line in this form:
And, the summary lines that should be sent to the console, if the example above represents all of the shape specifications, would look like this:
Step 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