DSC 340 - Business Information Systems

Individual Homework #2, due Thursday 10/11 Submitting the HW: turn it in your printed VBA program (only the code) at the beginning of class on Thursday—no email submissions. This assignment gives you practice with Excel VBA and leverage most of the coding ideas that we summarized in Thursday’s (10/4) class example. For our safety, Disney has scientifically determined the minimum allowable height at which one can safely ride each Disney attraction. We will specifically focus on the Park in California. Consider its ride for example. This deceptively safe-sounding ride, seen in action in the revolving images here: http://disneyland.disney.go.com/disneyland/autopia/, is apparently quite unsafe for many potential riders. Thus, Disney prohibits all riders below <54” in height without adult supervision, due to the danger of this ride. Similar safeguards are in place for several rides at , to protect the public safety. Here is a summary of what you can’t ride, based on your height in inches.

Your What you can’t ride height >54” Nothing 46” - Autopia (w/o adult) and 54” 42” – Autopia (w/o adult), Indiana Jones, and Bobsleds 46” 40” – Autopia (w/o adult), Indiana Jones, Bobsleds, the “3 mountains” (Big 42” Thunder, Space, and Splash), and Star Tours 35” – Autopia (w/o adult), Indiana Jones, Bobsleds, the “3 mountains” (Big 40” Thunder, Space, and Splash), Star Tours, and Gadget’s Go Coaster 32” – Autopia (w/o adult), Indiana Jones, Bobsleds, the “3 mountains” (Big 35” Thunder, Space, and Splash), Star Tours, Gadget’s Go Coaster 0” – Autopia, Indiana Jones, Bobsleds, the “3 mountains” (Big Thunder, Space, 32” and Splash), Star Tours, Gadget’s Go Coaster The information in the above table can potentially be quite confusing to European personages or those from other non-Metric speaking countries. Therefore, to promote public safety, our task is to develop VBA code that will resolve this confusion.

DEPARTMENT OF DECISION SCIENCES

1208 University of Oregon, Eugene OR 97403-1208 T (541) 346-3306 F (541) 346-0073 lcb.uoregon.edu

DSC 340 - Business Information Systems

Specifically, upon the press of a button in an Excel Workbook, your Centimeter-based ride-height-banning calculator should do the following: • Provide the user with a dialog box prompting the user to enter their height in centimeters (cm) • After clicking “OK” the system should then show the user a message box that shows their height converted as both “X feet Y inches” and simply “X*12 + Y inches.” For example: “You are 5 feet 2 inches tall, or, equivalently 62 inches.” • After clicking “OK” (again) the system should then show the user a message box that shows the appropriate ride-banning information from the table above. Don’t show the whole table; rather, only the row that corresponds to this users height. Coding requirements and hints: Your code must be based on the structure of the drinking/voting code we discussed in class. Notice that code had 4 parts: 1. a class named timeInYMD that has three attributes: Years, Months, and Days. 2. an Age(Date1,Date2) function that takes two dates and returns a timeInYMD object with its calculated Years, Months, and Days attributes. 3. the ProcessUserDOB() sub that showed a dialog box to get the user’s DOB, then calls the Age() calculating function, shows that age calculation in a message box, and then calls another sub (below) to show what the user can’t legally do. 4. the ReportDrinkingVotingStatus(yourAge) sub reports via a message box what the user can’t legally do, based on their age. Your VBA code for the HW#2 project must have the analogous 4 parts: 1. a class named heightInFeetInches that has two attributes: Feet, and Inches. 2. a HeightConverter(heightInCm As Integer) function that returns a heightInFeetInches object with its calculated Feet and Inches attributes. 3. a ProcessUserHeight() sub that showed a dialog box to get the user’s height in cm, then calls the HeightConverter() calculating function, shows that height calculation in a message box, and then calls another sub (below) to show what the user can’t legally do. 4. the ReportRideBanningStatus(yourHeight) sub reports via a message box what the user can’t legally do, based on their age. The “hints” part of this is to look carefully at the direct parallels between these. We are performing the same basic steps but converting from cm to feet-inches instead of converting from two dates to years-months-days.

DEPARTMENT OF DECISION SCIENCES

1208 University of Oregon, Eugene OR 97403-1208 T (541) 346-3306 F (541) 346-0073 lcb.uoregon.edu