Question: 10. You are to modify your code written for P10 in HW5, which had the objective of finding the multiplicity of factors a divisor is

 10. You are to modify your code written for P10 in

10. You are to modify your code written for P10 in HW5, which had the objective of finding the multiplicity of factors a divisor is of another number. In the modified version of your code, you are going to read in the number and the divisor (potential factor) from a file named input.txt. You are then going to write out the results to a file, output.txt. You are to output on one line the number, the divisor, and the number of factors the divisor is of the number. You are also going to allow for additional number, divisor pairs. To do so, after a factor multiplicity is determined, determine if the ifstream for input.txt is at the end of file (use .eof()). If it is not at the end of file, read the next pair. If it is, end the program. The results of all pairs should be written to output.txt. For your test case, run the three number, divisor pairs 8,2;81,3; and 3465,3 . ( 8 points)

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!