There are two files that your program will read:
Any one of the following:
In Final_OfficialInput_num.txt, there are numbers in English. The first line indicates how many numbers are in the file. Following that, numbers in English are listed one per line. You will create an array of any type that you see fit. The size of the array should be the number read in the first line. This means the array will be dynamically allocated since the size is known when the program runs.
In any of the Final_OfficialInput_op?.txt file, there are requests of operations.
Each request consists of 3 lines: the operation, first number, and second number.
The possible operations are ‘add’, and ‘sub’.
For the ‘add’ operation, the result is ‘first number’ + ‘second number’.
For the ‘sub’ operation, the result is ‘first number’ – ‘second number’.
The operation ‘end’ signals the end of the file.
Final_OfficialInput_num.txt file spec:
First line: Number of numbers in English (n)
Second line down: a number in English (n) times
Remarks: Numbers are in sequence: one is followed by two, followed by three, etc.
Final_OfficialInput_op?.txt file spec:
Unknown times of operation requests.
Each operation is consisted of 3 lines:
Operation: either add, sub, or end
If the Operation is ‘end’, no more operations are to be performed.
• Final_OfficialInput_op1.txt contains operations of which results are between 1 and 99.
• Final_OfficialInput_op2.txt contains all operations in Final_OfficialInput_op1.txt plus operations of which results are either 0, or 100.
• Final_OfficialInput_op3.txt contains all operations in Final_OfficialInput_op2.txt plus operations of which results are >100.
• Final_OfficialInput_op4.txt contains all operations in Final_OfficialInput_op3.txt plus operations of which results are < 0.
• Which file you choose to run your program against will affect the score of your Final Exam Grade.
• You will get 150 points if the echo file is correctly generated.
• You will get additional 60 points (maximum total of 210) if the results are correct when you run your program against Final_OfficialInput_op1.txt.
• You will get additional 90 points (maximum total of 240) if the results are correct when you run your program against Final_OfficialInput_op2.txt.
• You will get additional 120 points (maximum total of 270) if the results are correct when you run your program against Final_OfficialInput_op3.txt.
• You will get additional 150 points (maximum total of 300) if the results are correct when you run your program against Final_OfficialInput_op4.txt.