0
I need help with the super sale code coach challenge. My code is accepted for 6 out of 7 test cases
Iām trying to do the super sale code challenge. My code is failing āTest case 4ā but passes the other 6 Test cases. Not sure what Iām missing. Iāve spent all day making tweaks and I canāt figure it out. It doesnāt help that the Test case is locked so I canāt see whatās being inputted. Hereās my code: https://code.sololearn.com/cP8Ogq45h22n/?ref=app
4 Answers
0
This is the challenge:
Your favorite store is having a sale! You pay full price for the most expensive item that you get, but then you get 30% off of everything else in your purchase! How much are you going to save?
Sales tax is 7%.
Also, you leave anything below a dollar in your saving as a tip to the seller. If your saving is a round amount, you don't leave any tips.
Task:
Given the prices of items you want to purchase, determine how much you will save during your shopping!
Input Format:
A string of numbers separated by commas that represents the prices for all of the items that you want to purchase (without tax).
Output Format:
An integer number that represents the total savings that you got for shopping during the sale.
0
Hello Josh Rhodes, I think you are little rushed again.
Take a closer look on the sample input:
Sample Input: 100.25, 80.99, 40.00
Compare to your code, is there something off?
0
Wong Hei Ming I changed āintā to āfloatā in the first for loop and that did the trick!
0
Josh Rhodes, I think it is best to leave the code as it was so others can understand what is the problem in the future.