#Receipt/Formatting Assignment
1 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @teal oxide! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
public class Main {
public static void main(String []args) {
System.out.format("%32s\n", "Holiday Grocery");
System.out.format("%32s", "---------------\n");
System.out.println();
System.out.println("Thank you for shopping at our store\n");
System.out.format("Date \t\t\t%s\n", "Dec.23.2022");
System.out.format("Location \t\t%s\n", "0016225");
System.out.format("Address \t\t%s\n", "239 Rudolph Rd");
System.out.format("\t\t\t\t%s\n", "Toronto, ON");
System.out.format("\t\t\t\t%s\n\n", "M7Z 2X4");
System.out.format("Payment: \t\t%s\n", "Credit **** **** **** 1025");
System.out.println("-----------------------------------------------------------------------------");
System.out.format("%s\t%s\t%s\t\t\t\t%s\t\t%s\t\t\t\t%s\n", "Items", "Code", "Description", "Qty", "Unit Price", "Price");
int qty = 12;
double price = 2.59;
double priceTotal = qty * price;
System.out.format("%14s%13s%20.2f", "002601", "Home Orange", qty);
}
}
here is my program
The formatting part at the bottom
where I try to put a qty in the format
the last line of the code
sorry for being so vague
concatenation, and no
Before your post will be closed, would you like to express your gratitude to any of the people who helped you? When you're done, click I'm done here. Close this post!.