What am I doing wrong here? #include <stdio.h> int main() { int g,b,a,h; printf(
ID: 3651783 • Letter: W
Question
What am I doing wrong here?#include <stdio.h>
int main()
{
int g,b,a,h;
printf(" Enter the quantity of each item:" &endl);
scanf("Guns: ");
printf("%i", &g);
scanf("Bikes: ");
print("%i", &b);
scanf("Ammo: ");
printf("%i", a);
scanf("Hockey Sticks: ");
printf("%i", h);
double totalCost=g*359.5+b*449.99+a*14.99+h*149.99;
{
if(totalCost>200) totalCost-=25;
}
printf(" Total cost of the items minus the discount (if applicable) are: " &totalCostendl);
{
}
Explanation / Answer
#include int main() { int g,b,a,h; printf(" Enter the quantity of each item: "); printf("Guns: "); scanf("%d", &g); printf("Bikes: "); scanf("%d", &b); printf("Ammo: "); scanf("%d", &a); printf("Hockey Sticks: "); scanf("%d", &h); double totalCost=g*359.5+b*449.99+a*14.99+h*149.99; { if(totalCost>200) totalCost-=25; } printf(" Total cost of the items minus the discount (if applicable) are: $%lf",totalCost); }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.