subject

Imagine a gas station that offers a rewards card program. When a customer buys gas, he or she is rewarded with used to purchase other goods. Write a function gas. reward) that takes the following arguments, in this order 1. currentpoints: the current rewards points (an integer) on the customer's gas rewards card 2. gas. type: the type of gasoline purchased (a string), which is one of the following Regular: $2.65/ gallon Plus':$2.90/ gallon . 'Premium $3.10/ gallon 3. money_spent: the amount of dollars spent on gas for a particular transaction. This number is needed to As previously mentioned, after each gas refill, the customer gets a certain amount of rewards points. The function 1. Normally, 5 points are rewarded for everyfull dollar spent. For example, $6.83 spent will result in 5x6=30 compute how many gallons of gas were purchased. calculates and returns the updated, new total rewards points of the customer. The rewards rules are as follows: new reward points. Hint: given a floating-point variable x, the code int (x) will truncate x, thereby giving only the integer part of x: integer part- int (x) 2 If at least 10 gallons of gas were purchased, the customer will be rewarded 200 reward points 3. If at least 15 gallons of gas were purchased, the customer will be rewarded 400 reward points 4. If at least 20 gallons of gas were purchased, the customer will be rewarded 550 reward points Note: Only one of the above rules can be applied per transaction. For example, if a customer bought 16 gallons of gas, he/she will get 400 and only 400 reward points. Rule is applied for purchases of less than 10 gallons Special Cases: Below are some special cases that the function must handle. Your code should check for these special cases in this order

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
You know the right answer?
Imagine a gas station that offers a rewards card program. When a customer buys gas, he or she is rew...
Questions
question
Biology, 11.10.2019 18:30
question
Social Studies, 11.10.2019 18:30
question
Mathematics, 11.10.2019 18:30
Questions on the website: 13722362