subject

LotteryChecker() is a function which will help determine the prize money of a lottery guess. It will take in the lottery number and the user guess as input, updates the variable prizeMoney accordingly and returns it. You can assume both lottery number and the user guess are two-digit numbers, from 10 to 99, both inclusive. Python solution?
The prize money is assigned based on the following rules:

If only one digit in the user’s guess matches any digit in the lottery number, the award is $1,000

If both the digits in the user’s guess match both the digits in the lottery number but in the wrong order, the award is $3,000.

If the user’s guess matches the lottery number in the exact order, the award is $10,000

The common mistakes include logic errors ( e. g, forgetting some cases). There is no problem with the grader, please think about whether your method covers all cases carefully.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 24.06.2019 14:00
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
question
Computers and Technology, 24.06.2019 23:50
What is your fav video game currently: a) roblox b) fortnite c) apex legends d) pubg
Answers: 2
question
Computers and Technology, 25.06.2019 08:00
A( the heart of an information system, is a collection of all relevant facts organized in a series of integrated files.
Answers: 1
You know the right answer?
LotteryChecker() is a function which will help determine the prize money of a lottery guess. It will...
Questions
question
Health, 23.03.2021 22:10
question
Mathematics, 23.03.2021 22:10
question
Biology, 23.03.2021 22:10
question
Mathematics, 23.03.2021 22:10
Questions on the website: 13722363