Compute the total sale output the total sale

Assignment Help Computer Engineering
Reference no: EM132197966

Write a complete Java program called ECommerceApp whose main method follows the pseudocode below, and whose other methods are as specified below.

Print the banner message Get the products catalog String Get the product order from the user and check whether 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 "The product was not found."

Your program must include the folowing methods:

1. 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 my eCommerce app! ======  (print a blank line after the banner)

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

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

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

5. 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 (ie 10% of the price). This is the tax.

6. 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).

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

Reference no: EM132197966

Questions Cloud

Construct the confidence interval : An interactive poll found that 375 of 2,276 adults aged 18 or older have at least one tattoo.
What is the intereste rate per cash flow period : A total of $70,000 is borrowed and repaid with 60 monthly payments, with the first payment occurring one month after receipt of the $70,000.
Write a complete program that repeatedly reads integers : Write a complete C++ program that repeatedly reads integers from the key-board, stopping input when that repeated reads integers or zero.
What are the expected rewards : What are the risks faced by dealers in the Treasury market? What are the expected rewards? What are special repo rates and General Collateral.
Compute the total sale output the total sale : A method called getOrder that takes a String as a parameter (the productsCatalog String) and returns a boolean.
Which of the three bonds would be the best choice : Three coupon bonds with a 10% coupon rate all just sell for their face value of $1,000. The three bonds will mature in one, two, and five years, respectively.
Find the optimal level of health demanded by a person : Find the optimal level of health demanded by a person that faces an annual interest rate of 0.05, a health depreciation rate of 0.15 per year, a health capital.
Add the users tbanks and jdoe to the group acctg : Change the properties of the existing user tbanks such that the user is a member of the managers group and has a login name of artbanks.
Write a program that simulate the bounded-buffer : Have your program produce an item with a random delay interval between one and five seconds for each item produced.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write a to-string function for class hash-map

Write a to_string function for class hash_map. This function should display each table element that is not NULL and is not deleted.

  Explain how the procurement process is integrated

Explain how the procurement process is integrated with other processes within an organization. Expert Answer

  Provides a method for data to be transferred between systems

XML provides a method for data to be transferred between systems. Specify at least three components of an XML document.

  Write down the object code for the following program

Write down the object code for the following program, assuming that it is not necessary to force extended addressing.

  Oracle security guidelines

Visit http://www.oracle.comand search for "Oracle Security Guidelines". Read articles at three of the links you find and summarize them.Remember to cite your references using APA format.

  Explain about virtualisation technology

Describe your reasoning for choosing the virtualisation technology and what advantages this technology gives you in this scenario - what are the disadvantages/limitations of this technology?

  Prepare a schematic design of five-stage multiply pipeline

Prepare a schematic design of the five-stage multiply pipeline. All line widths and inter-stage connections must be shown.

  How many bits are required to reference a page frame

A system has a virtual memory space of 8 virtual pages for a process with 4 blocks per page and 8 words per block. The main memory consists of 32 page frames with 4 blocks per page and 8 words per block. How many bits are required to reference a p..

  Create an algorithm for telling if l and m store the same

Create an algorithm for telling if L and M store the same sequence of elements (but perhaps with different starting points).

  Describe the challenges with data consistency

Describe the challenges with data consistency and why this is an area of concern for system forensics specialists.

  Discuss usermod command is used to change a linux user

Discuss a specific parameter you would used with the usermod and what you need to consider either

  Question1 add to situation calculus the ability to paint an

question1. add to situation calculus the ability to paint an object. in particular add the predicate colorobjcolsitthat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd