A method called productsbuilder that takes no parameters


Need help finishing up this app. These are the instructions/ what I need to have as part of it.

Print the banner message
Get the products catalog String
Get the product order from the user and check it exists in the products catalog String
If the product exists
Get the product price
Compute the product tax
Compute the total sale
Output the total sale
Else
Output "Your desired product was not found."
Your program must include the following methods:
A method called bannerPrinter that takes no parameter and has no return value. bannerPrinter outputs a greeting to the command line as shown below.
*******************************************
====== Welcome to the ECommerce app! ======
*******************************************
(print a blank line after the banner)

A method called productsBuilder that takes no parameters and returns a String. In the method body construct a String (name it productsCatalog) and populate it with items, each of which must be 10 characters long. For any product less than 10 characters, pad the remainder with spaces. You don't need to get the values from the user, just populate the String with 3 product names. For example, product 1 might be "Desk ", product 2 might be "Table ", and product 3 might be "Pen ". All 3 of these products are within the productsCatalog String.

A method called getOrder that takes a String as a parameter (the productsCatalog String) and returns a boolean. In the method body, prompt the user to enter a product name (a String), then check whether the product name exists in productsCatalog. If it exists, return true, otherwise return false.

A method called getPrice that returns a double. In the method body generate a random number between 1 and 100 (Hint: Use Math.random() multiplied by a scaling factor.) and return this value as the price.

A method called getTax that takes a double as a parameter (the price) and returns a double. Compute the return value as 10% of the parameter value (i.e. 10% of the price). This is the tax.

A method called getTotal that takes two doubles as parameters (the price and the tax) and returns a double. The return value is computed as the sum of the two parameters (the return value is the sale total).

A method called printTotal that takes a double as a parameter (the sale total) and has no return value. This method outputs the following to the command line: "Your sale total is: $X" where X is the sale total parameter value.

All currency amounts that your program outputs should show a leading "tiny_mce_markerquot; followed by the whole number, a decimal, and two decimal positions.

Attachment:- eCommerceApp.rar

Solution Preview :

Prepared by a verified Expert
JAVA Programming: A method called productsbuilder that takes no parameters
Reference No:- TGS02374239

Now Priced at $15 (50% Discount)

Recommended (97%)

Rated (4.9/5)