QT4

= =

Computer Programming II, CS602, VB, QT4, Pd 2 & 5
//__Objective__: Use arrays and read files effectively.//  __Download__: Right click to save each of these files to the desktop. For the program to work correctly the files must be saved in the same place the Sports.frm and Sports.vbp are running from.
 * Monday June 6, 2011**

 __Program__: **Sport.frm** **Sports.vbp** (in binder)

 Upload both the **Sports.frm** and **Sports.vbp** to your Gaggle digital locker.

//__Objective__: Use a Visual Basic program to read and write files.//  __Program__: **MiniEdit.frm MiniEdit.vbp** When you test the program using **Summary.txt** and **WebSafety.txt** you will need to put them on the desktop where you have MiniEdit.frm and the MiniEdit.vbp saved. Have Miss Hangen check your program.  Upload all files associated with this program to your Gaggle digital locker.
 * Friday June 3, 2011**

//__Objective__: Use an input box to accept data from the user. Use a do while loop to catch bad data.//  __Finish Program__: **Pythag.frm** (form on wiki from yesterday)  __Program__: **Calculator.frm** Calculator Using InputBox (in binder) __Program__: **Calculator.frm** Update Calculator.frm to use a Do While Loops to catch bad data. (in binder)  Upload to Gaggle digital locker.
 * Friday May 27, 2011**

// __**Objective:**__ // // Students will work with nested For Next loops to create a program to output Pythagorean Triples. // __Paper and Pencil:__ The Pythagorean Theorem states that in a right triangle the sum of the squares of the legs is equal to the square of the hypotenuse. Pythagorean Triples are sets of whole numbers that can be the lengths of sides of right triangles.
 * Thursday May 26, 2011**


 * 1.** Which side of a right triangle is the longest?

Which of these sets are Pythagorean Triples?

1^2 + 2^2 = 3^2 1 + 4 = 9 5 = 9 False Not a right triangle -- not a Pythagorean Triple
 * Example: 1, 2, 3**

6^2 + 8^2 = 10^2 36 + 64 = 100 100 = 100 True Yes the lengths of sides form a right triangle, so 6, 8, 10 is a Pythagorean Triple.
 * Example: 6, 8, 10**

Show the steps to prove whether these are Pythagorean Triples.


 * 2.** 2, 3, 4


 * 3.** 9, 12, 15

__Paper and Pencil__: Finish **Nested Questions** __Program:__ **Pythag.frm** Make a program to create a list of Pythagorean triples. __Turn in:__
 * Do Now**
 * Nested For Next Loop Questions**
 * Random For Loop Homework**
 * Program Evaluation Checklist for Factorial.frm**

//__Objective__: Use nested for next loops effectively.//  __Finish Program__: **Nested.frm**  __Paper and Pencil__: **Nested For Next Loop Questions** in binder  Turn in papers.
 * Wednesday May 25, 2011**

//__Objective__: Use nested for next loops effectively//.  __Paper and Pencil__: Test your **Factorial** program with all of the test data in the binder and fill out the **Program Evaluation Checklist**.  __Program__: **Nested.frm** Directions in binder.  __Turn in__: previous paper and pencil assignments
 * Tuesday May 24, 2011**
 * Program Evaluation Checklist**
 * Random For Loop Homework**

**Monday May 23, 2011 ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Objective : Use for next loops effectively.// <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #0000ff; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #0000ff; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">__Goal__: **Students will write a program that applies the use of a For Next loop and the concept of accumulating with a variable. Students will **<span style="background-color: transparent; color: #0000ff; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">__<span style="background-color: transparent; color: #0000ff; font-family: serif; font-size: 16px; vertical-align: baseline;">extrapolate __ ** from the concept of accumulating a sum to devise a new assignment statement for generating a factorial of an unknown number. Students will write a program to calculate factorials. // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;"> <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Given the following declarations, write the 5 lines of code needed to generate and output the factorial of a number in place of the comments in italic. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Dim Number As Integer <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Dim Factorial As Double <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Dim Factor As Integer <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">'initialize Factorial to 1 // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">'start For loop to generate the factors from 1 to the Number // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">'use a similar assignment statement to accumulating a sum to calculate the factorial // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">'make the loop repeat // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">//<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">'output the factorial in a label // <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;"> <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">__Program__: **<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Factorial.frm ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Finish the program using the template provided. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Make sure you have comments with your code. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Do the self-evaluation. <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">**<span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Show pride in your work by making your program the best it can be!!!!! ** <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;"> <span style="background-color: transparent; color: #000000; font-family: serif; font-size: 16px; text-decoration: none; vertical-align: baseline;">Turn in self-evaluation.

//__Objective__: Use for next loops effectively.//
 * Friday May 20, 2011**

// __**Goal:**__ // // Students will write a program that applies the use of a For Next loop and the concept of accumulating with a variable. // // Students will **extrapolate** from the concept of accumulating a sum to devise a new assignment statement for // // generating a factorial of an unknown number. // // Students will write a program to calculate factorials. //

Do the Quiz School activity in blue below. Make sure to view the correct answer and read the explanations after doing each question. These tables are needed for questions 1 and 6 respectively. Type your name in the box and start. media type="custom" key="9495938" __Program:__ **Factorial.frm** Your and your partner will take turns at the computer. Detailed directions are in your notebook. Include meaningful comments with your code to help other students understand what you program is doing. [|FactorialRubric.doc] Turn in: __Paper and Pencil:__ **Random For Loop Homework** (due Friday)
 * Show pride in your work by making your program the best it can be!!!!!!**
 * Self-Evaluation/Grading Rubric**

//__Objective__: Use the counting assignment statement effectively. Use mod to determine divisibility.// //__Goal__: Students will dissect a program that uses For loops and mod to find prime numbers.// Matching: Think it over by yourself. Then make sure everyone in your row is in agreement and understands it, so that whoever I call on to explain it will be able to. __Finish__: **Prime.frm** Behind the 4 pages of directions in your binder is a single page with the code larger than it appears on page 3. __Read__: Read the comments. You do not need to type them, but you will need them to answer the questions. __Paper and Pencil:__ **Prime.frm Questions** __Paper and Pencil:__ **Random For Loop Homework** (due Friday)
 * Wednesday May 18, 2011**

//__Objective__: Use the counting assignment statement effectively. Use mod to determine divisibility.// __Paper and Pencil:__ 1. What do you know about what prime numbers are? 2. Name a programming structure you think you could use in a Visual Basic program that determines which numbers are prime. 3. Give a reason for why you think that structure would be useful for this task. __VB Program__: **Prime.frm** Behind the 4 pages of directions in your binder is a single page with the code larger than it appears on page 3. __Read__: Read the comments. You do not need to type them, but you will need them to answer the questions. Finish **BeeSting.sb** if you have time. Upload to your Gaggle digital locker.
 * Tuesday May 17, 2011**

//__Objective__: Share information with different sprites. Use repeat until effectively. Trouble-shooting. Critical thinking. Decide when it is appropriate to use specific structures.// 1. What does a bee do with flowers? 2. What is a person's reaction when being stung by a bee? 3. What happens to a bee after it stings someone? 4. Where is a bee's stinger? __Scratch Program__: **BeeSting.sb** 3 pages of directions provided. __Your Challenge__: **Create the scripts for the flower**. Make it change to the costume with the yellow center when the bee pollinates it. 5. Explain why you needed to use repeat until instead of forever if. 6. What structure in VB is comparable to the repeat 10 that was used in the bee script? 7. Explain what the repeat 10 does in the bee script.
 * Monday May 16, 2011**

//Objective: Use programming techniques to count.// __Read__: **Notes: Counting with a COUNTER Assignment Statement** __Program__: **CountSquares.frm** Read and type the comments. Turn in paper and pencil papers for the first half of the marking period, whether they are finished or not.
 * Thursday May 12, 2011**

//Objective: Use exponential notation and listboxes effectively.// __Online Questions__: Be sure to type in your name. media type="custom" key="9331658"
 * Monday - Wednesday May 9 - 11, 2011**

Make sure to read the explanations and redo it until you earn 100%. __Program__: **Gravity.frm** Turn in finished papers.

//__Objective__: Students will use exponential notation in programs.// //__Objective__: Use for next loops and listboxes effectively.// __Read__: **Notes: Accumulating a Sum** Refer to your directions and comments in the **Accumulate.frm** and **RandomList.frm** programs to answer these questions. 1. Define accumulate. 2. Which of these lines of code is used for //__accumulating__// a sum? A. Sum = Sum + Number B. Sum = A + B + C + D 3. Draw a picture of the ListBox tool.
 * Friday May 6, 2011**

<span style="font-family: Arial,Helvetica,sans-serif;">__Read__: Read about scientific notation and the comparable appropriate exponential notation used on calculators and in computer programming at these 2 websites. <span style="font-family: Arial,Helvetica,sans-serif;">@http://www.nyu.edu/pages/mathmol/textbook/scinot.html <span style="font-family: Arial,Helvetica,sans-serif;">@http://www.purplemath.com/modules/exponent3.htm <span style="font-family: Arial,Helvetica,sans-serif;">Practice scientific notation and exponential notation with these 2 websites. <span style="font-family: Arial,Helvetica,sans-serif;">@http://janus.astro.umd.edu/astro/scinote/ <span style="font-family: Arial,Helvetica,sans-serif;">@http://www.aaamath.com/dec71i-dec2sci.html <span style="font-family: Arial,Helvetica,sans-serif;">Do the following conversions on a piece of paper then test them with the ExponentialNotation.exe program in the thawspace. Write the number in all 3 notations on your paper: regular notation, scientific notation, and exponential notation. <span style="font-family: Arial,Helvetica,sans-serif;">

__Analyze__: Study the **ResultString.frm** program that appears in your notebook. You do NOT need to create this program. You are using it for reference in doing your next program. Turn in finished papers.

//Objective: Use programming techniques to accumulate a sum.// //Objective: Use for next loops and listboxes effectively.// What output will be produced by this code? Click here to type your answer.
 * Thursday May 5, 2011**

__Program__: **RandomList.frm** __Paper and Pencil:__ **RandomList.frm Questions**

Turn in finished papers.

//Objective: Use programming techniques to accumulate a sum.// __Discuss__: **Accumulating a Sum (Scoreboard)**
 * Wednesday May 4, 2011**

__Programs__: At least one of these. Turn in finished papers.
 * Accumulate.frm** VB
 * SumAccumulator.sb** Scratch
 * BeachBallScore.sb** Scratch

//Objective: Use programming techniques to accumulate a sum.//
 * Tuesday May 3, 2011**

__Paper and Pencil__: **DisplayFor.frm Questions on For Next Loops**

__Read__: **Notes: Accumulating a Sum** __Program__: **Accumulate.frm** Turn in finished papers.

//Objective: Trace programs.// Finish back work.
 * Monday May 2, 2011**

__Paper and Pencil__: **DisplayFor.frm Questions on For Next Loops**

Turn in finished papers.

//Objective: Use parameters and for next loops effectively.// http://scratch.mit.edu/projects/Klovira/109633/Klovira/109633
 * Thursday - Friday April 21-29, 2011**

__Scratch Program__: **DecorateEgg2.sb**

Save and upload to Gaggle digital locker.

//__Objective__: Use code to appropriately format numeric output.// __Paper and Pencil__: 1. What will be the output for this For Next loop? 2. Write a For Next loop to print the integers from 21 to 35. __Program__: **Display.frm** Turn in paper and pencil assignments.
 * Wednesday April 20, 2011**

//__Objective__: Use code to appropriately format numeric output.// __Paper and Pencil__: **FormatMenu.frm Questions** __Program__: **Stock.frm** Turn in paper and pencil assignments.
 * Tuesday April 19, 2011**

//__Objective__: Use code to appropriate format numeric output.// __Program__: Finish **FormatMenu.frm** __Paper and Pencil__: **FormatMenu.frm Questions** Turn in paper and pencil assignments.
 * Monday April 18, 2011**

//__Objective__: Use code to appropriate format numeric output.// __Paper and Pencil__: Finish **License Questions** __Program__: **FormatMenu.frm** Turn in paper and pencil assignments.
 * Friday April 15, 2011**

//__Objective__: Use code to appropriate format numeric output.// __Paper and Pencil__: Finish **License Questions** __Program__: **FormatMenu.frm** Turn in paper and pencil assignments.
 * Thursday April 14, 2011**

//__Objective__: Demonstrate understanding of menu control arrays, select case strucuture, and for loops.// __Finish__: **License.frm** __Paper and Pencil__: **License Questions** Finish other assignments. Turn in back assignments such as Cereal Questions...
 * Wednesday April 13, 2011**

//__Objective__: Use a menu control array.// //__Objective__: Use the select case switching structure instead of ElseIf.//
 * Tuesday April 12, 2011**

