Project 2
Due: 21:00 F 10/19

C++ Programming

(Post your P1 questions/answers to the 122 Blog.)
If I had eight hours to chop down a tree, I would spend 6 hours sharpening an axe.
- Anon.
Measure twice, cut once. - Anon.

Project Requirements

Complete the following requirements in the order given:
  1. You can use just one Visual C++ project for the term. You can "recycle" a single Visual C++ project as you go through the term, instead of having to start a new project each time you write a new program:

  2. isValidTri.cpp. On paper, sketch out a solution for Programming Exercise 3.1, p. 98. This solution outline comprises your algorithm to solve the problem (the algorithm does not have to be turned in).

    Your program must generate the I/O specification shown on p. 98. Note that it echos the program inputs, which is our standard practice in 122. You may use integer inputs as shown.

    By default Boolean values are represented using numbers, 0 for false and 1 for true. To print these values as words read about the boolalpha flag. Use of this flag is a P2 requirement.

    Translate your algorithm into a c++ program, isValidTri.cpp. Verify it by hand tracing it on several test cases (inputs). This handwritten program outline does not have to be turned in.

    When you are confident of your program's correctness, use Visual C++ to edit/compile/test/debug your program.

    Store your program as /122/p2/isValidTri.cpp on your local host. When complete use SSH/sftp to upload it (drag-and-drop is all it takes) to your /122/p2/ folder on the remote host, shell.uoregon.edu.

  3. five-six-props.cpp. On paper, sketch out a solution for Programming Exercise 3.3, p. 98. This solution outline comprises your algorithm to solve the problem (the algorithm does not have to be turned in).

    Your program must generate the I/O specification shown on p. 98. Note that it echos the program inputs, which is our standard practice in 122. You may use integer inputs as shown.

    By default Boolean values are represented using numbers, 0 for false and 1 for true. To print these values as words read about the boolalpha flag. Use of this flag is a P2 requirement.

    Translate your algorithm into a c++ program, five-six-props.cpp. Verify it by hand tracing it on several test cases (inputs). This handwritten program outline does not have to be turned in.

    When you are confident of your program's correctness, use Visual C++ to edit/compile/test/debug your program.

    /122/p2/five-six-props.cpp on your local host. When complete use SSH/sftp to upload it (drag-and-drop is all it takes) to your /122/p2/ folder on the remote host, shell.uoregon.edu.

  4. dayCount.cpp. Study listing 3.4, leapYear.cpp. Then, on paper, sketch out a solution for Programming Exercise 3.8, p. 99. This solution outline comprises your algorithm to solve the problem (the algorithm does not have to be turned in).

    Echo the program inputs as shown in this I/O specification (showing two separate runs):
    enter month and year (mm yyyy): 10 2007
    October 2007 has 31 days.
    
    
    enter month and year (mm yyyy): 2 2008
    February 2008 has 29 days.
    On paper, translate your algorithm into a complete c++ program, dayCount.cpp. Verify it by hand tracing it on several test cases (inputs). This handwritten program does not have to be turned in.

    When you are confident of your program's correctness, use Visual C++ to edit/compile/test/debug your program.

    Store your program as /122/p1/dayCount.cpp on your local host. When complete use SSH/sftp to upload it (drag-and-drop is all it takes) to your /122/p1/ folder on the remote host, shell.uoregon.edu.

  5. Project Grading Rubric. This document describes how your lab instructor (GTF) will grade your project. You should assess your project using this rubric before turning in your project, to make sure you are meeting all project requirements.

  6. How to Submit your Project for Grading.

Always Echo the Input

To "echo the input" means to display the value entered by the user. Always echo program input for your reader. For example, if a program prints this:

The input string is not a palindrome. 
The output does not include the string being tested, so there is no way for the reader to determine if this is a true statement. Instead, you should Echo the input for your reader:
The input string "go hang a salami, I'm a lasagna hog" is a palindrome.