Question: For this project, you will write a complete C++ program that performs all of the following tasks Use variables of Data Type flost to contain



For this project, you will write a complete C++ program that performs all of the following tasks Use variables of Data Type flost to contain all numerical values. (1) Because command ine arguments are used, first action of the program is to test to make sure that 2 file rnames were provided. Use the test if (argc!3). f the arge value is nat 3, print out an error message and what the correct format should be for running the program and terminate the program. (see page 4) (2) Using command line arguments for an input file and output fie name (see command line argument sides ard page 3), apen the input file provided as the first command line argument Venify that the file apened successfully. If it cid not open successfuly, output an error message and terminate the program-See page 4 for intormation on this test (3) If the input file is successtully opened, open the output tile provided as the second command ine argument Verity that the output le opened suocessfully. If it did not open successfully output an error message and terminate. Use the filename "Bad/tile to cause the open function to tail tor the output tie (4) For steps 1 and 2 output a statement staing the name of the file being opered-see the solution (5) The upper case letters A, B and C appear on the first, seoond and third line of the input e respectively. The input le contairs a si each letter is a floating paint number characters after the numbers on each line e occurrence of these letters. Immediately after which must be read, and there may or may not be more (8) Read in the three numbers and then test to see if any of them are less than O. It any are negative, determine which ones are negative, output a message as shown in the sample solution and terminate the program. (7) If all numbers are greater than or equal to 0, add them up and determine their average. From the average determine it the average is High (average >75), Medium (average When all numbers are posibve, make sure output is to the output file-including the output statements that set up the formattng. . All error messages are written to the terminal . For a program written expecting command line arguments, a segmentation fault will occur if command line arguments are not provided. Run the sample solution (rot the comparison scnipt) to see what the program writes to the terminal and to the output file, and the order in which the information is written Look at the contents of an input file (see page 3) to see what has to be read. .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
