Week of FEbruary 28, 2016

Topics for this week: Solving Problems that Require Decisions

Activity checklist
  Read chapter 9 in your course packet.
  Review the slides on Solving Problems with Decisions
  Review the sample program Conditional Statements
  Watch the video Debugging your programs
  Complete lab #16, due by 11:59pm on Tuesday.
  Complete lab #17, due by 11:59pm on Thursday.
  Complete project #6 and submit it to Canvas before 11:59pm on Sunday. Late programs will lose 20% of the possible points for each day that they are late. If you turn this program in prior to 11:59pm on Saturday you will receive a 5 point bonus, if it meets all of the specifications and gives the correct answers.

It is expected that you will meet the objectives outlined here by the end of the week. You might want to test yourself to see how well you fare. You can be guaranteed that you will be tested on these concepts. By the end of this unit, you should be able to:

Reading assignment
All reading should be done before you come to class. Your ability to understand the material discussed in class will be greatly enhanced when you come to class prepared.
  1. Chapter 5 in the course packet covers relational operators, boolean operators, and logical expressions. It explains how to write and use selection statements (if, if...else, and switch). An important application of control structures is Input Validation. As you will be required to do input validation in most of the programs that you write from this point on, you should be sure that you understand how to do this.
  2. The slides on "Control Statements" covers the syntax and use of the if statement, if-else statement, and the switch statement. The use of blocks in a conditional statement is discussed as well as the use of nested if-else statements. This set of slides also presents enumerations and discusses logical operators.

important concepts
Here are some important concepts that you will want to be sure that you understand.

  1. The normal flow of control in a program is to execute each statement in turn, from beginning to end. However, there are often cases where it is desirable to change that order, based on whether some condition is true or not. For example, if it a weekday, you go to school. If it is not a weekday, you stay home.
  2. Two statements that test a condition and then alter the flow of control accordingly are the if statement and the if-else statement. Conditions are tested using relational operators, such as == (equals), < (less than), and > (greater than).
  3. The Boolean operators && (and) and || (or) are used to combine conditions. For example, if it is a weekday, and if it is not a holiday, then go to school. Be sure that you understand the shortcut rule as it applies to the evaluation of complex boolean expressions.
  4. Lab 13 introduces De Morgan's Theorem, which helps when you are dealing with negative conditions, for example when it is not a weekday, and it is not a workday. You will want to be sure that you understand how to apply this theorem.

caution After studying the assigned reading material, you should spend some time going through the review exercises at the end of the chapter. You should also try out one or two of the programming exercises. If you only do the minimum amount of work required to pass this class, you will never really master the concepts. To really learn the concepts taught in class, you should take every opportunity to put into practice what you are learning. Learning to program is like learning to play a musical instrument. It takes constant practice!

Lab Assignment

This week you should complete labs 16 and 17.
   * Lab #16 will help you to understand how conditional control structures work in C#. Lab #16 also discusses De Morgan's law.
   * Lab #17 introduces you to some GUI components that allow the user to make choices.

Project #6

This week you should complete project #6. It will test your abilities to design, code and test a C# program that uses decision logic.