Question
not sure if im supposed two use two methods or just create the one method named items and i also dont know how to do
not sure if im supposed two use two methods or just create the one method named items and i also dont know how to do returns
Write a java program that features a method named item() that helps with a grocery bill. See Sample Output. In the main method: - prompt for the number of different items being purchased. - use a loop to process each item by prompting for the unit price, quantity and taxable status. - call the item method with these inputs as arguments. - accumulate the value returned by item to get the total bill for all items. - print the grand total for all items. In the item method: - calculate the subtotal, 7% sales tax if applicable, and total for each item. - print all three of these calculations in currency format. - return the total. Sample Output
How many different items are being purchased? 2 Enter price of item 1 5.00 Enter quantity of this item 3 Is the item taxable true/false ? true Subtotal $15.00 Sales tax $1.05 Total $16.05 Enter price of item 2 2.50 Enter quantity of this item 4 Is the item taxable true/false ? false Subtotal $10.00 Sales tax $0.00 Total $10.00 Please pay $26.05Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started