Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed

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.05

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

identify sources of secondary data across organisations;

Answered: 1 week ago

Question

How could assessment be used in an employee development program?

Answered: 1 week ago