In the game of Golf, golfers have a collection of tools that they used to get...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the game of Golf, golfers have a collection of tools that they used to get the golf ball from the tee box to the hole. These tools are called golf clubs. A golfer is allowed to carry these clubs in his golf bag and free to decide what the final makeup ultimately looks like. The diagram in Figure A shows the 3 categories of golf clubs. Putter Height Shaft Grip Wood Putter JPP Height Putter heads has different styles like blade, half-mallet, and mallet. The putter is used to roll the ball forward into the hole. Shaft Grip Iron Figure A ] Woods are bigger and rounder clubheads that are designed to shoot the ball over long distances. The size of the head is measured in cubic centimetre (cc). Height of clubhead Shaft Each club is made up of: • Clubhead: This part of the club is located at the bottom. o All heads have loft and weight. Loft is the angle created between the face of the clubhead and the ground and will be different for every club. The loft and how fast the clubhead is swung will have a direct impact on the distance the ball travels. o The following are the 3 common types of clubhead: Wood Grip Iron Length of golf club Made of hard (cast) or soft (forged) iron. Irons are the most represented clubs in a golfer's bag, numbering from 3-iron to 9-iron, pitching and sand wedge. • Grip: Top part of the club, where golfers will hold. Can be rubber, leather or synthetic. Shaft: Middle part, either graphite or steel, with different flex. Bottom end of the shaft is connected to the clubhead, and the top part is installed with the grip. Question 4 (20 marks) A Golf Distance Calculator (GDC) GUI allowed golfers to check how far they can hit the golf ball when they provide their swing speed, club loft and club length. (a) Develop and implement the GDC GUI application as shown in Figure 4. GDC-xxxx Swing Speed: Club Length: Club Loft (degree): Calculate mph Okph O inch cm Clear Figure X (b) • Title of the GUI MUST include your name (replace XXXX with your name). • The layout is recommended, but you can define any suitable design. . These are the proposed widgets: o Label "Swing Speed:" to guide user input (Entry) on the swing speed. o Radiobuttons to allow user to select the metric for the swing speed. o Label "Club Length:" to guide user input (Entry) on the club length. o Radiobuttons to allow user to select the metric for the length. o Label "Club Loft (degree):" to guide user input (Entry) on the club loft. o 2 Buttons "Calculate" (enabled) and "Clear" (disabled). o Scrolled Text (disabled) to display the distance calculated or any messages. (9 marks) Implement event handling so that the GDC GUI can respond to left button clicks on both buttons. To calculate distance, the formula is: Distance (280 - abs (length-48)*10 - abs (loft-10) *1.25) * SwingSpeed/96 where length and SwingSpeed are in inches and mph respectively. For metric conversion, o use 1 kph to 0.621371 mph, and o use 1 cm to 0.393701 inch In addition, your GUI program should also perform the following input checks: • Ensure swing speed is a positive number. • Ensure length must be within 30 to 48 inches. Ensure loft must be within 8 to 64 degrees. Below are demonstrations of the GDC GUI application: GDC-XXXX 105.2 Omph Okph O inch cm Swing Speed: Club Length: 45.75 Club Loft (degree): 10.5 Calculate Clear Estimated Distance: 281 yards. When user enters swing speed, loft, length and click the "Calculate" button, your program will compute the distance in yards based on the formula give. Round/format the computed distance to nearest whole number before displaying. "Clear" button is also enabled. whenever the ScrolledText is populated with any text. GDC-xxxx Swing Speed: 150 Club Length: 115 Club Loft (degree): 10.5 Calculate GDC-xxxxxx Estimated Distance: 281 yards. Estimated Distance: 245 yards Swing Speed: Club Length: 100 Club Loft (degree): 10.5 Calculate axe Omph Okph inch 0 cm Clear GDC-Xxxxx Swing Speed: Club Length: Club Loft (degree): Calculate mph Okph inch cm Clear Error(s) in input values Please <clear> and try again Omph Okph O inch cm Clear Your program should display error messages in the scrolled Text when either of the swing speed, club loft and club length data entry contain: empty or no data value non-numeric values - - negative numbers values not within the range shown in the input checks above When "Clear" button is clicked, your program should: clear the 3 text fields clear the Scrolled Text default selection of the radiobuttons to "mph" and "inch" disable the "Clear" button Apply Object oriented principles when writing the GUI program. The program must be written as a class, and you can submit your codes for Q4(a) together with Q4(b). Submit at least 4 set of screenshots: displaying distance calculated for 3 different set of inputs, and one showing error data entry for swing speed. (11 marks) Appendix A The following 2 files are samples to be used for creating GolfSet objects. File 1: "B17-Robin.txt" DRIVER, Wood, 10.5, 203,450, 44.25, 68, Graphite, R, 0.6, 62, Rubber 3-WOOD, Wood, 14.5, 220,310,42.5, 79, Graphite, R,0.6, 62, Rubber 5-WOOD, Wood, 17.5, 240, 280, 41.5,85, Graphite, R,0.6, 62, Rubber 4-IRON, Iron, 23.0, 260, Cast, 38.5, 100,Steel, R, 0.6, 62, Rubber 5-IRON, Iron, 26.5, 262, Cast, 38.0, 102,Steel, R, 0.6, 62, Rubber 6-IRON, Iron, 30.0, 264, Cast, 37.5,104,Steel, R, 0.6, 62, Rubber 7-IRON, Iron, 33.5, 266, Cast, 37.0,106,Steel,R, 0.6, 62, Rubber 8-IRON, Iron, 37.0, 268, Cast, 36.5,108,Steel, R, 0.6, 62, Rubber 9-IRON, Iron, 40.5, 270, Cast, 36.0,110, Steel, R, 0.6, 62, Rubber PW, Iron, 45.0, 270, Cast, 35.5, 112, Steel, R, 0.6, 62, Rubber SW, Iron, 54.0, 270, Cast, 35.25, 114,Steel, R, 0.6,62, Rubber LW, Iron, 60.0, 270, Cast, 35.0, 116, Steel, R, 0.6, 62, Rubber Anser, Putter, 3.0, 380, Mallet, 34.0, 120, Steel, S, 0.6, 62, Rubber File 2: "A20-Marvin.txt" DRIVER, Wood, 10.5,203,450,44.25,68, Graphite, R, 0.6, 62, Rubber 5-WOOD, Wood, 17.5,240,280,41.5, 85, Graphite, R,0.6,62, Rubber 5-IRON, Iron, 26.5,262, Cast, 38.0, 102,Steel, S, 0.6, 62, Rubber 6-IRON, Iron, 30.0, 264, Cast, 37.5,104,Steel, 5,0.6, 62, Rubber 7-IRON, Iron, 33.5, 266, Cast, 37.0,106,Steel, S, 0.6, 62, Rubber 8-IRON, Iron, 37.0, 268, Cast, 36.5,108,Steel, S, 0.6, 62, Rubber 9-IRON, Iron, 40.5, 270, Cast, 36.0, 110, Steel,S, 0.6, 62, Rubber PW, Iron, 45.0, 270, Cast, 35.75, 112, Steel, S, 0.6,62, Rubber GW, Iron, 50.0, 270, Cast, 35.5, 113, Steel, S, 0.6, 62, Rubber SW, Iron, 54.0, 270, Cast, 35.25, 114, Steel, S, 0.6,62, Rubber LW, Iron, 58.0, 270, Cast, 35.0, 115,Steel, S, 0.6, 62, Rubber ODYSSEY#7, Putter, 3.0, 365, Mallet, 34.0, 120, Steel, S, 0.6, 62, Rubber Format of the file: Each line of the file contains information in this order: <label>, <clubtype>,<loft>, <weight>,<size/material/style>,<length>, <weight>, <mat erial>, <flex>, <diameter>, <weight>, <material> ClubHead information, Shaft information, Grip information Note: <size/material/style> depends on <clubtype> Line 1 of the file represent club 1, line 2 represent club 2 and so on. In the game of Golf, golfers have a collection of tools that they used to get the golf ball from the tee box to the hole. These tools are called golf clubs. A golfer is allowed to carry these clubs in his golf bag and free to decide what the final makeup ultimately looks like. The diagram in Figure A shows the 3 categories of golf clubs. Putter Height Shaft Grip Wood Putter JPP Height Putter heads has different styles like blade, half-mallet, and mallet. The putter is used to roll the ball forward into the hole. Shaft Grip Iron Figure A ] Woods are bigger and rounder clubheads that are designed to shoot the ball over long distances. The size of the head is measured in cubic centimetre (cc). Height of clubhead Shaft Each club is made up of: • Clubhead: This part of the club is located at the bottom. o All heads have loft and weight. Loft is the angle created between the face of the clubhead and the ground and will be different for every club. The loft and how fast the clubhead is swung will have a direct impact on the distance the ball travels. o The following are the 3 common types of clubhead: Wood Grip Iron Length of golf club Made of hard (cast) or soft (forged) iron. Irons are the most represented clubs in a golfer's bag, numbering from 3-iron to 9-iron, pitching and sand wedge. • Grip: Top part of the club, where golfers will hold. Can be rubber, leather or synthetic. Shaft: Middle part, either graphite or steel, with different flex. Bottom end of the shaft is connected to the clubhead, and the top part is installed with the grip. Question 4 (20 marks) A Golf Distance Calculator (GDC) GUI allowed golfers to check how far they can hit the golf ball when they provide their swing speed, club loft and club length. (a) Develop and implement the GDC GUI application as shown in Figure 4. GDC-xxxx Swing Speed: Club Length: Club Loft (degree): Calculate mph Okph O inch cm Clear Figure X (b) • Title of the GUI MUST include your name (replace XXXX with your name). • The layout is recommended, but you can define any suitable design. . These are the proposed widgets: o Label "Swing Speed:" to guide user input (Entry) on the swing speed. o Radiobuttons to allow user to select the metric for the swing speed. o Label "Club Length:" to guide user input (Entry) on the club length. o Radiobuttons to allow user to select the metric for the length. o Label "Club Loft (degree):" to guide user input (Entry) on the club loft. o 2 Buttons "Calculate" (enabled) and "Clear" (disabled). o Scrolled Text (disabled) to display the distance calculated or any messages. (9 marks) Implement event handling so that the GDC GUI can respond to left button clicks on both buttons. To calculate distance, the formula is: Distance (280 - abs (length-48)*10 - abs (loft-10) *1.25) * SwingSpeed/96 where length and SwingSpeed are in inches and mph respectively. For metric conversion, o use 1 kph to 0.621371 mph, and o use 1 cm to 0.393701 inch In addition, your GUI program should also perform the following input checks: • Ensure swing speed is a positive number. • Ensure length must be within 30 to 48 inches. Ensure loft must be within 8 to 64 degrees. Below are demonstrations of the GDC GUI application: GDC-XXXX 105.2 Omph Okph O inch cm Swing Speed: Club Length: 45.75 Club Loft (degree): 10.5 Calculate Clear Estimated Distance: 281 yards. When user enters swing speed, loft, length and click the "Calculate" button, your program will compute the distance in yards based on the formula give. Round/format the computed distance to nearest whole number before displaying. "Clear" button is also enabled. whenever the ScrolledText is populated with any text. GDC-xxxx Swing Speed: 150 Club Length: 115 Club Loft (degree): 10.5 Calculate GDC-xxxxxx Estimated Distance: 281 yards. Estimated Distance: 245 yards Swing Speed: Club Length: 100 Club Loft (degree): 10.5 Calculate axe Omph Okph inch 0 cm Clear GDC-Xxxxx Swing Speed: Club Length: Club Loft (degree): Calculate mph Okph inch cm Clear Error(s) in input values Please <clear> and try again Omph Okph O inch cm Clear Your program should display error messages in the scrolled Text when either of the swing speed, club loft and club length data entry contain: empty or no data value non-numeric values - - negative numbers values not within the range shown in the input checks above When "Clear" button is clicked, your program should: clear the 3 text fields clear the Scrolled Text default selection of the radiobuttons to "mph" and "inch" disable the "Clear" button Apply Object oriented principles when writing the GUI program. The program must be written as a class, and you can submit your codes for Q4(a) together with Q4(b). Submit at least 4 set of screenshots: displaying distance calculated for 3 different set of inputs, and one showing error data entry for swing speed. (11 marks) Appendix A The following 2 files are samples to be used for creating GolfSet objects. File 1: "B17-Robin.txt" DRIVER, Wood, 10.5, 203,450, 44.25, 68, Graphite, R, 0.6, 62, Rubber 3-WOOD, Wood, 14.5, 220,310,42.5, 79, Graphite, R,0.6, 62, Rubber 5-WOOD, Wood, 17.5, 240, 280, 41.5,85, Graphite, R,0.6, 62, Rubber 4-IRON, Iron, 23.0, 260, Cast, 38.5, 100,Steel, R, 0.6, 62, Rubber 5-IRON, Iron, 26.5, 262, Cast, 38.0, 102,Steel, R, 0.6, 62, Rubber 6-IRON, Iron, 30.0, 264, Cast, 37.5,104,Steel, R, 0.6, 62, Rubber 7-IRON, Iron, 33.5, 266, Cast, 37.0,106,Steel,R, 0.6, 62, Rubber 8-IRON, Iron, 37.0, 268, Cast, 36.5,108,Steel, R, 0.6, 62, Rubber 9-IRON, Iron, 40.5, 270, Cast, 36.0,110, Steel, R, 0.6, 62, Rubber PW, Iron, 45.0, 270, Cast, 35.5, 112, Steel, R, 0.6, 62, Rubber SW, Iron, 54.0, 270, Cast, 35.25, 114,Steel, R, 0.6,62, Rubber LW, Iron, 60.0, 270, Cast, 35.0, 116, Steel, R, 0.6, 62, Rubber Anser, Putter, 3.0, 380, Mallet, 34.0, 120, Steel, S, 0.6, 62, Rubber File 2: "A20-Marvin.txt" DRIVER, Wood, 10.5,203,450,44.25,68, Graphite, R, 0.6, 62, Rubber 5-WOOD, Wood, 17.5,240,280,41.5, 85, Graphite, R,0.6,62, Rubber 5-IRON, Iron, 26.5,262, Cast, 38.0, 102,Steel, S, 0.6, 62, Rubber 6-IRON, Iron, 30.0, 264, Cast, 37.5,104,Steel, 5,0.6, 62, Rubber 7-IRON, Iron, 33.5, 266, Cast, 37.0,106,Steel, S, 0.6, 62, Rubber 8-IRON, Iron, 37.0, 268, Cast, 36.5,108,Steel, S, 0.6, 62, Rubber 9-IRON, Iron, 40.5, 270, Cast, 36.0, 110, Steel,S, 0.6, 62, Rubber PW, Iron, 45.0, 270, Cast, 35.75, 112, Steel, S, 0.6,62, Rubber GW, Iron, 50.0, 270, Cast, 35.5, 113, Steel, S, 0.6, 62, Rubber SW, Iron, 54.0, 270, Cast, 35.25, 114, Steel, S, 0.6,62, Rubber LW, Iron, 58.0, 270, Cast, 35.0, 115,Steel, S, 0.6, 62, Rubber ODYSSEY#7, Putter, 3.0, 365, Mallet, 34.0, 120, Steel, S, 0.6, 62, Rubber Format of the file: Each line of the file contains information in this order: <label>, <clubtype>,<loft>, <weight>,<size/material/style>,<length>, <weight>, <mat erial>, <flex>, <diameter>, <weight>, <material> ClubHead information, Shaft information, Grip information Note: <size/material/style> depends on <clubtype> Line 1 of the file represent club 1, line 2 represent club 2 and so on.
Expert Answer:
Answer rating: 100% (QA)
Inheritance It is an OOP concept where one class inherits all the methods and properties of another ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Regal Cycle Company manufactures three types of bicycles-a dirt bike, a mountain bike, and a racing bike. Data on sales and expenses for the past quarter follow: Sales Variable manufacturing and...
-
Jupiter Insurance Co. is an insurance company that began operations on January 1, 2015. The following transactions relate to held-for-trading investments acquired by Jupiter Insurance Co., which has...
-
Marketing companies are turning to mobile media for new opportunities. A recent study by IBM showed that 46% of all marketers conduct transactions on mobile websites. Suppose a random sample of 300...
-
A falling rock hits the ground at a speed of \(16 \mathrm{~m} / \mathrm{s}\). How many seconds were needed for the rock to fall the last \(12 \mathrm{~m}\) ?
-
Hayes Warehouse distributes hardback books to retail stores and extends credit terms of 2/10, n/30 to all of its customers. During the month of June, the following merchandising transactions...
-
Activity Pools Machining Setup Quality control Estimated Total Cost $ 639,600 Estimated Cost Driver 20,500 machine hours 101,625 157,700 500 batches 950 inspections Required: Suppose the Luxury boat...
-
Ryan Ross (111-11-1112), Oscar Omega (222-22-2222), Clark Carey (333-33-3333), and Kim Kardigan (444-44-4444) are equal active members in ROCK the Ages LLC. ROCK serves as agent and manager for...
-
points) with he allenine nsoluble) layers. Describe the process that you observed and name the process. ihis i fram is allows the (a s41paded in the f the futty ucid altruct p.Hin has hinh arfinita...
-
What are the differences among types of life insurance?
-
Explain the potential supplyside effects of the VAT reduction on the Swiss economy. In 2017, Swiss voters rejected the continued funding of the 2020 OldAge and Survivors Insurance reform. As a...
-
What special roles do the Budget Committees of the House of Representatives and the Senate play in creating fiscal policy?
-
What are the contractual elements of an insurance agreement?
-
The economy is in a recession, and the recessionary gap is large. a. Describe the discretionary and automatic fiscal policy actions that might occur. b. Describe a discretionary fiscal stimulus...
-
Pata Ltd. is a small scale company which manufactures three products namely; Xee, Yew and Deez. The company has two departments: Assembly and Machinery which require the same level of labour...
-
Discuss whether responsible human resources management should apply different standards for the home company and suppliers, for developed countries and developing countries, and for large companies...
-
A binomial probability experiment is conducted with the given parameters. Compute the probability of x successes in the n independent trials of the experiment. n = 50, p = 0.02, x = 3
-
A linear rotary bearing is designed so that the distance between the retaining rings is 0.875 inch. The quality-control manager suspects that the manufacturing process needs to be recalibrated...
-
The National Association of Home Builders in conjunction with Wells Fargo compiles a housing affordability index called the Housing Opportunity Index (HOI). The index represents the proportion of...
-
Suppose you are considering investing in a Roth IRA. You collect the data in Table 12, which represent the five-year rate of return (in percent, adjusted for sales charges) for a simple random sample...
-
Construct a frequency and relative frequency histogram of the five-year rate of- return data discussed in Example 3. Approach To draw the frequency histogram, use the frequency distribution in Table...
-
Construct a frequency and relative frequency histogram of the five-year rate of- return data discussed in Example 3. Approach We will use StatCrunch to construct the frequency and relative frequency...
Study smarter with the SolutionInn App