Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Grade 12 Programming Assignment - Bylaw (Lot Size) Question 1 Imagine that we want to determine if a proposed house plan will fit onto a
Grade 12 Programming Assignment - Bylaw (Lot Size) Question 1 Imagine that we want to determine if a proposed house plan will fit onto a given housing lot and remain in compliance with the local building code. All lots and houses that we will considerare rectangular or square. For a house to meet the building code it must 1. Allow for a minimum clearance of 2m between the house and lot on all sides of the house. il. Occupy at least 25% of the lot area. ill. Occupy no more than 40% of the lot area When we know the size of the lot and size of the house. For each house, there are four possibilities. The house can fit, it may occupy too much of the lot, it may occupy too little of the lot or it may not allow for the appropriate lot line clearance. Suppose, for example, that the lot is 20 x 50 m (or 50 x 20 m) a. If a house is 16 x 18 m (or 18 x 16 m), it fits the lot. b. If a house is 17 x 30 m (or 30 x 17 m), it does not allow for the lot line clearance c. If a house is 15 x 14 m (or 14 x 15 m), it is too small. d. If a house is 16 x 40 m (or 16 x 40 m), it is too large. You are to create an interface in VB that reads in the size ofthe lot and that then repeatedly reads in house sizes until 0 0 is entered. For each house size entered, your program should output a message indicating which of the four possibilities applies. Your output should be displayed in a list box. A Sample is shown here: Building Lot Size 20 x 50m House Size 16 x 18 House Size 17 x 30 House Size 15 x 14 House Size 16 x 40 Fits the Lot Does not Meet Clearance Requirements Does not Meet Min Area Requirements Exceeds Max Area Requirements Assume all lot and house sizes are entered as Width x Length. Some error checking is required. If the lot length and lot width entered are not both greater than zero, your program should output an error message and have the user try again (and so on until valid dimensions are obtained). Bad house dimensions should also be rejected. Unless the length and width are both zero (our special "sentinel" combination), both the length and width must be greater than zero. When 00 is entered you program should end. Save your project as BylawHome Advanced - Add a drawing representation of the lot and house Programming project notes. (For fluid movement consider placing the code to move your object inside a timer. Remember to enable and disable timer accordingly to avoid endless loops. Ife.KeyCode = Keys Right Then Picture Boxl.Location New Point (PictureBoxl.Location.X +5, PictureBoxl.Location. Y) Elself e.KeyCode = Keys Left Then PictureBoxl.Location = New Point (PictureBoxl.Location.X-5, PictureBoxl.Location. Y) Elself e.KeyCode = Keys Down Then Picture Boxl.Location = New Point (PictureBoxl.Location. X, PictureBoxl.Location. Y+5) Elself e.KeyCode = Keys .Up Then Picture Boxl.Location New point (PictureBoxl.Location. X, PictureBoxl.Location. Y - 5) End If 'To create an object array "Under general declarations Dim walls(4) As PictureBox "Inside a form load walls(1) PictureBoxl walls(2) PictureBox2 walls(3) PictureBox3 walls(4)= Picture Box4 Grade 12 Programming Assignment - Bylaw (Lot Size) Question 1 Imagine that we want to determine if a proposed house plan will fit onto a given housing lot and remain in compliance with the local building code. All lots and houses that we will considerare rectangular or square. For a house to meet the building code it must 1. Allow for a minimum clearance of 2m between the house and lot on all sides of the house. il. Occupy at least 25% of the lot area. ill. Occupy no more than 40% of the lot area When we know the size of the lot and size of the house. For each house, there are four possibilities. The house can fit, it may occupy too much of the lot, it may occupy too little of the lot or it may not allow for the appropriate lot line clearance. Suppose, for example, that the lot is 20 x 50 m (or 50 x 20 m) a. If a house is 16 x 18 m (or 18 x 16 m), it fits the lot. b. If a house is 17 x 30 m (or 30 x 17 m), it does not allow for the lot line clearance c. If a house is 15 x 14 m (or 14 x 15 m), it is too small. d. If a house is 16 x 40 m (or 16 x 40 m), it is too large. You are to create an interface in VB that reads in the size ofthe lot and that then repeatedly reads in house sizes until 0 0 is entered. For each house size entered, your program should output a message indicating which of the four possibilities applies. Your output should be displayed in a list box. A Sample is shown here: Building Lot Size 20 x 50m House Size 16 x 18 House Size 17 x 30 House Size 15 x 14 House Size 16 x 40 Fits the Lot Does not Meet Clearance Requirements Does not Meet Min Area Requirements Exceeds Max Area Requirements Assume all lot and house sizes are entered as Width x Length. Some error checking is required. If the lot length and lot width entered are not both greater than zero, your program should output an error message and have the user try again (and so on until valid dimensions are obtained). Bad house dimensions should also be rejected. Unless the length and width are both zero (our special "sentinel" combination), both the length and width must be greater than zero. When 00 is entered you program should end. Save your project as BylawHome Advanced - Add a drawing representation of the lot and house Programming project notes. (For fluid movement consider placing the code to move your object inside a timer. Remember to enable and disable timer accordingly to avoid endless loops. Ife.KeyCode = Keys Right Then Picture Boxl.Location New Point (PictureBoxl.Location.X +5, PictureBoxl.Location. Y) Elself e.KeyCode = Keys Left Then PictureBoxl.Location = New Point (PictureBoxl.Location.X-5, PictureBoxl.Location. Y) Elself e.KeyCode = Keys Down Then Picture Boxl.Location = New Point (PictureBoxl.Location. X, PictureBoxl.Location. Y+5) Elself e.KeyCode = Keys .Up Then Picture Boxl.Location New point (PictureBoxl.Location. X, PictureBoxl.Location. Y - 5) End If 'To create an object array "Under general declarations Dim walls(4) As PictureBox "Inside a form load walls(1) PictureBoxl walls(2) PictureBox2 walls(3) PictureBox3 walls(4)= Picture Box4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started