An Introduction to C++

The C++ programming language consists of the following:

A vocabulary of commands that humans can understand and that can be converted into machine language fairly easily
A language structure (or grammar) that allows humans to combine these C++ commands into a program that actually does something (well, maybe does something)
The vocabulary is often known as the semantics, while the grammar is the syntax.


What's a program?
A C++ program is a text file containing a sequence of C++ commands put together according to the laws of C++ grammar. This text file is known as the source file . A C++ source file carries the extension .CPP just as a Microsoft Word file ends in .DOC or an MS-DOS batch file ends in .BAT. The concept extension .CPP is just a convention, but it's used almost exclusively in the PC world.

The point of programming is to write a sequence of C++ commands that can be converted into a machine language program that does whatever it is that you want done. Such machine executable programs carry the extension .EXE. The act of creating an executable program from a C++ program is called compiling (or building — there is a difference, but it's small).

How do I program?
To write a program, you need two things: an editor to build your .CPP source file with and a program that converts your source file into a machine executable .EXE file to carry out your commands. The tool that does the conversion is known as a compiler.

Nowadays, tool developers generally combine the compiler with an editor into a single work-environment package. After entering your program, you need only click a button to create the executable file.

The most popular of all C++ environments is Microsoft's Visual C++, but the software is expensive. Fortunately, there are public domain C++ environments — the most popular of which is GNU C++. (Pronounce GNU like this: guh NEW). You can download public domain programs from the Internet. Some of these programs are not free — you are either encouraged to or required to pay some usually small fee. You do not have to pay to use GNU C++.

GNU stands for the circular definition "GNU is Not UNIX." This joke goes way back to the early days of C++ — just accept it as is. GNU is a series of tools built by the Free Software Foundation.


GNU C++ is not some bug-ridden, limited edition C++ compiler from some fly-by-night group of developers. GNU C++ is a full-fledged C++ environment. GNU C++ supports the entire C++ language and executes all C++ programs.

GNU C++ is not a Windows development package for the Windows environment. You'll have to break open the wallet and go for a commercial package like Visual C++.

Replacing Printer Toner or an Ink Cartridge

Printers need ink or toner to place images onto a page. When your pages start to look blotchy or faint, you probably need a new cartridge.

Various printers work differently, but here's the general rundown on replacing the cartridge:

1. Turn off the printer and open its cover.

Printers usually have a hood-release type of latch that pops up the cover. You might need to remove the paper tray first.

If your laser printer has been turned on, let it cool off for 15 minutes. Laser printers get hot enough inside to brand a steer. The parts that seem hot are hot, and they can burn your fingers.


2. Pull out the old cartridge.

The cartridge usually slides straight out. While the cartridge is out, wipe away any dust or dirt you see inside the printer. The printer's manual tells you the most appropriate places to clean. A little rubbing alcohol on a soft rag usually works well. Check your printer's manual first to make sure that alcohol won't damage any parts inside.

Color printers usually come with two ink cartridges, one for black and the other for colored ink. Because they're often completely enclosed in black plastic, they're usually labeled to avoid confusion. If you're in doubt, the smaller cartridge probably holds the black ink.


3. Slide in the new cartridge.

Before sliding in a laser printer's toner cartridge, gently rock it back and forth to evenly distribute the toner that lurks inside. Don't turn the cartridge upside down or completely on one end.

Some toner cartridges have a protective plastic strip you must remove before you install the cartridge. Better check your printer's instruction manual on this one.

4. When the new cartridge snaps in place, close the printer's cover and turn it back on.

You might need to put the paper tray back on the printer.

5. Run your printer's software, if it has any.

Some inkjet printers, for example, come with software that aligns a newly installed cartridge. The software prints several coded designs, and then asks you to examine them and choose the best-looking ones. The printer then knows the best way to print.

• You should check your laser printer's manual for mention of any fuser pads or corona wires that need to be changed or cleaned when you replace the toner cartridge.

• New toner cartridges are sometimes blotchy for the first few pages, so don't print any résumés right off the bat.

Using the Quicken 2006 Retirement Calculator

Imagine that you decide to jump into your employer's 401(k) thing (a type of profit-sharing plan) and that it allows you to plop $6,000 into a retirement account that you think will earn about 9 percent annually. Fortunately, you don't need to be a rocket scientist to figure this stuff out. You can just use the Quicken 2006 Retirement Calculator:

1. Choose Planning --> Financial Calculators --> Retirement Calculator.

The Retirement Calculator dialog box appears.

2. Enter what you've already saved as your current savings.

Move the cursor to the Current Savings text box and type your current retirement savings (for example, if you have some Individual Retirement Account money or you've accumulated a balance in an employer-sponsored 401(k) account).

3. Enter the annual yield that you expect your retirement savings to earn.

Move the cursor to the Annual Yield text box and type the percent.

4. Enter the annual amount added to your retirement savings.

Move the cursor to the Annual Contribution text box and type the amount that you or your employer will add to your retirement savings at the end of each year.

5. Enter your current age.

Move the cursor to the Current Age text box and type a number.

6. Enter your retirement age.

Move the cursor to the Retirement Age text box and type a number.

7. Enter the age to which you want to continue withdrawals.

Move the cursor to the Withdraw Until Age field and type a number. This number is how old you think you'll be when you die. Yeah, it's a pretty grim thought, so let's just say that ideally you want to run out of steam before you run out of money. So go ahead and make this age something pretty old — like 95.

8. Enter any other income you'll receive — such as Social Security.

Move the cursor to the Other Income (SSI, Etc.) text box and type a value. Note that this income is in current-day, or uninflated, dollars.

9. Indicate whether you plan to save retirement money in a tax-sheltered investment.

Select the Tax Sheltered Investment option button if your retirement savings earns untaxed money. Select the Non-Sheltered Investment option button if the money is taxed.

10. Enter your current marginal tax rate, if needed.

If you're investing in taxable stuff, move the cursor to the Current Tax Rate text box. Then type the combined federal and state income tax rate that you pay on your last dollars of income.

11. Enter your anticipated retirement tax rate.

Move the cursor to the Retirement Tax Rate text box, and then . . . hey, wait a minute. Who knows what the rates will be next year, let alone when you retire? You should just type 0, but remember that the Annual Income After Taxes is really your pretax income (just as your current salary is really your pretax income).

12. Enter the anticipated inflation rate.

Move the cursor to the Predicted Inflation text box and type the inflation rate. By the way, in recent history, the inflation rate has averaged just above 3 percent.

13. Indicate whether the annual additions will increase.

Select the Inflate Contributions check box if the additions will increase annually by the inflation rate. (Because your salary and 401(k) contributions will presumably inflate if there's inflation, the Inflate Contributions check box should be selected.)

14. After you enter all the information, click Calculate and peek at the Annual Income After Taxes field.

If you want to see the after-tax income in future-day, inflated dollars, deselect the Annual Income In Today's $ check box but leave the Inflate Contributions check box checked.

To get more information on the annual deposits, balances, income, and so on, click the Schedule button, which appears on the face of the Retirement Calculator dialog box. Quicken whips up a quick little report showing the annual deposits, income, and ending retirement account balances for each year you plan to add to and withdraw from your retirement savings.

Using the Quicken 2006 Retirement Calculator

Imagine that you decide to jump into your employer's 401(k) thing (a type of profit-sharing plan) and that it allows you to plop $6,000 into a retirement account that you think will earn about 9 percent annually. Fortunately, you don't need to be a rocket scientist to figure this stuff out. You can just use the Quicken 2006 Retirement Calculator:

1. Choose Planning --> Financial Calculators --> Retirement Calculator.

The Retirement Calculator dialog box appears.

2. Enter what you've already saved as your current savings.

Move the cursor to the Current Savings text box and type your current retirement savings (for example, if you have some Individual Retirement Account money or you've accumulated a balance in an employer-sponsored 401(k) account).

3. Enter the annual yield that you expect your retirement savings to earn.

Move the cursor to the Annual Yield text box and type the percent.

4. Enter the annual amount added to your retirement savings.

Move the cursor to the Annual Contribution text box and type the amount that you or your employer will add to your retirement savings at the end of each year.

5. Enter your current age.

Move the cursor to the Current Age text box and type a number.

6. Enter your retirement age.

Move the cursor to the Retirement Age text box and type a number.

7. Enter the age to which you want to continue withdrawals.

Move the cursor to the Withdraw Until Age field and type a number. This number is how old you think you'll be when you die. Yeah, it's a pretty grim thought, so let's just say that ideally you want to run out of steam before you run out of money. So go ahead and make this age something pretty old — like 95.

8. Enter any other income you'll receive — such as Social Security.

Move the cursor to the Other Income (SSI, Etc.) text box and type a value. Note that this income is in current-day, or uninflated, dollars.

9. Indicate whether you plan to save retirement money in a tax-sheltered investment.

Select the Tax Sheltered Investment option button if your retirement savings earns untaxed money. Select the Non-Sheltered Investment option button if the money is taxed.

10. Enter your current marginal tax rate, if needed.

If you're investing in taxable stuff, move the cursor to the Current Tax Rate text box. Then type the combined federal and state income tax rate that you pay on your last dollars of income.

11. Enter your anticipated retirement tax rate.

Move the cursor to the Retirement Tax Rate text box, and then . . . hey, wait a minute. Who knows what the rates will be next year, let alone when you retire? You should just type 0, but remember that the Annual Income After Taxes is really your pretax income (just as your current salary is really your pretax income).

12. Enter the anticipated inflation rate.

Move the cursor to the Predicted Inflation text box and type the inflation rate. By the way, in recent history, the inflation rate has averaged just above 3 percent.

13. Indicate whether the annual additions will increase.

Select the Inflate Contributions check box if the additions will increase annually by the inflation rate. (Because your salary and 401(k) contributions will presumably inflate if there's inflation, the Inflate Contributions check box should be selected.)

14. After you enter all the information, click Calculate and peek at the Annual Income After Taxes field.

If you want to see the after-tax income in future-day, inflated dollars, deselect the Annual Income In Today's $ check box but leave the Inflate Contributions check box checked.

To get more information on the annual deposits, balances, income, and so on, click the Schedule button, which appears on the face of the Retirement Calculator dialog box. Quicken whips up a quick little report showing the annual deposits, income, and ending retirement account balances for each year you plan to add to and withdraw from your retirement savings.

Splitting a Transaction in Quicken 2006

Here's a sort of Quicken riddle for you: Suppose that you have a check that pays more than one kind of expense. You trot down to the grocery store, for example, and pick up $10 worth of junk food and junk beverages (which you should categorize as a Groceries expense) and $10 worth of 10W-40 motor oil (which you should categorize as an Auto expense). How do you categorize a transaction like this? You use a split category.

Here's how a split category works: When you're ready to categorize the check, you click the Split button, and Quicken displays the Split Transaction window.

Being a clever sort, you probably already know how the Split Transaction window works, but here are the steps anyway. Suppose that you want to categorize a $20 check that includes $10 for groceries and $10 for motor oil.

To categorize a check in the Split Transaction window, do the following:

1. Enter the first category name in the first Category field.

Move the cursor to the Category field (if it isn't already there). Activate the drop-down list box by pressing Alt+S or by clicking the down arrow and then selecting the category name.

(Despite what a dietitian may say, you can call the soda and candy "Groceries.")

2. Enter a memo description for the first categorized portion of the check.

Move the cursor to the first Memo field and then type whatever you want. (Maybe a description of the food you bought. Er, then again, maybe if you're buying real junk, you should just leave this blank.)

3. Enter the amount spent for the first category.

Move the cursor to the first Amount field and then type, well, the amount. If the first category is what you're calling Groceries and you spent $10 on this, you type 10.

4. Repeat Steps 1, 2, and 3 for each spending category.

If you spent another $10 on motor oil, for example, move the cursor to the second Category field and enter the category and optionally the subcategory you use to summarize auto maintenance expenses. Optionally, move the cursor to the second Memo field and enter a memo description of the expenditure, such as oil. Move the cursor to the second Amount field and enter the amount of the expenditure, such as 10.

A split transaction can have up to 30 pieces. Use the scroll bar and PgUp and PgDn keys to scroll through the list of split amounts.

5. Verify that the Split Transaction window shows no uncategorized spending.

If you find extra spending — this shows up as the Remainder amount — either add the category you need or delete the split transaction line that's uncategorized. To delete a split transaction line, move the cursor to one of the fields in the line and choose Edit --> Delete. You can also click the Adjust button to get rid of the Remainder amount — but in this case, Quicken adjusts the amount originally entered into the register so that it agrees with the details you've supplied in the Split Transaction window.


If you want to insert a new line, move the selection cursor to the line above where you want to make your insertion and choose Edit --> Insert. If you're fed up and want to start over from scratch, choose Edit --> Clear All (which causes Quicken to erase all the split transaction lines).

6. Click OK.

After you complete the Split Transaction window — that is, after you completely and correctly categorize all the little pieces of the transaction — click OK. Quicken closes the Split Transaction window. If you didn't enter an amount in the Payment column of the register before opening the Split Transaction window, Quicken displays a dialog box that asks whether the transaction is a payment or a deposit. You select an option button to make your choice known.

To let you know that the transaction is one that you've split, the Category field shows the word --Split-- when you select the split transaction.

7. Click the Enter button.

This command tells Quicken that you want to record the transaction in your register.

Splitting a Transaction in Quicken 2006

Here's a sort of Quicken riddle for you: Suppose that you have a check that pays more than one kind of expense. You trot down to the grocery store, for example, and pick up $10 worth of junk food and junk beverages (which you should categorize as a Groceries expense) and $10 worth of 10W-40 motor oil (which you should categorize as an Auto expense). How do you categorize a transaction like this? You use a split category.

Here's how a split category works: When you're ready to categorize the check, you click the Split button, and Quicken displays the Split Transaction window.

Being a clever sort, you probably already know how the Split Transaction window works, but here are the steps anyway. Suppose that you want to categorize a $20 check that includes $10 for groceries and $10 for motor oil.

To categorize a check in the Split Transaction window, do the following:

1. Enter the first category name in the first Category field.

Move the cursor to the Category field (if it isn't already there). Activate the drop-down list box by pressing Alt+S or by clicking the down arrow and then selecting the category name.

(Despite what a dietitian may say, you can call the soda and candy "Groceries.")

2. Enter a memo description for the first categorized portion of the check.

Move the cursor to the first Memo field and then type whatever you want. (Maybe a description of the food you bought. Er, then again, maybe if you're buying real junk, you should just leave this blank.)

3. Enter the amount spent for the first category.

Move the cursor to the first Amount field and then type, well, the amount. If the first category is what you're calling Groceries and you spent $10 on this, you type 10.

4. Repeat Steps 1, 2, and 3 for each spending category.

If you spent another $10 on motor oil, for example, move the cursor to the second Category field and enter the category and optionally the subcategory you use to summarize auto maintenance expenses. Optionally, move the cursor to the second Memo field and enter a memo description of the expenditure, such as oil. Move the cursor to the second Amount field and enter the amount of the expenditure, such as 10.

A split transaction can have up to 30 pieces. Use the scroll bar and PgUp and PgDn keys to scroll through the list of split amounts.

5. Verify that the Split Transaction window shows no uncategorized spending.

If you find extra spending — this shows up as the Remainder amount — either add the category you need or delete the split transaction line that's uncategorized. To delete a split transaction line, move the cursor to one of the fields in the line and choose Edit --> Delete. You can also click the Adjust button to get rid of the Remainder amount — but in this case, Quicken adjusts the amount originally entered into the register so that it agrees with the details you've supplied in the Split Transaction window.


If you want to insert a new line, move the selection cursor to the line above where you want to make your insertion and choose Edit --> Insert. If you're fed up and want to start over from scratch, choose Edit --> Clear All (which causes Quicken to erase all the split transaction lines).

6. Click OK.

After you complete the Split Transaction window — that is, after you completely and correctly categorize all the little pieces of the transaction — click OK. Quicken closes the Split Transaction window. If you didn't enter an amount in the Payment column of the register before opening the Split Transaction window, Quicken displays a dialog box that asks whether the transaction is a payment or a deposit. You select an option button to make your choice known.

To let you know that the transaction is one that you've split, the Category field shows the word --Split-- when you select the split transaction.

7. Click the Enter button.

This command tells Quicken that you want to record the transaction in your register.

Entering a Check into the Quicken 2007 Register

To start working with Quicken, head to the Cash Flow Center, which looks and works (sort of) like a Web page. The Cash Flow Center provides clickable hyperlinks to some of the most popular banking and bookkeeping features of Quicken.

If you don't see the Cash Flow Center window, you can click the Cash Flow Center button, which appears at the left edge of the Quicken window and is cleverly labeled Cash Flow Center.

Finding your checkbook
To enter checkbook transactions, use the Register tab of the Checking window. If you can see the bank account you want to work with listed beneath the Cash Flow Center button, you can click it to display that account's register. If the Cash Flow Center window is displayed, you can also click the bank account's QuickTab hyperlink, which is shown in the Spending & Savings Accounts list area. Finally, if you don't see the account anyplace, you can choose Cash Flow --> Cash Flow Accounts and then select the account you want to work with.

The starting balance you specified as part of setting up the account is the first amount that Quicken lists.

The Download transactions from [name of your bank] information, initially shown at the bottom of the register window, lets you set up an account for online banking or online bill payment. If you want to do this, follow the on-screen instructions. (You can also click the Set Up Online Payment button on the Register tab to set up the account for online banking and bill payment.) To remove this online services stuff from the window, click the button with the double-chevrons that's to the right of the Download Transactions and Scheduled Transactions tabs.


Entering a check
You can enter checks into the Register by using the Register tab of the Checking window or the Write Checks window (press Ctrl+W). (The following guidelines aren't etched in stone, but they do make things easier.):

Use the Register tab for the checks that you don't want to print or pay electronically with Quicken.
Use the Write Checks window to enter the checks that you do want to print or pay electronically with Quicken.
Entering a check in the register is a simple matter of describing to whom you wrote the check and how much you paid. Suppose, for example, that you paid $25.50 to the cable television company for your monthly cable service. Here's how you enter this check:

1. Enter the check date.

Move the cursor to the Date field in the next empty row of the register (if it isn't already there) and type the date by using the MM/DD format. To enter June 8, 2007, for example, type 6/8. You usually don't have to type the year because Quicken retrieves the current year number from the little clock inside your computer.

You can adjust the date in a Date field by using the + and – keys on your keyboard. The + key adds one day to the current date; the – key subtracts one day from the current date.

2. Enter the check number.

Move the cursor (or tab) to the Num field and type the check number.

Alternatively, move the cursor to the Num field and then, when Quicken displays a list box of entries (such as ATM, Deposit, EFT, Next Check Number, Print Check, Send Online Payment, and Transfer Funds), select Next Check Number if you want. Quicken then fills in the number with its guess as to the new check number — one more than the last check number you entered. If it isn't right, use the + or – key to increase or decrease the check number.

3. Enter the payee.

Move the cursor to the Payee field. Type the name of the person or business you're paying, or select payee names from the Payee list box.

4. Enter the check amount.

Move the cursor to the Payment field and type the check amount — 25.50 in this example. You don't have to type the dollar sign, but you do need to type the period to indicate the decimal place and cents.


5. Enter the category.

Move the cursor to the Category field. Quicken displays a drop-down list box of category names from your category list. You can select one of these categories by using the arrow keys or the mouse.

You can also just type the name yourself. Quicken can probably guess which category you're entering before you finish. When you start typing Ut, for example, Quicken fills in the rest of the category name, "ilities," for you ("Ut" + "ilities" = "Utilities"). This feature is called QuickFill.

6. [Optional] Enter a class.

You can also enter a class into the Category field. To do this, type a / (slash) and then the class name after you type the category name. Just to make this a bit more clear, suppose that you're using classes to segregate expenses by house because you own two homes: your principle residence and a cabin in the mountains. If you've set up two classes — principle and cabin — you record utilities expenses for your principle residence by entering utilities/principle into the Category field. You record utilities expenses for your cabin by entering utilities/cabin into the Category field.

7. [Optional] Enter a memo description.

Move the cursor to the Memo field and describe the specific reason that you're paying the check.

8. Click the Enter button that appears in the transaction's row of the register.

This option tells Quicken that you want to record the transaction into your register. Quicken beeps in acknowledgment, calculates the new account balance, and moves the cursor to the next slot, or row, in the register.