CSI 32 Introduction to Computer Programming II     

D01 (31093)

Monday, Wednesday, 12:00 pm-1:50 pm, room Meister 320
 

 
Date Class Materials HW assignment
12/21 Final Exam

12pm - 1:50pm, ME 320

 More details can be found on the Midterm and Final Exams page.
 
You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
12/14 Review / Preparation for the Final Exam

Review problems, set 2

 
12/12 Review / Preparation for the Final Exam

Review problems, set 1

Record class interface: RecordInterface.h
text file: movies.txt
 

Week 15
 
12/07 Chapter 20 Searching and Sorting

Lecture slides

source code: linearSearch.cpp, linearSearch2.cpp, binarySearch.cpp, bubbleSort.cpp, selectionSort.cpp


Additional Resources:
1) Bubble sort demonstration
2) Selection sort demonstration
3) algorithm library

12/05 Chapter 16 Standard Library Algorithms

Lecture slides

source code: lambdasExamples.cpp, basicSearchSortExamples.cpp, functionObjectExample_beginning.cpp
Source code after the class meeting: lambdasExamples_full.cpp, functionObjectExample.cpp

Self Study: read Section 16.4

Additional Resources:
1) algorithm for_each
2) lambda expressions

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
(1)Write a program that allows the user to play with two sets of integer values, with names A and B. At the beginning of the program the user must be given an opportunity to enter the elements of the sets A and B.
Then he or she should be provided with a menu that will allow to:
  *   find the intersection of sets A and B
  *   find the union of sets A and B
  *   find the difference of sets A and B
  *   find the difference of sets B and A
  *   add the elements to the set A
  *   add the elements to the set B
  *   empty the set A
  *   empty the set B
  *   quit the program

After each iteration, the result must be displayed, and the user should be able to continue playing with the operations.

(2) Given a vector of decimal values, write the code that uses the algorithm for_each and finds the average of all the values in the vector. Here is the beginning of the program:

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
      vector<double> V = {1.1, 7.6, 2.3, 9.7, -3.2, -10.4, 7.6, 12.3};
      int s; // used to find the sum

      for_each(
// put the rest of the code
}


You must use lambda expression or function pointer

(3) Chapter 16 Summary and Self-Review Exercises

Week 14
 
11/30 Chapter 17 Exception Handling: A Deeper Look

Lecture slides

source code: catchingAndThrowingExceptions.cpp, definingExceptionClass.cpp, definingExceptionClass2.cpp, rethrowingException.cpp, stackUnwinding.cpp, unique_ptrExample.cpp and SomeClass.h

Optional self-development: read Section 17.8


Additional Resources:
1) <stdexcept>
2) <exception>
11/28 Chapter 15 Standard Library Containers and Iterators
( Sections 15.1 - 15.6 only)
We are meeting in-person today!

Lecture slides

source code: dequeUse.cpp, listUse.cpp, dequeWithIterators.cpp, listWithIterators.cpp, inputOutputWithIterators.cpp, mapUse.cpp

Additional Resources:
1) deque
2) list
3) map
4) make_pair vs pair

Announcements:
1) The Google spreadsheet is updated with all the information about your quizzes scores and your average quizzes score too
If you missed a quiz and would like to take it to improve your average quizzes score, then the make-up date is Thursday, December 8th, from 12 pm to 1:50pm.
If you decide to take the make-up quiz, you must let me know by Friday, December 2nd, 11:59pm. Send me an email with the "quiz make-up" in the subject field, and state which quiz do you want to take.
Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) read Section 15.5.1 (vector)
3) Chapter 15, Self-Review Exercises and other exercises: 15.1 (all, except i, l, o), 15.2 (all except c, g, n, s), 15.6, 15.8, 15.9, 15.13
3) Write the program that will read the ages of the people from a given file (file name should be requested from the user), store them (choose between three data types: vector, deque, map), and then output the count of each age that was read from the file to the display.
For example, given the file data.txt:
23 67 1 4 7
67 4 1
7 4 23 1


The output will be:
Age       Count
23             1
67             2
1                3
...



Optional (for self-development): Section 14.11

Week 13
 
You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
11/23 Chapter 14 File Processing (part 2)

No meeting today!


