Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a function called placeBet ( ) . The function will take 3 parameters, the list created in the playerSetup ( ) function, a list

Create a function called placeBet(). The function will take 3 parameters, the list created in the playerSetup() function, a list which contains the currently available bets and a string stating the bet that is being placed. The functions logic needs to do the following:
a. Read in currently available bets the file 'bets.txt' found on the D2L site. The text file contains two columns of values. Each row in file will need to be dissected and the white space removed. The items in the file are separated by tabs.
b. Iterate through the list of available bets. Compare each item in the list to the parameter you passed as a string which states which bet is being placed. The comparison is case insensitive so if I enter 'DOUble FiVe' as my bet, it will still match 'Double Five'.
c. If the bet in the list matches the bet passed as a parameter then append the bet to the player list.
d. If the bet entered by the user is not found in the list of available bets, then the playerlist is left unchanged and returned by the function
e. Like any good casino you will need to track the bets made. Write the player and bet made to a file. If you run the program multiple times then you should see every bet made throughout the multiple runs. To accomplish this use the append option for writing a file. This will create a file and append to it! For reading/writing files look at the slides starting at slide 18. This will provide all the information you need.
f. Return the playerList

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago