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

  Create a class called scorelist according to the uml diagram

Create a class called ScoreList according to the UML diagram. This class will allow a user to enter up to 100 scores into an array.

  Determine product a inferior or normal good

Research illustrates that prices of related goods are given by Py = $5,900 and ; Pz = $90, while average income of individuals consuming this product is M = $55,000. Is X inferior or normal good?

  Write a recursive method called productarray

Write a recursive method called productArray that takes an array of integers, a start index and an end index and returns the product of the elements of the array.

  Implement a for loop in the application

Create a method in the class student that returns what the student is doing and this method have to generate the behavior randomly. It can't return the same thing every time.

  Create a method that would search through an arraylist

What is the best way of the following ways (For each, Iterator, While with index) that you would use to create a method that would search through an ArrayList of files for a certain file and then delete it, and why?

  What are the advantages and disadvantages of ood

In OOD, an object combines data and operations on that data into a single unit, a feature called encapsulation. Discuss the following question with your classmates:What are the advantages and disadvantages of OOD?

  Write a program that lets the user click on the panel

Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or more points, highlight the pair of closest points. Whenever a new point is created, a new pair of closest po..

  C program in unix environment

This question deals with writing a C Program in UNIX environment (bash). You must rewrite the LS system call in C, but the output of files MUST be in decreasing order in the size of the file (bytes).

  Write program that convert us dollar into canadian dollar

Design a new class named Polygon that extends GeometricObject and implements Comparable. The number of sides in polygons varies, you cannot use a certain number of data fields for sides of a polygon - Write a program that passes an unspecified numb..

  Develop auto inventory system which contains functionality

You will develop a simple auto inventory system which contains the following basic functionality: Read the supplied autoInventory.txt file to obtain the auto inventory with the file path supplied as the first run-time parameter.

  What are the differences and connections between these two

Do some research on Java application and Java applet. What are the differences and connections between these two? To find out, you might need to be more resourceful than usual.

  What is the purpose of the main method in a java application

Discuss the following questions with your classmates. What is the purpose of the main method in a Java application program? Can you write a Java program without it? Why? Why not?

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