Plan of actions:
1) take Quiz 8 at the Blackboard. It will be available from 12 pm until 1:30pm today.
2) Review the code as a possible solution to the in-class work for our meeting on Monday, November 21st):
the sketch: inClassWorkSketch.cpp, the solution: inClassWorkFinal.cpp
3) look through the lecture slides and the examples:
Lecture slides
source code: writingAndReadingFilesForRandomAccess.cpp;
Account.h, Account.cpp, StoringClientData.cpp, usingAccounts.cpp

Additional Resources:
1) write() function info
2) read() function info
3) copy() function

Quiz 8 will be based on Chapter 12 topics covered in November 14th meeting, at the end of the class, on the Blackboard.
 
HW 10 (due date: Monday, December 12th) - last HW assignment
Exercise 14.11 (feel free to reduce the number of records to 10)

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test)
Chapter 14, Summary and all Self-Review Exercises
11/21 Chapter 14 File Processing (part 1)

Lecture slides

source code: seqFileCreation.cpp, readSeqFile.cpp; seekExamples.cpp, file3.txt;

In-class work files to grab:
Account.txt (has the account information),
transactions1.txt (a set of transactions),
transactions2.txt (a set of transactions),
transactions3.txt (a set of transactions)

Work we did in class (incomplete): InClassWorkNov21.cpp
continue working on it for practice. I will post a suggested solution after our Wendesday meeting

meeting recording

Additional Resources:
1) exit() function
2) seekg (istream)
3) seekp (ostream)
4) tellp (ostream)

Week 12

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
 
11/16 Chapter 13 Stream Input/Output: A Deeper Look
online meeting via Zoom

Lecture slides
source code from today's meeting:
outputExamples.cpp, inputAndOutputExample.cpp, inputAndOutputExample2.cpp , inputAndOutputExample3.cpp, inputAndOutputExample4.cpp, inputAndOutputExample5.cpp, outputStreamManipulation.cpp, flags.cpp, errorStates.cpp

We had Quiz 7 at the Blackboard (based on Chapter 10 topics covered at November 7th meeting, and Chapter 11 topics covered at November 9th meeting)

After meeting updates:
1) I didn't cover the manipulators. Please look at the Sections 13.6 and 13.7 and examples outputStreamManipulation.cpp, flags.cpp,
2) Work on in-class work:
    in-class work draft to use: inClassWork1_draft.cpp
    in-class work answer: inClassWork.cpp
3) meeting recording

Additional Resources:
1) ASCII table
2) ostream::put()
3) ostream::write()
4) istream::get()
5) istream::ignore()
HW 9 (due date: Monday, December 5th)
1) Use the classes we defined in class, write the header and the implementation of the Rectangle and Square classes as child/derived classes from Trapezoid class.

(a) The objects of class Rectangle will be created from two points : top left point and bottom right point (see slides for picture)

An example of the declaration: Rectangle r1(Point(10,200),Point(80,50));

The two points must be stored as attributes of the class

(b) The objects of class Square will be created from the center point and the length of the side (See slides for picture)

An example of the declaration: Square s1(Point(60,100), 80));

The center point and the length of each side should be stored and attributes of the class.

(c) For both of the classes, define Area member function, overload Perimeter member function and overload output stream operator << to display the corresponding information about them.

When overloading the output stream operator<<, note that you should display approriate information.
For Rectangle: the four points, the length and the width (or two points: top left and bottom right) and length and width.
For Square: the four points and the length of a side or the center point and the length of a side.

(d) Define the Point::slope method. At this moment, the method simply returns 0.

(e) for the class Rectangle, add public methods getLength() and getWidth() that return the length and the width, correspondingly.

(f) for the class Square, add public method getSide() that returns the length of each side.

2) Explore the idea of making functions of Area() and Perimeter() as virtual functions in our Quadrilateral class hierarchy that so far consists of classes Quadrilateral, Trapezoid, Rectangle and Square.

What do you need to do for it?

Do you need to also announce these functions as virtual in Quadrilateral and Trapezoid classes?

Do it!

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 12, Summary and all Self-Review Exercises
2) Exercise 12.6
3) Chapter 13, Summary and all Self-Review Exercises
4) Exercises 13.6 and 13.7


Optional (for self-development): (not for grade, no questions will be asked based on this material):
1) Read Sections 12.6 - 12.9
2) recall the class Complex:
re-define the stream extraction operator (input stream) to be able to get the input in the form 4 – 9i from the user. It should determine whether the data entered is valid, and if it is not, it should set failbit to indicate improper input.
3) read Sections 13.6.4, 13.7, and 13.8
11/14 Chapter 12 Object Oriented Programming: Polymorphism

