Contact Us
Projects | Assignments
sellfycode@gmail.com
More
Get Homework Help
English
Español
Português
Français
Deutsch
Italiano
Русский
close
Contact Us
Projects | Assignments
sellfycode@gmail.com
Starting from:
$20
Add to cart
Program 2 Solution
This is graphical program
Main Idea: You are using if/else or else if statements to make decisions.
· In this program, you are going to create a simulated Baseball swing. You are going to determine whether a hit is made or not.
· You are going to build a graphical program that has a
o Frame
o Panel
o and Baseball class.
§ In the Baseball class, you should have four attributes,
· Hit
· Foul
· Strike
· And ball
o Your panel should contain
§ a label for a picture
§ a label for the number of hits
§ a label for the number of fouls
§ and a label for the number of strikes
§ a label for the number of balls
§ and a button.
· When the button is clicked
o it should randomly decide if it is a hit
o a foul ball
o ball
o or a strike
§ The correct image (of your choice) should appear indicating this.
· If it is a hit
o increase the hit attribute
· If it is a foul
o increase the foul attribute
· If it is a ball
o increase the ball attribute
· If it is a strike
o increase the strike attribute.
When the user presses the button, update the display with the overall number of hits, fouls, balls, and strikes.
Starting from:
$20
Add to cart
1 file (145.9KB)
More products
CS305 Homework 3 Solution
$34.99
Add to cart
CS305 Homework2 Solution
$34.99
Add to cart
CS305 Homework1 Solution
$24.99
Add to cart