Question: Assignment 1 This assignment is adopted from Project Euler Question 13. Requirement - use file for the input (nums.txt) -use ifstream and getline to open
Assignment 1 This assignment is adopted from Project Euler Question 13. Requirement - use file for the input (nums.txt) -use ifstream and getline to open the files. -Make sure you use one dimensional arrays to store and do the addition(hint use carrry). - use int array(s) (size: 55) to hold each digit from each num. - store the num reversely in the array. For example, the num 123 is stored as 3 (at index 0), 2 (at index 1) and 1 (at index 2) in the array. - write a function that performs the addition of numbers. This function will be called in the main. - write a function that prints out the answer. The answer includes two parts: the total summation and the first 10 digits of the summation. - comment the code clearly, especially for the number addition mechanism. -make sure the addition is properly explained do not use 2 dimensional arrays.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