Lecture slides

source code:
set1: Point.h, Point.cpp, Quadrilateral.h, Quadrilateral.cpp, Trapezoid.h, Trapezoid.cpp, Example1.cpp, Example2.cpp Example3.cpp
set2: virtualFunctionsExample.h, virtualFunctionsExample.cpp

Quiz 7 will be on Wednesday, November 16th, and is based on Chapter 10 topics covered at November 7th meeting, and Chapter 11 topics covered at November 9th meeting


Week 11

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
 
11/09 Chapter 11 Object Oriented Programming: Inheritance

Lecture slides

source code: Point.h, Point.cpp, Quadrilateral.h, Quadrilateral.cpp, Testing.cpp
Source code we created in class: Trapezoid.h, Trapezoid.cpp

Quiz 6 based on topics from Chapter 10 we covered during the week on October 31st - November 2nd

Additional Resources:
1) C++ Inheritance
2) Inheritance and Composition (with the example of Point class and Quadrilateral class)
Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 11, Summary and all Self-Review Exercises
2) Exercises 11.4 and 11.5
11/07 Chapter 10 Operator Overloading; Class String (continues)

Lecture slides

Code to begin with: array.h, array.cpp, testingArray.cpp
Completed code: array.h, array.cpp, testingArray.cpp
Reminder: all homework submissions must be presenting ONLY your work, no copying, no getting solutions from online resources/friends/etc.

Academic Integrity
Academic dishonesty (such as plagiarism and cheating) is prohibited at Bronx Community College and is punishable by penalties, including failing grades, dismissal and expulsion. For additional information and the full policy on Academic Integrity, please consult the BCC College Catalog.

HW 8 (due date: Friday, November 18th)

Recall the class Complex we used in class and re-use the code from it!

Use the header and the implementation file to do the following:

(a) overload the output stream operator<< to display the complex number object (and remove the toString() member method)

(b) overload the input stream operator>> to get the real and the imaginary parts of a complex number (Example: cin << a)
You might have to take a design decision there on how the user will enter the complex number.
For example, you might ask the user to enter only real and imaginary parts,
so for 3 + 5i the user should type in 3 + 5,
for -6i the user should type 0 - 6, and
for number 14 the user should enter 14 + 0.
Make sure to put your design decision (description) when you are submitting your implementation!!!

The rest of the methods do as member-methods:
(c) overload the += operator that adds a number on the right (rvalue) to the number on the left (the lvalue) :
Complex operator+=(const Complex& other);

Example: if a = 2+3i and b = 9-2i, then operation a+= b will update the value of a to 11 + i

(d) do the same for -=, *= and /= compound assignment operators as well:
Complex operator-=(const Complex& other);
Complex operator*=(const Complex& other);
Complex operator/=(const Complex& other);


(e) overload the + , -, /, and * operators:
Complex& operator+(const Complex& other) const;
Complex& operator-(const Complex& other) const;
Complex& operator*(const Complex& other) const;
Complex& operator/(const Complex& other) const;

and
remove the Complex add(Complex other) const; and other methods that will no longer be needed from now on(but re-use the code from them!)

(f) overload the operator == , the comparison for equality of two complex numbers
bool operator==(const Complex& other) const;

(g) overload the operator != , the comparison for not-equal of two complex numbers (do it as member method)
bool operator!=(const Complex& other) const;

Here are the header file to help you with the implementation and the test file to test your code: complex.h and testingComplex.cpp

Self-Study:
10.12 Converting Between Types
10.13 explicit Constructors and Conversion Operators

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 10, Summary and all Self-Review Exercises
2) add the copy constructor and the assignment operator to the Complex class above
3) Exercises 10.10 and 10.11

Week 10

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid). 
 
11/02 Chapter 10 Operator Overloading; Class String (continues)

Lecture slides

Quiz 5 will be at the end of the class and will be based on Chapter 9 material
Quiz 6 will be next Wednesday, and will be based on Chapter 10, Sections 10.1 - 10... material
Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 10, Summary and all Self-Review Exercises
10/31 Chapter 10 Operator Overloading; class string

Lecture slides

source code: stringsWork.cpp, staticMembersOfClass.cpp, staticMembersOfClass_2.cpp, Date.h
The code we did in class today: Date.cpp, Date.cpp

