Purpose – to practiceWriting and invoking methods
Using multiple arguments
· Creating and using a method in another class
Problem Statement
Code a Java program and a method.
Phase 1
• In the Main(), Ask the user to enter an amount they wish to bet and which game they want to play.
Pass the bet and game as an arguments into a method
Your method will validate based on these rules
o if the game is poker, the bet amount must be in the range of $50 to 500.
o any other game, the bet amount must be in the range $10 to $100
Return the validated bet amount to the main().
Print a message in the main. “Thank you for your bet of $
for the game of
Phase 2 – Required
Invoking a Method from another Class
. Move the method out of your program Class and into a file in the same folder as your Main().
Phase 3 – Optional Challenge
• Write the bet amount to a .txt file.
.
Required Material to be Submitted to Canvas
A copy of your MAIN program source code saved to a .TXT file
• A copy of your methods CLASS source code (ex. MyMethods.class)
• A screen capture of your program being executed, with the result showing
Phase 3 – Optional Challenge
Write the bet amount to a .txt file.
nts
Required Material to be Submitted to Canvas
• A copy of your MAIN program source code saved to a .TXT file
A copy of your methods CLASS source code (ex. MyMethods.class)
. A screen capture of your program being executed, with the result showing
Your source code must include the following comment code at the beginning of your program:
// Lab #1
// Name:your name
PS
4/7
Lab 5c
ing
dations
Criteria
Ratings
Pts
invoke method from another class
3 pts
Set up method header
3 pts
Return variable to main()
2 pts
Print message in the Main()
1 pts
Overall
1 pts
Total Points: 10
< Previous
Next >
M +
F3
D
to
F4
C
PrtSc
F5
F6
F7
F8
F9
F10
F11
F12
%
&
*
#
3
in t
&
4
(
9
5
6
7
8
0
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Achiever Papers is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Dissertation Writing Service Works
First, you will need to complete an order form. It's not difficult but, if anything is unclear, you may always chat with us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order form
Once we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignment
As soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download