CS 120 - Practice Assignments

  1. DO NOT USE INTERNET EXPLORER IN THIS CLASS. (Unless instructed to do so. Even then, question it!)
  2. When downloading files, DO NOT save the web page, save the file. To save the file with Firefox, right-click on the link and choose "Save Link As..." This is so that all of the formatting in the file is preserved.
  3. Don't forget that you may need to use the --strip-trailing-cr switch with diff if it's telling you that all of the lines are different.
  4. Online submission page for the practice assignments. Your username and password are the same as your Digipen login.

  5. In order to help automate the testing of your code, the submission server will use input/output redirection. If you understand this simple concept, it will help you automate your own testing.

    Normally, output (e.g. printf) sends its output to the screen. To send it to a file instead, use the greater-than (>) symbol:

    myprogram > out.txt
    Any output from myprogram will go to a file named out.txt and you will see nothing on the screen.

    Normally, input (e.g. scanf) is read from the keyboard. To have the program read input from a file instead, use the less-than (<) symbol:

    myprogram < in.txt
    All input to myprogram is read from in.txt, and the keyboard is ignored. Also, none of the characters that are in the file will show on the screen.

    You can redirect both input and output at the same time like this:

    myprogram < in.txt > out.txt

NameMain topics
1. squares1 Looping
2. squares2 Looping
3. squares3 Looping
4. numdigits Looping, operators
5. sumdigits Looping, operators
6. dice1 Looping, random numbers
7. num2words Conditionals using if and/or switch
8. scrabble1 Conditionals using switch
9. bsort Looping, arrays, sorting
10. anagram Looping, arrays
11. strtoint Strings, looping
12. slots1 Looping, conditionals
13. coins Looping, conditionals
14. fileconv File I/O