Additional resources:
1) C++ string class
2) [] operator on strings
3) static member variables
4) static member functions
 

Week 9


You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
 
10/26 Chapter 9 Classes: A Deeper Look (part 2)

Lecture slides

We re-used the code for the Complex class from previous class meeting and ended up with this one:
complex.h, complex.cpp, usingComplexClass.cpp,
other examples presented in class: dma.h, constOandMF.cpp, friendFunction.cpp

Quiz 5 will be next Wednesday, at the end of the class and will be based on Chapter 9 material
HW 7 (due date: Friday, November 4th)

1) Exercise 9.23
This is to help you started with it (it is using the two enumeration types to represent face and suit, and aligns it with the rest of the requirements for the Card class): Card.h and testingCard.cpp.
This way, the items (a) - (d) are completed for Card class.

Self-Study:
1) Read Section 9.6.2 and answer the question in exercise 9.17


Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 9, Summary and all Self-Review Exercises
2) Chapter 9, Exercises: 9.3, 9.16
10/24 Chapter 9 Classes: A Deeper Look (part 1)

Lecture slides

source code: complexNumber.h, complexNumber.cpp, testingComplexNumber.cpp, testingComplexNumber2.cpp, ConstructorsAndDestructors.cpp


Week 8
 
10/19 Midterm Exam

The exam is closed book and closed notes. You are allowed to use the Visual Studio C++ compliter installed on machines in class, but you are not allowed to use search engines, nor any other programs.
You can use one cheat sheet, letter size, both sides.

You can grab this file for the third part of the Midterm exam: PersonalRecord.h

The Midterm Grade will be based on:
Homeworks average (30%)
Quizzes average (30%)
Midterm Exam (40%)
10/17 Preparation to Midterm Exam

We used this Sample Midterm Exam in class today.
- We went over all problems in part I, and I said to exclude problems 8. and 9. from it.
- We did problems 1, 2, 3, 4, and 6 (exclude problem 5) from part II.
- I recommended to copy and paste the requirements for TV class in part III into the editor and clean it up for C++, then work on them.
Answers to some of the problems: problem 4, part II (we did the second version of the recursive function in class, look at the other variant of it), TV class: TV.h, TV.cpp, testingTV.cpp

Note that my office hours are change to Mondays, Wednesdays, 2pm - 3pm, at CP 312.

Week 7

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).

Our Midterm Exam will be on Wednesday, October 19th.
It will be based on the material from Chapters 1-8
 
10/12 Chapter 8 : Pointers

Lecture slides

source code: operationsPrecedence.cpp, passingByReference.cpp, passingByReference2.cpp, sizeOfExample.cpp

Quiz 4, today at the end of the lecture, based on Chapter 6 topics
HW 6 (due date: Monday, October 24th)- extended to Friday, October 28th

1) items (2) and (3) here: https://condor.depaul.edu/ntomuro/courses/309/notes/pointer_exercises.html
All the answers must be presented along with pictorial explanations (see the examples 1 and 2 I showed during the lecture). If the work is not shown, only half the credit will be given.
2) Exercise 8.12.
You can read the tale here: http://read.gov/aesop/025.html
Please use this draft: tortoiseAndHare.h and tortoiseAndHare.cpp

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1)Chapter 8, Summary and all Self-Review Exercises
2) Chapter 8, Exercise 8.11, 8.13, 8.14
10/10 no classes, Columbus Day

Week 6

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
10/04-05 no classes, Yom Kippur
10/03 Chapter 7 : Catching Exceptions
Chapter 8 : Pointers


Lecture slides

source code: exceptionsHandling_1.cpp, pointersExample1.cpp, pointersExample_2.cpp

work on HW 5 assignment

Week 5

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
09/29 Thursday runs by Monday schedule

Chapter 7 Class Templates: array and vector; Catching Exceptions

Lecture slides

source code: arraysExample.cpp, arraysExample2.cpp, arraysExample3.cpp, arraysExample4.cpp, vect1.cpp, vect2.cpp, vect3.cpp, vect4.cpp

In-class work: see slides
Solutions: in-classWork.cpp , in-classWork2.cpp

Quiz 4, based on Chapter 6 topics will be on Wednesday, October 12th.
HW 5 (due date: Friday, October 7th) - extended to Sunday, October 9th

1) Exercise 6.41
2) Exercise 7.13
3) Exercise 7.14
4) Exercise 7.28
Send your homeworks to natna20@gmail.com

Self-Study:
1) Read Section 6.19: Order of Evaluation of Operands
2) Read Section 6.20

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 6, Summary and all Self-Review Exercises
2) Chapter 6, Exercises: 6.40
3) Chapter 7, Summary and all Self-Review Exercises
4) Chapter 7, Exercises: 7.6 - 7.9, 7.11, 7.12, 7.17, 7.20
09/28 Chapter 6 Functions and Introduction to Recursion (recursion)

Lecture slides

source code: recFib_1.cpp, iterativeFib.cpp, rec_Fib_2.cpp, factorial.cpp

In-class work: see slides, and the draft: HanoiTower_draft.cpp
Solution: HanoiTower.cpp




Tutoring Lab for CSI 30, 31, 32, 33, 35:
Online: (visit Blackboard -> BCC online tutoring at the top right corner)
      Monday 11 am - 2 pm
      Tuesday: 11 am - 3 pm

In-Person:
(Appointments are required for in-person support via  WCOnline )
      Wednesday: 2 pm - 8 pm
      Thursday: 11 am - 2 pm; 6 pm - 8 pm

Week 4

Note that on Monday-Tuesday, September 26-27th, there are no classes scheduled at BCC - Rosh Hashanah
Thursday, September 29th will run on Monday schedule


You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
 
09/21 Chapter 6 Functions and Introduction to Recursion

Lecture slides

source code: refParameters.cpp, defaultParameters.cpp functionOverloading.cpp unaryScope.cpp templateFunctionExample.cpp

Quiz 3, today at the end of the lecture, based on Chapter 4 and 5 topics
HW 4 (due date: Friday, September 30th)

1) Exercise 6.31
2) Exercise 6.33
3) Exercise 6.49
4) Exercise 6.51
Send your homeworks to natna20@gmail.com

Self-Study:
1) Read Sections 6.7 - 6.8

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 6, Summary and all Self-Review Exercises
2) Chapter 6, Exercises: 6.11, 6.16, 6.17, 6.18, 6.46, 6.53
09/19 Chapter 6 Functions and Introduction to Recursion
Sections 6.1 - 6.12

Lecture slides

source code: Prototypes.cpp, RandomNumbersExample.cpp, scopesExample.cpp, scopesExample2.cpp, inlineFunctions.cpp

In-class work: see slides
Solutions: SomeFunctions.h, SomeFunctions.cpp, someFunctionsTesting.cpp; reverseNumber.cpp

Quiz 2, today at the end of the lecture, based on Chapter 3 topics

Additional resources:
Codecademy: Functions

Week 3

You can view your grade in this Google spreadsheet.
Look in the row with the last 4 digits of your CUNY ID (emplid).
 
09/14 Chapter 5 Control Statements: Part 2, Logical Operators

Lecture slides

source code: forLoop.cpp, outputFormatting.cpp, stringExample.cpp, switchExample1.cpp, switchExample_2.cpp, doWhileExample.cpp,

In-class work: see slides and Exercise 5.19
Solutions: switchInClassWork-answer.cpp, Exercise5_19.cpp

Additional resources:
Codecademy: Conditionals and Logic, Loops
HW 3 (due date: Friday, September 23rd)

1) Exercise 5.13
2) Exercise 5.16
Send your homeworks to natna20@gmail.com

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 5, Summary and all Self-Review Exercises (pages 203-205)
2) Chapter 5, Exercises: 5.9, 5.10, 5.22, 5.23
09/12 Chapter 4 Algorithm Development and Control Statements: Part 1

Plan for today:
  • We didn't finish Chapter 4 and therefore will resume 27
Lecture slides

source code: refinementExample_pseudocode.cpp, increment.cpp
refined code: refinementExample.cpp

In-class work: exercise 4.28
Solution: binaryToDecimal.cpp

Additional resources:
Codecademy: Conditionals and Logic, Loops

Week 2
 
09/07 Chapter 4 Algorithm Development and Control Statements: Part 1

Plan for today:
  • We didn't finish Chapter 3 and therefore will resume with a discussion about exercises 3.9 and 3.14, and will work on exercise 3.12
  • begin covering Chapter 4, Lecture slides
Afterclass updates:
We stopped at slide 26 and will resume on Monday



source code: danglingElseExample.cpp, refinementExample_pseudocode.cpp, increment.cpp
refined code: refinementExample.cpp

