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

My problem is my code for some reason wont let me enter a \"purchase date\" for

ID: 439960 • Letter: M

Question

My problem is my code for some reason wont let me enter a "purchase date" for some reason. Unless my compiler is being weird. This is what it is suppose to look like in the output: Enter item number: 583 Enter unit price: 13.5 Enter purchase date (mm/dd/yyyy): 10/24/2013 Item Unit Purchase Price Date 583 $13.50 10/24/2010 This is what I have: //**************Chapter 3----Project 2************** #includeint main(void) { int item_number, date; float unit_price; printf("Enter item number: "); scanf("%d", &item_number); printf("Enter unit price: "); scanf("%.2f", &unit_price); printf("Enter purchase date (mm/dd/yyyy): "); scanf("%d", &date); printf("Item Unit Purchase Price Date "); printf("%d $%.2f %d ", item_number, unit_price, date); return 0; }

Explanation / Answer

//**************Chapter 3----Project 2************** #include int main(void) { int item_number, date; float unit_price; printf("Enter item number: "); scanf("%d", &item_number); printf("Enter unit price: "); scanf("%f", &unit_price); printf("Enter purchase date (mm/dd/yyyy): "); scanf("%d", &date); printf("Item Unit Purchase Price Date "); printf("%d $%f %d ", item_number, unit_price, date); return 0; }
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