Scientific Computing 118 (Introduction to Programming) Syllabus, Spring 2016

The following is a tentative syllabus for the course. This page will be kept current, so watch for changes.

Syllabus for SCMP 118
(Last modified 14 December 2015)
Date  Sections
Topics
Homework Due
Tu 19 January 1.1-4 Introduction  
Th 21 January 2.1 Variables and Assignments  
   
 
Tu 26 January 2.2,3  I/O, Data Types, and Expressions  
Th 28 January 2.4,5 Simple Flow of Control; Programming Style Chapter 1: #2, #8
I would advise that you also work #1, 3, 4, and 6,
but only #2 and #8 need to be submitted.
   
 
Tu 2 February 3.1,2 Boolean Expressions and Multiway Branches  
Th 4 February 3.3,4 Loops Chapter 2: #12, #15.
       
Tu 9 February 4.1,2,3  Predefined and Programmer-Defined Functions   
Th 11 February 4.4,5,6 Procedural Abstraction; Local Variables; Overloading

Chapter 3: #9, 12.

       
Tu 16 February 5.1,3 void Functions; Using Procedural Abstraction  
Th 18 February 5.2,4 Call-by-Reference; Debugging Chapter 4: #14, #15. In #15, filter the input, and be sure to make good use of functions.
       
Tu 23 February 7.1,2 Arrays and Arrays in Functions  
Th 25 February 7.2,3 Using Arrays

Chapter 5: #5, #16. In #5, do use nickels, and format output nicely. (If it's 1 penny, say "penny". If it's 2, say "pennies". If you don't need pennies, don't refer to them.)

       

Tu 1 March

8.1 Strings as Arrays  
Th 3 March 8.2 Strings as a Class Chapter 7: #6, #9.
       
Tu 22 March
Review Day
Th 24 March   Midterm Test (Chapters 1-5, 7)  
       
Tu 29 March 6.1 Streams and Basic File I/O  
Th 31 March 6.2 Tools for Stream I/O Chapter 8 #4, #7
       
Tu 5 April 6.3 Character I/O  
Th 7 April

10.4 (to p. 589)

Inheritance Take a text file (presumably some sort of prose) and make an alphabetical list of the words used, with counts. You should leave the original file unchanged, and produce a new file that lists the words used in the text file, in alphabetical order, along with the number of times each word is used.
  • Use strings and << to read one word at a time.
  • Use the alphabetization that comes "for free" with the string class using the < comparison. (str1 < str2 comes back as true exactly if str1 is alphabetically before str2, at least in C++'s notion of the alphabet (which is based on the ASCII codes, see p. 1002 of our textbook).
  • Consider Apple, apple, and "apple, to be the same word. So you might want to use a third file as an auxiliary, which would contain the contents of the original text file with all capitalization and punctuation (except word-internal punctuation like the apostrophe in they'll) removed, and spacing being irrelevant.
  • If you use a third file, use the command remove("aux.txt"); to delete the file aux.txt (or whatever you've called it) once you're done with it.
  • Allow the user to choose both the name of the original text file and the file with the word count.
  • Nice, easy-to-use interface and nicely formatted output count.
  • Allow the user to repeat the process as many times as they'd like. That will mean using the .clear() command on both your input and output streams before going back for another round. 
       
Tu 12 April 10.1 Structures  
Th 14 April 10.2 Classes Chapter 6: #8 (harder version), #17. I have provided file junkmail.txt for you to work with for #8.
       
Tu 19 April 10.3, 10.4 (last 2 pp.) Abstract Data Types  
Th 21 April 11.1 Friend Functions Start working ahead! Next week's HW is long.
       
Tu 26 April 11.2, 3 Overloading Operators  
Th 28 April 12.1 Separate Compilation

Chapter 10: #13 (I'll provide a main() for you to test your class with); Chapter 8 #14 variation: Create a class for an address entry. There should be member variables to store name, street, city, state, and zip (presumably 4 strings and an int, although 3 strings, 2 chars and an int could work as well -- your call). There should be appropriate constructors and accessor functions as well as a nicely formatted output function (appropriate for, say, printing an address label). You should write a (non-member) function which is able to read in an appropriately formatted XML file into an array of addresses and a function which can take an array of addresses and write them to an XML file. Whether you have an "output to XML" member function is a design decision for you to make. You should embed your class in a suitable test program. Among other things, your test program should read in an XML file of addresses into an array, sort the array by zip code, and generate a new XML file from the sorted array.

       
Tu 2 May 14.1,2 Recursive Functions  
Th 4 May 14.3 Using Recursion Reinventing the Wheel -- Kstring. I will put the file kstring.cpp into the Starting Points and Textfiles folder on the P: drive. You should not modify the main() of this program at all, but instead write a class definition for Kstring that emulates the standard string class in at least those attributes called upon in the main() I've provided. There is one difference: Kstrings may have a maximum length of 100 characters. (This means you can use a standard 100-character array as a member variable instead of a dynamic array.)