Someone Help me with this code!! (Closed) | Sololearn: Learn to code for FREE!

+7

# Someone Help me with this code!! (Closed)

6/14/2021 6:40:34 PM

Hemang Mitra

+2

Hemang Mitra https://code.sololearn.com/cI98cvb7Z0ns/?ref=app

+3

https://code.sololearn.com/cdSm8YLfUgmq/?ref=app //Is this your expected output?

+2

Hemang Mitra I made some changes in my code please check it again

+1

No like, the total price after discount cannot be 0, unless we input all the first three variables as 0

+1

we should not need to input fourth value, the "total' variable is taken as the input to apply discount on it.

+1

Hemang Mitra if possible please provide an example

+1

Hemang Mitra if you do not need to take total as input from user, remove the line 14 from my code ^^

+1

Well what I want the code to do is simple, first it will ask for the first three variables labeled as gift1, gidt2 and gift3 after you input the value then it will add cost of all gifts then, again it will automatically take input from that total cost and apply a discount of 15% and then give you the discounted cost.

+1

so, you input the total (as fourth value) instead of using the computed total just before... my code works as expected ^^

+1

Hemang Mitra just check my code again

+1

Visph I tried the same code in other ides and locally in my computer, the compiler are not giving the same output as the one in sololeran how ?

+1

Hemang Mitra updated my code to give only 2 decimals...

+1

Hemang Mitra corrected first the %.f format wich give int instead of float ^^

+1

visph Yes it works thanks for bearing with me lol and thanks

+1

Atul It doesn't work but, thanks for the effort.

+1

Hemang Mitra sorry I am unable to help you in fully. May be I was unable to get your question. Sorry for thay

+1

Atul No problem you gave your all for it.

0

what is the fourth value you expect as input?

0

Change Total=0.85*discount...... To Total=0.85*total

0

Sanju Subhash Haldar https://www.sololearn.com/discuss/1316935/?ref=app