Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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); }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote