Next Week:
Table
| # | Date | Study before class & Revu(2 pt) | Project Due(5 pt) | Class(2 pt) | Quiz(12 pts) | Lab(10 pts) |
|---|---|---|---|---|---|---|
| 13 | Tue 5/14 | 5.4-5.6 pp237-249 [ 13.html ] | - | Member Functions | - | Classes [ lab07/ ] |
| 14 | Thu 5/16 | 5.7-5.8 pp249-253 [ 14.html ] | P6 | Data Fields and Review [ classes.html ] | Q6 | Classes [ lab07/ ] |
Next Week:
Table
| # | Date | Study before class & Revu(2 pt) | Project Due(5 pt) | Class(2 pt) | Quiz(12 pts) | Lab(10 pts) |
|---|---|---|---|---|---|---|
| 9 | Tue 4/30 | 4.1-4.5 pp159-175 [ 09.html ] | - | Functions | - | Loops [ lab05/ ] |
| 10 | Thu 5/2 | 4.6-4.9 pp175-185 [ 10.html ] | P4 | Side effects and Scope | Q4 |
The last day to drop is Monday next week...
If your project score is less than 5 you can resubmit it next Thursday along with the second project.
The commonest error in the project work was to misunderstand what the program was supposed to do and write perfect program that does something different.
The quiz was done very well.... Thanks.
| Grade Distribution | A/A- | B+/B/B- | C+/C/C- | D+/D/D- | F |
|---|---|---|---|---|---|
| Frequency | 3 | 18 | 24 | 3 | 10 |
ch06/between.cppI have uploaded them into [ ch06/ ]
Never test for cin.fail() after using the data that was input. So a better bit of code would be
cin >> quarters;
if(cin.fail())
cout << "Input error.";
else
total = total + quarters * 0.25;
script
Q program_fileThen tap D while holding down the CTRL key. Then open typescript in an editor to print it... or use
lpr typescriptto print the script. You can use a screenshot on your home machine...
. . . . . . . . . ( end of section 2012-02-03 Fri Feb 3 10:30 Some answers to questions) <<Contents | End>>
const int MINUTES_PER_HOUR = 60;
const double INCHES_PER_FOOT = 12;
const double TAX_RATE = 30.0/100.0;
jbh3-1.cse.csusb.eduto a lab machine
jb359-n.cse.csusb.eduwhere n is a number.
I couldn't remember the name and URL of a useful tool. It is called codepad and lets you paste in code, compile, and run it in a dozen languages including C++. Here [ http://codepad.org/ ]
http://codepad.org/is the URL.
Book shows
POWERS_ROWS
POWERS_COLS
The "_" is used in identifiers to separate words. It makes identifiers more readable.
You can use it any time you like.... but the wise programmer uses it to connect words into identiferis ... for example first_name and second_name are good. But fir_stna_me is evil!
For example, instead of
vector<string> first_name;
vector<string> second_name;
vector<string> phone;
vector<string> street;
vector<string> email;It is so much neater to write
vector<Person> people;plus a
class Person
{
...
};
The code may get a little longer but it will be a lot easier to understand and to change in the future.
The hiring environment for information technology (IT) professionals last year was the best it's been since 2000, according to a recent Challenger, Gray & Christmas report, indicating that the technology industry has been more resilient than most during the weak economy. "These firms are definitely on the leading edge of the recovery, as companies across the country and around the globe begin to upgrade and reinvest in their technology," says Challenger, Gray & Christmas CEO John A. Challenger. The proliferation of smartphones and tablets has played a large part in keeping the tech industry thriving. Forrester Research predicts that 2011 technology spending will increase 7.5 percent in the U.S. and 7.1 percent globally. Skills in Linux are in particular demand, according to Dice research. "More and more devices and systems and services are built based on Linux, and therefore, more and more manufacturers and vendors are looking for Linux talent," says Intel's Dirk Hohndel. Linux professionals also tend to get as much as 10 percent more in salary than other IT workers, according to Dice.
Here is the grade distribution
Table
| Distribution | A/A- | B+/B/B- | C+/C/C- | D+/D/D- | F |
|---|---|---|---|---|---|
| Frequency | 5 | 7 | 8 | 4 | 1 |
So here is my policy:
| A/A- | B+/B/B- | C+/C/C- | D+/D/D- | F |
|---|---|---|---|---|
| 6 | 10 | 7 | 1 | 1 |
The C++ code is on page 244 of the book.
if( A )
B=true;
else
B=false;(where A is a condition and B is bool) can have this code replaced by
B = (A);which is simpler but more sophisticated. Here [ george2.cpp ] is a running program that tests this idea.
~dick/bin/Q gravity.cpp
~dick/bin/Q noviceand the 'vi' technique
:set numberto see the numbers on the lines of the files we write.
Note -- the book's special data types: Time, Employee, Point, Line, Circle, and Window are all available on our lab machines and "Q" will find them for you...
Table
| Distribution | A/A- | B+/B/B- | C+/C/C- | D+/D/D- | F |
|---|---|---|---|---|---|
| Frequency | 6 | 12 | 5 | 0 | 3 |
| Basis | Guess | Correct |
|---|---|---|
| Because everything else I do is easy | This should be easy | Programming takes a lot of time, care and attention to detail |
| I'm in a hurry | I'll skip writing an algorithm it will save time. | You will get lost and confused when you don't plan. |
| For loops can declare a varible "for (type name = ..." | While loops can also do this | They can't. |
| Semicolons are at the end of statements | They can't be inside a for loop: "for(...,....,...)...". | They MUST be in a for loop: "for(...;...;...)..." |
| Distribution | A/A- | B+/B/B- | C+/C/C- | D+/D/D- | F |
|---|---|---|---|---|---|
| Frequency | 4 | 8 | 3 | 1 | 4 |
I hope they help..... even if I feel it is always better to develop one's own cheat sheets....
Books on C++ can be found in the library with call number
QA76.73.C153
(PI): The best way to get π, e, etc into your program is to do this
#include <cmath>
const double PI = 4.0*atan(1.0);
const double E = exp(1.0);
const double ROOT2 = sqrt(2.0);These formulas automatically supply an accurate value without you having to type lots of decimal digits. By putting them outside of all the functions and classes you request that they are evaluated before the program starts running.
. . . . . . . . . ( end of section CSE201 Introduction to Computer Science) <<Contents | End>>