INF 110 In-Chapter Excel Chapter 3

INF 110 In-Chapter Excel Chapter 3
(Workbook named In-ChapterExcel3LastName.xlsm) (Download VLC Video Player)

Use the following set of directions as a guideline:

Your Turn! (page 72) Number Guess example
(Create a Worksheet named
NumberGuessingGameP72) (See video) (Download video)

  1. Type in code on page 72
  2. To test the code put the VBA statement (Call NumberGuess) in the Worksheet_SelectionChange event of the spreadsheet
  3. Click on a cell in the spreadsheet then type in your guess, try 7 first, next try 5 then 6
  4. Keep entering numbers until you guess incorrectly
  5. Use the Alt-Print Screen keys to capture the Screen-shots for each message box (3 screen-shots total)
  6. Paste these screen-shots into the spreadsheet to show that the code is working properly.
  7. Change the Name of sheet1 tab at bottom to NumberGuessingGameP72
  8. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm.
Your Turn! (page 74) Working days and times example
 
(Create a Worksheet named WorkTimeP74
) (See video) (Download video)
  1. Type in code on page 74, change the numbers in the 2nd If statement from 0 and 6 to 1 and 7 for the program to work correctly.
  2. To test the code put the VBA statement (Call myTime) in the Worksheet_SelectionChange event of the spreadsheet
  3. Click on a cell in the spreadsheet to run the program.
  4. Use the Alt-Print Screen keys to capture the Screen-shots for each message box (1 screen-shots total)
  5. Paste these screen-shots into the spreadsheet to show that the code is working properly.
  6. Change the Name of sheet2 tab at bottom to WorkTimeP74
  7. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm  
Your Turn! (page 58) Parameters for MouseDown event of a command Button
 
(Create a Worksheet named ParametersP58
) (See video) (Download video)
  1. Create a user interface by typing in the headings into row one of the spreadsheet as shown on page 58
  2. create a command button on the spreadsheet in cells (B4:C5) as shown on page 58
  3. type in code on page 58,
  4. test the program by clicking in different areas of the command button using both the left and right mouse buttons and holding down the Shift, and Ctrl keys on the keyboard.
  5. Notice how the parameters Button, Shift, X, and Y change in value as you interact with the command button
  6. Change the Name of sheet3 tab at bottom to ParametersP58
  7. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm  
Your Turn! (pages 61 and 62) Adding Two Numbers Using Procedures
 
(Create a Worksheet named AddTwoNumbersP61-62
) (See video) (Download video)
  1. Type in code on pages 61-62,
  2. to test the code put the VBA statement (Call Main) in the Worksheet_SelectionChange event of the spreadsheet,
  3. click on a cell in the spreadsheet then type in your two numbers to be added (Use 10 and 20).
  4. Use the Alt-Print Screen keys to capture the Screen-shots for each Input box and the message box (3 screen-shots total)
  5. Paste these screen-shots into the spreadsheet to show that the code is working properly.
  6. Change the Name of sheet4 tab at bottom to AddTwoNumbersP61-62
  7. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm  
Your Turn! (page 67) Adding Raising a Number to a Power Using Functions
 
(Create a Worksheet named RaiseNumbersToPowerP67
) (See video) (Download video)
  1. Type in code on page 67
  2. to test the code put the VBA statement (Call TestPower) in the Worksheet_SelectionChange event of the spreadsheet,
  3. click on a cell in the spreadsheet then type in a number and its power or exponent using 12 and 2
  4. Use the Alt-Print Screen keys to capture the Screen-shots for each Input box and the message box (3 screen-shots total)
  5. Paste these screen-shots into the spreadsheet to show that the code is working properly.
  6. Change the Name of sheet5 tab at bottom to RaiseNumbersToPowerP67
  7. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm     
Your Turn! (page 63) Using ByRef and ByVal in Procedures
 
(Create a Worksheet named ByValandByRefP63-64
) (See video) (Download video)
  1. Type in code on page 63,
  2. to test the code put the VBA statement (Call Main) in the Worksheet_SelectionChange event of the spreadsheet,
  3. click on a cell in the spreadsheet to get the message box on the top of page 64 in Excel book.
  4. Use the Alt-Print Screen keys to capture the Screen-shots for each message box (1 screen-shots total)
  5. Paste these screen-shots into the spreadsheet to show that the code is working properly.
  6. Change the Name of sheet6 tab at bottom to ByValandByRefP63-64
  7. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm  

         Use the header feature of Excel to enter the following course information (INF 110-00s, Business Programming, Your Name Here.

Your Turn! (see slide 57 Excel 3) Draw a flowchart to solve the following problem.
 
(Create a Worksheet  named StudentLetterGradeFlowchart) (See video) (Download video)
  1. Draw a flowchart using shapes in PowerPoint to solve the following problem.
  2. Input a student's name and test score out of 100.
  3. Program should match the test score to a letter grade.
  4. Print out the student's name and letter grade use the following table.
     
    Exam Score Assigned Grade
    90 and above A
    80-89 B
    70-79 C
    60-69 D
    Below 60 F
  5. Group all the Shapes in the flowchart in PowerPoint, by selecting all the shapes and flow lines, then right-click and select Group from the short-cut menu
  6. Copy and Paste this flowchart image into the spreadsheet cell B2 to display the flowchart diagram in the spreadsheet, resize as needed.
  7. Change the Name of sheet7 tab at bottom to StudentLetterGradeFlowchart
  8. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (see slide 58 Excel 3) Draw a flowchart to solve the following problem.
 
(Create a Worksheet  named
WeightChargeFlowchart)
  1. Input the weight of a parcel. .
  2. Program should determine the delivery charge for that parcel and print it out. (Use the following table)
     
    Parcel weight (kg)

    Cost per kg($)

    < 2.5 kg

    $3.50 per kg

    2.5 to 5 kg

    $2.85 per kg

    > 5 kg

    $2.45 per kg

  3. Group all the Shapes in the flowchart in PowerPoint, by selecting all the shapes and flow lines, then right-click and select Group from the short-cut menu
  4. Copy and Paste this flowchart image into the spreadsheet cell B2 to display the flowchart diagram in the spreadsheet, resize as needed.
  5. Change the Name of sheet8 tab at bottom to WeightChargeFlowchart
  6. Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name In-ChapterExcel3LastName.xlsm

More Practice Flowcharting and Coding Problems from Web Page

(Students should submit the electronic version of all worksheets in the workbook using the drop box by clicking the InChp3 link under on the Assignments link, when you submit the assignment challenges at the end of the chapter. In-Chapter work from this chapter (In-ChapterExcel3LastName.xlsm), each spreadsheet in the In-Chapter Excel workbook should use the following names (ParametersP58, AddTwoNumbersP61-62, ByValandByRefP63-64, RaiseNumbersToPowerP67, NumberGuessingGameP72, WorkTimeP74, StudentLetterGradeFlowchart, and WeightChargeFlowchart), reflecting the page in the text from which the work comes. Substitute your last name for LastName listed in file names above)