0
Kaleidoscope Code Challenge
Need help figuring out why this code is failing the last test case. <remove description of challenge as SoloLearn requires. Wells> #include <stdio.h> int main() { int kl; float cost = 5.00; scanf("%d", &kl); if(kl <= 1) printf("%.2f", kl*cost*1.07); else printf("%.2f", kl*cost*.9*1.07); return 0; }
11 odpowiedzi
+ 1
Oops, this is pro content, i cannot see it without charging. 😢
+ 1
It's alright,I'll get it eventually haha. Thanks for your help anyway
0
What is the problem?
0
Akbar Ali Quazi the description was removed, but it was asking this:
If a person buys more than one kaleidoscope they get a 10% discount.
Given the 10% discount, a cost of 5$ per kaleidoscope and a sales tax of 7% give the user their total.
0
Okay then what's wrong in this code?
0
I fail the 5th case check in the code challenge but it's locked so I can't see where I went wrong.
0
Try this
#include<stdio.h>
void main()
{
int kl=0;
float cst = 5;
printf("\nEnter Kaleidoscope : ");
scanf("%d",&kl);
if(kl>1)
printf("\nAmout : %.2f\n",cst*kl*.9*1.07);
else
printf("\nAmout : %.2f\n",cst*kl*1.07);
}
0
Didn't work, still failing 5th case
0
Share me the link, there r u facing this problem
0
Happy to help 🤗