Homework 2: cp is a command that you can run from the command line to copy one file into another. It is useful in this assignment to cp your original homework1 into two separate files homework2part1 and homework2part2. If your original homework1 was found in homework1.cpp and your two new files are homework2part1.cpp and homework2part2.cpp then you would type the following two lines into your putty/terminal window inside your 201 directory: cp homework1.cpp homework2part1.cpp cp homework2.cpp homework2part2.cpp --------- Loops are very useful in computer science. The while loop is usually used when you need a loop to continue until some condition occurs. In the following example, the loop continues until the user inputs a 0. //this variable is a 1 so that the while will pass the first time int continue_loop = 1; while(continue_loop) { //perform some useful operation here cout << "Input 0 to quit, 1 otherwise: "; cin >> continue_loop; } This type of loop continues while the user wishes to continue and is a common reason to use a while loop. ----------------------- Homework 2 Part 1: Expand your first homework so that the user may repeat the input and computation as many times as they wish. ----------------------- Sample output might be: ----------------------- Please input two numbers: 4 2 The output is: 2 Input 0 to quit: 1 Please input two numbers: 33 99 The output is: 0 Input 0 to quit: 0 Goodbye! ----------------------- For loops are most often used to repeat some action a predetermined number of times. This predetermined number might also come from the user. For example a common for loop looks like this: for(int i = 0; i < n; i++) { } The variable n describes how many times the loop will run. If n is 10 then the loop will execute 10 times. n may be described by the programmer or be input by the user (using cin). ----------------------- Homework 2 Part 2: Expand homework 1 to allow the user to input a value for n. The program should then do the division 'n' times using a for loop. ----------------------- Sample output might be: ----------------------- How many divisions would you like to do: 2 Please input two numbers: 4 2 The output is: 2 Please input two numbers: 33 99 The output is: 0 Goodbye!