- Create a new Xcode command-line project. Name the project Assignment-16-2.
- The Type of the project must be Foundation.
- Write a program that will have identical output to Assignment-16-1.
- There is a method in the
stringByAppendingFormat:. Here is an excerpt from the documentation for the method.
- Use this method in a
forloop as in Assignment-16-1 to create the output string.
- Start with the same variables.
- And the same final output statement.
- In between the variables and the ouput statement you can only have one
forloop with some logic statements inside the loop.
- You must use the
stringByAppendingFormat:method to add the numbers to the outputString. You can’t just type the output string. It must be created in the loop one number at a time.
- You must be able to change the
loopMaximumvariable and have the output adjust automatically. For example is the variable is set to 20 you would get this output, just like in Assignment-16-1.
- NOTE: You can’t have a trailing comma. This is wrong output: