Internet Explorer tends to display C++ code embedded in my web pages strangely. I would highly recommend Firefox instead.
// Name: <Your Name>
// Class and Section: CS 54, Section <n>
// Date: <Date>
// Purpose: <Statement of Purpose>
#include <iostream>
using namespace std;
int main()
{
// Actual program goes here
return 0;
}
Last week we typed this out without really understanding what this code was about. Naturally, we will cover certain parts in more detail as the semester progresses. For now, here's an overview of what this all means.
| Code | Meaning |
| #include <iostream> | Include functions that read & write to the UNIX (bash) prompt. |
| using namespace std; | Include standard C++ language features. |
| int main() | Begin the main() function. This function is automatically executed by the UNIX operating system. All C++ programs start here. |
| return 0; | This signals the operating system your program is done. Your program will exit after this point. |
Today we will be reviewing algorithms & style. Remember that an algorithm is a well defined sequence of steps that solves a problem. Algorithms can then be translated into actual code. Here's an example algorithm to make chocolate chip cookies:
Inputs: butter, shortening, sugar, brown sugar, eggs, vanilla, flour, baking soda, salt
Output: 50 cookies
Source: Recipe Zaar.
Now try some algorithms on your own. Complete the first page of the Lab Worksheet.
NOTE: You may complete this worksheet using Microsoft Word or by hand. In either case, do it neatly. :)
Read & understand the CS 54 Style Guide. Answer the questions on page 2 of the Lab Worksheet.
We will be turning in our assignments using Blackboard. Today, I want you to turn in your lab worksheet on Blackboard (if you hand-wrote the worksheet, just submit a blank worksheet on Blackboard so you know how to do use Blackboard). Here's a quick tutorial on how to turn in your assignments on Blackboard.
I will be grading on the following criteria:
![[Dilbert]](dilbert.gif)