Generate a random number

Assignment Help JAVA Programming
Reference no: EM131578695

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

Reference no: EM131578695

Questions Cloud

Prepare the required adjusting journal entry for december : Scenario: You are the Accountant for WanneBee Corporation. Prepare the Required Adjusting Journal Entry for December 31, 2000
What made the data significant with respect to objective : Pay particular attention to the statistical significance as reported and what made the data significant with respect to objective
Implementation of the security recommendations : Expand the section of your report for verifying the implementation of the security recommendations for this week.
Determine the expected number of correct answers : Use the additivity of expectation to determine the expected number of correct answers a student will get on an n question.
Generate a random number : A method called productsBuilder that takes no parameters and returns a String. In the method body construct a String
Describe three critical issues of the twenty-first century : describe three critical issues of the twenty-first century in policing. In considering ethical leadership challenges discuss how problems associated
What is the total amount of interest expense : Exercise - Effect of a line of credit on financial statements. What is the total amount of interest expense paid for 2014
Find the expected value of x : Show that if a random variable X is defined on a sample space S (you may assume X has values x1, x2, ... xk as above) then the expected value of X.
Explain the rational-choice theory : To what extent does rational-choice theory make sense or not make sense in view of the evidence reported in the article Rough Justice

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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