In-class work: exercise 4.28
Solution: binaryToDecimal.cpp

Quiz 1, on Monday, September 12th, at the end of the lecture, based on Chapter 2

Additional resources:
Codecademy: Conditionals and Logic, Loops
HW 2 (due date: Monday, September 19th)

1) Exercise 3.10
2) Exercise 3.13
3) Exercise 4.27
4) Exercise 4.37
Send your homeworks to natna20@gmail.com

Suggested exercises
(not for grade, but the questions related to these will appear on a quiz or a test):
1) Chapter 3, Summary and all Self-Review Exercises (pages 95-100)
2) Chapter 3, Exercises: 3.5 - 3.8
3) Chapter 4, Summary and all Self-Review Exercises (pages 141-147)
4) Chapter 4, Exercises: 4.11, 4.12, 4.21, 4.23, 4.32
09/05 BCC is closed. Labor Day.

Week 1
 
08/31 Chapter 3 Introduction to Classes, Objects, Member Functions and Strings

Be ready to use programming environment during the class meeting!

Lecture slides

source code from the book: Account.h, AccountTest.cpp,
modified code: Account2.h, AccountTest2.cpp

Afterclass comments:
we stopped on the slide 16, and began looked at Account2.h file.

In-class work: exercises 3.9, 3.14; 3.12
Answers: Exercise3_9.cpp, Account3_exercise3_14.h (only the header), 3.12: Date.h , DateTest.cpp

Additional resources:
Codecademy: Classes & Objects
Not for grade, do not submit your work, but please do it:
1) Look at the files account2.h and AccountTest2.cpp - this is one project. Read all comments, build and run the solution/project.
2) Then, proceed to slide 17 and try to work on the exercise 3.9.
The solution can be found here: Exercise3_9.cpp
3) Then proceed to the slide 18 and try to wor on exercsise 3.14.
The solutuion can be found here: Account3_exercise3_14.h (only the header)
Your goal for both of these exercises is to understand how everything works, what functions are used, and how all "changes/updates" were implemenented.

On Wednesday we will resume with a discussion about exercises 3.9 and 3.14 and proceed to work on exercise 3.12
08/29 Chapters 1 and 2

Lecture slides


source code: Example1.cpp, Example2.cpp, Example3-operators.cpp

Announcements:
First two chapters of the book are available through e-reserves:
http://bcc-cuny.libguides.com/er.php?b=c
Choose CSI32 from the list

Additional resources:
Codecademy: Hello World and Variables ; Conditionals & Logic has a little bit more that what we covered, but if you have time, go ahead and do it.

You can also enroll into the edX C++ course from Microsoft (free withouth the certificate, select Audit this course)

Udemy has C++ Tutorial for Complete Beginners (free)

edX and Udemy's courses seem to have more information about C++ in them.
HW 1:

due Wednesday, August 31st:
1) Chapter 2, Summary and all Self-Review Exercises (pages 64-67) - not for grade, but the questions related to these will appear on a quiz and test.
2) Chapter 2, Exercises (pages 68-69): 2.7 - 2.15 - not for grade, but the questions related to these will appear on a quiz and test.

due Wednesday, September 7th: both programming assignments will be graded
1) Chapter 2, Exercise 2.25 on page 70
2) Write a program that reads in three integer numbes from the keyboard, then
  • determines and prints the largest and the smallest integers in the group (use only the programming techniques you learned in Chapter 2),
  • determines and prints whether each number is odd or even (hint: use the remainder operator %)

Please remember:
  • All homeworks have the due date and must be submitted by the midnight of the due date. Late homeworks are not accepted.
    Example: if the due date is September 23rd, then the latest time for the submission is 11:59 pm on September 23rd.

  • When submitting your homework via e-mail:
    1. put HW number in the Subject field, for example: HW 01
    2. attach all the source file(s)(with the extention '.cpp' or the extention '.h'), and, when needed, a file with the input and output of your program(s)
    3. your program must run (no syntax errors!)
    4. your code must be well-commented
    5. when I send you back a reviewed homework submission with comments and allow to re-submit your program, do so as Reply; do not compose a new e-mail message.

  • All homeworks must be done on your own. No group work, no copying.

  • Several of the worst homeworks will be dropped.
due Wednesday, September 7th:
Read Chapter 1, sections 1.1 - 1.9, 1.11 - 1.14- not for grade, but the questions related to these will appear on a quiz.