Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#9 IN C++ PLEASE If number contains digit, then the function should return true. Otherwise the function should return false. Your program should use this

image text in transcribed

#9 IN C++ PLEASE

If number contains digit, then the function should return true. Otherwise the function should return false. Your program should use this function to find the closest numbers that can be entered on the keypad 9. Your sports league uses the following lottery system to select draft picks for the four worst teams in the league: The last place team gets 20 balls in an urn. The second-to-last place team gets 10 balls in the urn. The third-to-last place team gets 6 balls in the urn. The fourth-to-last place team gets 4 balls in the urn. To determine the first pick in the draft a ball is selected at random. The team owning that ball gets the first pick. The ball is then put back in the urn To determine the second pick in the draft a ball is selected at random. If the ball belongs to the team that got the first pick then it is put back in and the process repeats until a ball is selected that does not belong to the first pick To determine subsequent picks in the draft the process repeats until a ball is selected that belongs to a team that has not already been chosen. Write a function that takes as input which of the four teams have already been granted picks, simulates selecting a ball from the urn according to the lottery rules, and returns the team that belongs to the selected ball You get to choose how to design your function to perform these actions. Write a main function that outputs the draft order (eg, a possible order is second-to-last picks 1, last place picks 2, third-to-last picks 3, and fourth- to-last picks 4). If you change the random seed then the order should differ if you run the program multiple times. For a slightly harder version of the problem, allow the user to input the names of the four teams. The program should then output the team names in the draft order. 10. Do Programming Project 14 from Chapter 3, the Edoc calculator, except write a function that takes the number of candy, Edoc, and Margorp a input parameters and returns the amount of experience that can be earned Modify your program to give advice to the player using the following rules Catching an additional Edoc gives you three Edoc candy . If you can't get any experience points with the provided inputs then If number contains digit, then the function should return true. Otherwise the function should return false. Your program should use this function to find the closest numbers that can be entered on the keypad 9. Your sports league uses the following lottery system to select draft picks for the four worst teams in the league: The last place team gets 20 balls in an urn. The second-to-last place team gets 10 balls in the urn. The third-to-last place team gets 6 balls in the urn. The fourth-to-last place team gets 4 balls in the urn. To determine the first pick in the draft a ball is selected at random. The team owning that ball gets the first pick. The ball is then put back in the urn To determine the second pick in the draft a ball is selected at random. If the ball belongs to the team that got the first pick then it is put back in and the process repeats until a ball is selected that does not belong to the first pick To determine subsequent picks in the draft the process repeats until a ball is selected that belongs to a team that has not already been chosen. Write a function that takes as input which of the four teams have already been granted picks, simulates selecting a ball from the urn according to the lottery rules, and returns the team that belongs to the selected ball You get to choose how to design your function to perform these actions. Write a main function that outputs the draft order (eg, a possible order is second-to-last picks 1, last place picks 2, third-to-last picks 3, and fourth- to-last picks 4). If you change the random seed then the order should differ if you run the program multiple times. For a slightly harder version of the problem, allow the user to input the names of the four teams. The program should then output the team names in the draft order. 10. Do Programming Project 14 from Chapter 3, the Edoc calculator, except write a function that takes the number of candy, Edoc, and Margorp a input parameters and returns the amount of experience that can be earned Modify your program to give advice to the player using the following rules Catching an additional Edoc gives you three Edoc candy . If you can't get any experience points with the provided inputs then

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

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions