Write a program that formats product information entered bythe user . A sesion w
ID: 3616590 • Letter: W
Question
Write a program that formats product information entered bythe user . A sesion with the program should look like this: Enter item number : 583 Enter unit price : 13.5 Enter purchase date (mm/dd/yy) : 10/24/95 Item Unit Purchase Price Date 583 $ 13.50 10/24/95 The item number and date should be left justified; the unitprice should be right justified . Allow dollar amounts up to $9999.99. Hint: Use tabs to line up the columns. Write a program that formats product information entered bythe user . A sesion with the program should look like this: Enter item number : 583 Enter unit price : 13.5 Enter purchase date (mm/dd/yy) : 10/24/95 Item Unit Purchase Price Date 583 $ 13.50 10/24/95 The item number and date should be left justified; the unitprice should be right justified . Allow dollar amounts up to $9999.99. Hint: Use tabs to line up the columns.Explanation / Answer
please rate - thanks notice the left justify in the last printf #include #include int main() {double price; int item; char date[9]; printf("Enter item number: "); scanf("%d",&item); printf("Enter unit price: "); scanf("%lf",&price); printf("Enter Purchase Date: "); scanf("%s",&date); printf("Item Uniy Purchase Price Date "); printf("%-d $%7.2f %-s ",item,price,date); getch(); return 0; }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.