__Paper and Pencil__: Get into Visual Basic and look at the menus and submenu categories. 1. Are all submenu items able to be used at any time? Yes or No 2. What do submenu items look like when they are not enabled? 3. Look at the View menu. What is to the left of some choices? 4. Under View click on Toolbar. Click on toolbar again. Explain what happens. __Program__: **License.frm** Do not type the ... Use the --> button to make the submenu items. __Paper and Pencil__: 1. Explain what you think a menu control array is**.** 2. What programming structure can be used to do **something different** for each submenu item in the menu control array? (See pages 3 and 4 of the directions for **License.frm**.) a) Select Case b) For Next loop c) MsgBox d) If Then Else 3. What programming structure that is new to us can be used to do the **same thing** with each menu control array item? (See the bottom of page 4 of the directions for **License.frm**.) a) Select Case b) For Next loop c) MsgBox d) If Then Else

Upload programs to your Gaggle digital locker.
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Delete from the desktop. **
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Empty the recycle bin. **

//__Objective__: Use string functions effectively.// //Objective: Use the select case switching structure instead of ElseIf.// __Finish__: WordGame.sb __Program__: __Show Me__: Show me your **WordGame.sb** program and your **ClassSelectCase.frm** program. Upload programs to your Gaggle digital locker.
 * Monday April 11, 2011**
 * ClassSelectCase.frm** (directions in binder)
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Delete from the desktop. **
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Empty the recycle bin. **

//Objective: Use string functions effectively.// What string functions exist in Scratch and where do you find them? Finish other assignments.
 * Friday April 8, 2011**

Quagmire isn't just a cartoon character's name. @http://www.learnersdictionary.com/search/quagmire

__Try out__: **WordGame.sb** without looking at the scripts. This would be a word game for young children. __Scratch Program__: **WordGame.sb** Write the scripts that would produce this game. Show me what you have so far.

//__Objective__: Create menus for programs to make them more versatile and user-friendly.// __Paper and Pencil__: __Paper and Pencil__: Finish the **Cereal Questions** packet. Finish and test your **Cereal.frm** program thoroughly. __Paper and Pencil__: On your Menu Editor Do Now paper, tell what you think the left and right arrows in the menu editor window might be used for. Turn in papers. Upload programs to your Gaggle digital locker.
 * Thursday April 7, 2011**
 * Menu Editor Do Now**
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Delete from the desktop. **
 * <span style="color: #ff0000; font-family: 'Comic Sans MS',cursive;">Empty the recycle bin. **

//__Objective__: Create menus for programs to make them more versatile and user-friendly.// __Paper and Pencil__: Page 1 of the **Cereal Questions** packet. Do the parts of the assignment in THIS order.
 * Wednesday April 6, 2011**

__Paper and Pencil__: Pages 2 and 3 of the **Cereals Questions** packet.

__Program__: ** [|Cereal.frm]** Code the **Cereal.frm** program by using the directions in you notebook.
 * Cereal with a Menu and Invalid Data Messages**

__Paper and Pencil__: Pages 4 and 5 of the **Cereal Questions** packet. Test your **Cereal.frm** program thoroughly Turn in the questions packet.

//__Objective__: Create menus for programs to make them more versatile and user-friendly.// __Paper and Pencil__: **1.** What is one reason for having a menu in a program?
 * Tuesday April 5, 2011**

**2.** What are the 8 menu items at the top of Visual Basic?

**3**. What are the menu items in Microsoft Word? __Program__: **FreefallMenu.frm** Directions are in you notebook. Use your most recent version of Freefall from your Gaggle digital locker. If you don't have one, make a new form. __Program__: **ClassMenu.frm** Add a menu to your **Class.frm** program. __Paper and Pencil__**:** On the same paper as the Do Now While you are in **FreefallMenu.frm**, get into the menu editor.
 * 4**. Do you think you can make adjustments to the menu after you have created it?
 * 5**. By looking at it, what do you think you can do?

// __Objective__: //// Create a program that accepts a student's last name, first name, middle initial, and grade. Trim and concatenate the parts of the name. Output the correct string literal: freshman, sophomore, junior, or senior, based on the grade. Give corrective error messages for bad data. // __Paper and Pencil__: **1.** Which of these is not a synonym of concatenate? A. connect B. attach C. join D. make several into one E. eliminate
 * Monday April 4, 2011**

**2**. What is the concatenation operator?

A. Removes leading or trailing spaces. B. Puts tinsel on the tree. C. Adds color to the textbox. D. Abbreviates words. __Program__: **Class.frm** You may work on this program with a partner or individually. __Paper and Pencil__**:** On the same paper as you Do Now Tell what progress you made on the Class.frm program.
 * 3.** What does the Trim function do?