22C:016:BBB Computer Science I: Fundamentals (Spring '05)

Discussion Section B04, B05


Course Information

Lecturer:    Professor  Steve Bruell

Time & Place: 8:30A - 9:20A MWF 105 MacLean Hall


Discussion Sections

TA: Zhihong Wang

Time & place for B04: 10:30A - 11:20A TTh 214 MacLean Hall

Time & place for B05: 11:30A - 12:20P TTh 214 MacLean Hall


Zhihong's Office Hours

Time: 4:00P-5:30P Tue & Thur

Place: 101K MacLean Hall (353-2542)


Discussion Materials

- Jan 18 2005.  TA Introduction.

- jan19.ppt. Overview of computer system, machine language and high-level language, .NET Framework. Compile and run C# program.

-jan25.ppt. Review of Variables, identifiers, assignment operations, input/output. Examples: temperature, polynomial

-jan27.ppt. More about output formatting. Define and use methods. Programming exercises.

-feb1.ppt. Relational and equality operators, operator precedence, if and if-else statement. Examples: ParkingCost, CompareNums.

-feb3.ppt. Review of class, constructors, properties. Block and variable scope. Examples: RectangleTester, Changes, CircleTest

-feb8.ppt. While, for, do-while loops. Logic operators.; Example:TossACoin.cs

-feb10.ppt. Finish three types of loops. Examples of using logic operators.

-feb15.ppt.Review nested if-else statements and switch statements. More excercises on loop structures. Examples:EstimatePI.cs, Fibonacci.cs

-feb17.ppt.Summary of chapter 4. Exercises of using loops and Math library. Examples: AffordACar.cs, FractionPattern.cs.

-feb24.ppt. Implement properties, including read-only and write-only properties. Overloaded methods. Class variables and class methods.

(NOTE) Source files from textbook to do project 4: BankAccount.cs, TestBankAccount.cs, Acct.cs, TestAcct.cs. To make compilation and execution easier, you can put BankAccount.cs and TestBankAccount.cs in the same project, then modify them as required in exercise 5.10. For exercise 5.13, you can put  put Acct.cs and TestAcct.cs in the same project.

To add a source file to a project in Micorsofe Visual C#.NET, go to menu "Project" -> "Add Existing Item" , then choose the added file.

To exclude a  file from a project in Micorsofe Visual C#.NET, open that file as the current window, then go to menu "Project" -> "Exclude From Project".

-march1.ppt. Review members in a class, object creation, and arrays.

-march2.ppt. Review and exercise of arrays.

-march8.ppt. Memory usage of arrays. More programming exercises.

-A quick reference to in-class examples (30-44) (March 10).

-march22.ppt. C# access modifiers. String class. Click here for  System.String class members. Examples: StringEx.cs, FibonacciArray.cs, LineSegment.cs

-march24.ppt.  String operations. Discuss project questions. Example UserAccount.cs.

-march29.ppt.  Seed of Random Objects. Use Split method in string. Example:StudentDatabase.cs

-march31.ppt.  Interfaces. Multi-dimensional arrays. Array of arrays. Example: IPoint.cs, Point2D&3D.cs, PointTest.cs.

Here is a completed version of sample code for project question 7.27.

-April05.ppt. Implement interface IComparable to compare two objects of the same type. Use Array.Sort to sort elements in an array. Example: SortEmployee.cs

-April7.ppt. Class inheritance. Define a base class and inherit from it in a derived class. Call base class methods in derived class and override some of them. TestAccount.cs is a  testing program for project 8. You can choose to add your code of the ReadAccount methods in the following files: BankAccount.cs, SavingsAccount.cs., CheckingAccount.cs.

(Updated files! Click above links for a sample solution to project 8.)

 

-April12.ppt. Abstract classes and abstract methods. Example: ShapeExample.cs

-April 14, Thursday. No discussion. Change to office hours: 10:30 A~12:20P, 4:00P~5:30P.

-April19.ppt.  Polymorphism and exception handling.

-April26.ppt. C# Windows GUI programming. Examples: ReverseStr.cs, ShapeGraphics.cs, ShapeGraphics2.cs, RollDimeGrapihcs.cs.

-April28. More C#  windows controls: ComboBox, CheckBox. Discuss Project #10.

-May02.ppt. Recursion exercises. Examples: Power.cs, WriteDigits.cs. Another recursive solution to Power(x,n): Power2.cs.

-May 04. Thursday.  No discussion. Change to office hours: 10:30 A~12:20P, 4:00P~5:30P.

    -Sample solution to selected project #10 questions: project10_18.cs , project22.cs


Other materials

- A sample solution to exam#1 can be found here.s

- feb14.ppt. More C# data types. Use Math library. Examples: Leap.cs, Volume.cs, VolumeEnum.cs.

- feb21.ppt. Object-oriented programming. Class and objects. Example: ParkingLot.cs. Program output: parkinglot_output.txt

- (Posted 3/02/05) Sample solutions to project 4.

    i)  BankAccountAndTest.cs (ex5.10), ii) AcctAndTest.cs (ex5.13), iii) SoccerGame.cs (ex5.14)

 


 

Return to Zhihong's Homepage

Page Last Updated: 05/04/2005 02:11 PM