QUIZ ON DECEMBER 1st, 2004 -------------------------- 1. Be able to write a function to do a certain task. Recall the class examples done as group exercises: Write a function that accepts a string argument and returns its reversed form. You can have your function use as building blocks the Mid() function and the Len() function and For Next loops. Write a function that returns a valid double dice roll between 2 and 12 inclusive. You will need to generate RANDOM numbers and use the appropriate built-in function to simulate the die throw for each die. 2. Write the code to ask the user for their UNI student ID number. Keep asking the user for a valid answer until the answer they give you has a Len() of 6, since all current UNI ID numbers are SIX digits. 3. Write the code to display all of the Neko images stored in the ImageList1 object. The Timer1 object will display an Image every .Interval milliseconds and cycle through the images. Where will an image be displayed? The name of the PictureBox object where the image will be displayed is: nekoFrame The name of the ImageList object is: ImageList1 What is the name of the property that is the collection of the nine Neko images that are stored in ImageList1? Why will you need to use a Static variable? Private Sub Timer1_Tick(ByVal sender ..., ByVal e ...) Handles ... End Sub 4. Given the VB.NET code to print some characters on the Form, SHOW what the output would look like: a. Is it a vertical staircase? b. Is each letter bigger (or smaller) than the previous one? c. Is each line spaced differently than the previous lines were? Example: UNI UNI single spaced UNI double spaced UNI triple spaced UNI four blank lines preceeding UNI five blank lines preceeding d. Or is each line staggered differently with leading blanks? UNI Panthers 0 spaces UNI Panthers 2 spaces UNI Panthers 4 spaces UNI Panthers 6 spaces UNI Panthers 8 spaces UNI Panthers 10 spaces SHOW what the output would look like: You have the code, and only need to understand it and trace it and draw a picture of WHAT THE OUTPUT looks like. SHOW OUTPUT. ---- ---------- 5. Write the code to move an image across the form until it crossed the finish line. To keep it simple, it will NOT have to change the image (no animation is required). It will just move the image. Suppose the PictureBox object is named picSeaBiscuit and we want to see the horse picSeaBiscuit move from the left edge of the form to the right edge of the form under control of a Timer control named tmrHorseRace until it completely crosses the finishLine. Write the code that will cause the picSeaBiscuit object to move and keep moving every tmrHorseRace.Interval milliseconds until it has completely crossed the finishLine object. Have the tmrHorseRace object move 6 units (pixels) every time. ------------ No random amount of movement is required. It will ALWAYS be 6 units. ------ Private Sub tmrHorseRace(..., ...) ... End Sub http://www.cns.uni.edu/~jacobson/c030NET.html links to: http://www.cns.uni.edu/~jacobson/ghost.txt and http://www.cns.uni.edu/~jacobson/waggle.txt 28. What phase of the problem solving/programming process has a focus on testing, debugging and removing slimers from your program? (Answer 1st, 2nd, 3rd or 4th for 1st, 2nd, 3rd or 4th phase on questions 28 to 35, writing very CLEARLY). 29. The waggle dancing bees have the most to do with what phase of the problem solving process, according to the lectures and handouts? 30. What phase of the problem solving/programming process has the most to do with listening? 31. What phase of the problem solving process has the most to do with plans and planning? 32. What phase of the problem solving process has a focus on WHAT instead of HOW? 33. What phase of the problem solving process has a focus on HOW? 34. What phase of the problem solving process asks the questions what is given and what is the goal? 35. What phase of the problem solving process asks is it simple enough and is it adequate?