0

Help plz me again )i want to see my mistake(Solved) (TNX)

You sell souvenir kaleidoscopes at a gift shop, and if a customer buys more than one, they get a 10% discount on all of them! Given the total number of kaleidoscopes that a customer buys, let them know what their total will be. Tax is 7%. All of your kaleidoscopes cost the same amount, 5.00. Task: Take the number of kaleidoscopes that a customer buys and output their total cost including tax and any discounts. Input Format: An integer value that represents the number of kaleidoscopes that a customer orders. Output Format: A number that represents the total purchase price to two decimal places. Sample Input: 4 Sample Output: 19.26 https://code.sololearn.com/cP56prrRq0hi/?ref=app

4th Mar 2021, 8:40 PM
Nazik Sidorchuk
Nazik Sidorchuk - avatar
3 ответов
+ 2
I think you schould do a string format like this {0} is a placeholder for the variable tp and :f2 to format the output to two decimal places. Console.WriteLine("{0:f2}",tp);
4th Mar 2021, 11:17 PM
Mohammad Alomari
Mohammad Alomari - avatar
5th Mar 2021, 9:23 AM
Mohammad Alomari
Mohammad Alomari - avatar
+ 1
Tnx guys, it works, but how it works? What the f2 means? I didnt learn this yet
5th Mar 2021, 6:12 AM
Nazik Sidorchuk
Nazik Sidorchuk - avatar