Are you looking for the projects you need to complete at the end of the chapter? You need the Program List for Chapter 7!

Chapter 7 - Mathematical & Business Functions

BowerPower

The Math Class and the IsNumeric( ) Function

  1. Read page 203. The math class has lots of useful functions (like the three you see on page 203) and numbers, such as Math.Pi( ) and Math.e( ).
  2. Read page 204. The IsNumeric( ) function lets you know if there really is a numeric value in an expression. It returns a Boolean value- either true or false. Look at the Round The Number program (page 205). It is complete and shows you how IsNumeric( ) and Math.Round( ) can be used.
  3. Go back to page 204 and modify the Mathematical Functions program that has been started for you.
  4. Remember that If IsNumeric(txtWhatever.text)=True is the same as If IsNumeric(txtWhatever.text).

BowerPower

Formatting Numeric Output

  1. Read page 205. You may have already seen this page about the Format( ) function if you were trying to make a number answer display as currency ($578.32, for example).
  2. Look at the the Format Function Examples 1 program to see how these different formats can be used. Notice how quotation marks (" ") are used to contain the type of format you desire.

BowerPower

Business Functions

  1. As you read pages 205-208, don't worry if you don't understand everything. But if you plan on taking out a loan for a house or car at some point in your life, or investing money in an account with compound interest, you will become familiar with terms such as annuity, payment, present value, future value, and amortization.
  2. Notice that the Pmt( ), PV( ), and FV( ) functions all need three values:
    rate- This is often divided by 12 because many interest rates are advertised at their annual (yearly) rate, but are actually calculated monthly. Remember that a 6% rate is 0.06 as a decimal.
    term- If interest is calculated monthly, then this must be the number of months (so a 10-year loan would have the number 120 in this spot).
    amount- Notice how this is often a negative number, because someone owes another person money (either you owe the bank or the bank owes you)
  3. An error on page 206- FV( ) returns the future value, not the value, of an annuity.
  4. On page 207, you should understand how Replace( ) and TrimEnd( ) are used to remove characters (such as $ and %) and spaces.

BowerPower

Credit Card & Loan Payment

  1. Jump ahead to page 210 (don't worry- we'll go back later!) and look at the Credit Card Loan program (it has been completed for you). This is an interesting program to run, especially if you know someone with huge credit card debt that makes minimum monthly payments!
  2. There are two subs [GetDollarAmount( ) & GetPercentAmount( )] in this Credit Card Loan program that you are going to use in the upcoming Loan Payment program. You can also see these subs written out in your book on pages 207-208. You can also find them in this text file, which will be convenient to copy and paste in the Loan Payment program.
  3. Return to pages 208-209 and complete Loan Payment - Part 1.
  4. Owing money isn't always fun, so let's go to page 210 and do the Watch Your Money Grow program. It is VERY SIMILAR to the Loan Payment program you just did, but you will use the FV( ) function instead of Pmt( ).

BowerPower

ListBox

  1. Read pages 210-211 to learn how to use a ListBox.
  2. Look at Format Function Examples 2 (ListBox- using SelectedIndex) and Format Function Examples 3 (ListBox- using SelectedItem) to see some examples using a ListBox.
  3. How to put items in a ListBox when you are designing the program:
    A. Select the ListBox on your form so that its properties display in the Properties window
    B. Choose the Items property. When you select this, you will see a square with three dots (...). Click on that square.
    C. Now you can enter your items! Use ENTER to get to the next line for the next item.
  4. Create the Tuition Calculator - Part 1 program on pages 212-213.

BowerPower

ComboBox

  1. Read pages 213-214 to learn how to use a ComboBox.
  2. Look at Format Function Examples 4 (ListBox- using SelectedItem) and Format Function Examples 5 (ListBox- using SelectedIndex) to see some examples using a ComboBox.
  3. How to put items in a ComboBox when you are designing the program:
    A. Select the ComboBox on your form so that its properties display in the Properties window
    B. Choose the Items property. When you select this, you will see a square with three dots (...). Click on that square.
    C. Now you can enter your items! Use ENTER to get to the next line for the next item.
  4. Modify your previous program to make the Tuition Calculator - Part 2 program on pages 214-215.
  5. Modify your previous program to make the Loan Payment - Part 2 program on page 215. One change the book doesn't mention is the GetPercentAmount( ) sub is set up to recieve an entire textbox in Part 1, but you will change this textbox to a combo box in Part 2 - that means you will have change that in the GetPercentAmount( ) sub, too.
  6. Read pages 216-217. We have all learned about some of these things already (focus, tab order, TabIndex) and you may have also learned about the Enabled and Visible properties. We have not previously discussed the access key.
  7. Use the directions on pages 217-218 to make the necessary modifications to result in the Loan Payment - Part 3 program.

BowerPower

Case Study- Loan Analyzer

  1. The Loan Analyzer program is discussed on pages 219-226. You can download the completed program here. Run the program and analyze the code (there is a lot of it, but you should understand it).

BowerPower

Trigonometry

  1. The remainder of the chapter deals with trigonometry and logarithms. If you've learned about any of these subjects, take a look at pages 227-231. You are not required to write any of the programs in this section.
  2. Important!- Trigonometric functions in Visual Basic use radians, not degrees. You will need to perform some conversions if you write programs using degrees.


You're ready for the Chapter 7 Program List!

Ch 07 News

This page is now complete!

Countdown to Pi Day!

Pi Day Countdown

Contact Mr. Bower

Phone:
260.356.6104 x1121

E-mail:
(combine Parts 1 and 2 with the "@" symbol)
Part 1: sbower
Part 2: hccsc.k12.in.us