Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A customer in a store is purchasing n items. Write an application that asks for the price of each item, then displays the subtotal of

A customer in a store is purchasing n items. Write an application that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent (to be set up using a named constant).
Your application is to consist of multiple methods, including the following:
A value-returning method to return a valid value for n
Have the user enter a value for n, a positive integer. As long as the entered value is less than 1, then have the user try again. Once a valid value for n is entered, return it to the calling method
A value-returning method to compute the subtotal of the sale
Set up a loop to compute the subtotal of the sale , using the value of n that is received through a parameter
Return the subtotal of the sale value to the calling method
A value-returning method to compute the amount of sales tax
The method is to receive the subtotal of the sale value through a parameter
Return the computed sales tax value to the calling method
A value-returning method to compute the total amount for the transaction
The method is to receive the subtotal of the sale value and the sales tax value through parameters
Return the computed total amount value to the calling method
A main() method, where the above methods are called

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

More Books

Students also viewed these Databases questions

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago