First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "ECommerceApp" (without the quotation marks) 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 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 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 my 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, first display the productsCatalog String to the user. Then prompt the user to enter a product name (a String), and 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: See Horstmann Section 4.9.2.) 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 "$" followed by the whole number, a decimal, and two decimal positions.
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "ECommerceApp" (without the quotation marks) 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 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 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 my 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, first display the productsCatalog String to the user. Then prompt the user to enter a product name (a String), and 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: See Horstmann Section 4.9.2.) 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 "$" followed by the whole number, a decimal, and two decimal positions.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).
Then create a new Java application called "ECommerceApp" (without the quotation marks) 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 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."
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 "The 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 my 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, first display the productsCatalog String to the user. Then prompt the user to enter a product name (a String), and 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: See Horstmann Section 4.9.2.) 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 "$" followed by the whole number, a decimal, and two decimal positions.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education