Write a class to encapsulate data and behavior of a product

Assignment Help JAVA Programming
Reference no: EM131317787

Java Application Product and Inventory

Reading

Chapter 9 of the text

Moodle: Class Coding Style

Java Classes

Java Application Product and Inventory

Product.java

Create a class to encapsulate the data and behavior of a product in a store's inventory. The class should have the following data for an inventory item:

Product Number - String

Description - String

Quantity on hand - int

Product Price - double

Use appropriate access modifiers when defining the data

Code accessor and mutator (get and set) methods for all class instance variables. Be sure to follow the class style and use _ as the name for the parameter corresponding to the class instance variable. (Note the "_" starting the parameter name.)

If the product number or description is blank, or the values passed for the quantity or price are not valid, leave the associated instance variable unchanged.

Create a class method to calculate and return the total amount for the product based on the quantity on hand and the product price.

Use appropriate modifiers when creating the methods

Inventory.java

The main method in this class should create an instance of Product. It should then read inventory information from a text file named Inventory.txt and use the class mutators to put the information into the Product object. The Product object should then be passed to a method to display product information using the class accessors and member method.

The Inventory.txt file contains colon delimited fields for the product number, description, quantity on hand, and the product price for each inventory item. Upload this file from Moodle and use it in your application.

Reference no: EM131317787

Questions Cloud

Find cost savings associated with a costeffective solution : If the countries implement a uniform abatement standard, find the resulting values of TAC and MAC for each nation. Based on these values, is there an economic incentive for the two nations to participate in an emissions trading program? Explain.
What types of things will change operating revenues : In a transportation firm, what types of things will change operating revenues? Operating expenses? - If a transportation firm shows a rise in revenue per passenger mile, what does this increase imply?
Identify and discuss three significant legal issues : What are the first things you should do regarding the media, the coaches, and the other athletic department administrators?If you were Marisol, would you involve anyone else in the decision-making process? If involving other people, who would they ..
Most important category of assets for transportation firm : Is it more desirable to have the operating ratios increasing or decreasing for utilities and transportation companies?
Write a class to encapsulate data and behavior of a product : Create a class to encapsulate the data and behavior of a product in a store's inventory. The class should have the following data for an inventory item: Product Number - String.
Oil and gas companies must disclose quantity estimates : Oil and gas companies must disclose quantity estimates for proved oil and gas reserves and the major factors causing changes in these resource estimates. Briefly indicate why this disclosure can be significant.
Create a database to keep inventory of something you own : Create a database to keep inventory of something you own, such as books, CDs, movies, collectibles, etc. Name the database Access Test Project 1-your last name.
Why is it important to note method of costing exploration : Some industries described are controlled by federal regulatory agencies. How does this affect their accounting systems?
Calculate the value of a 6-month european : Calculate the value of a 6-month European put futures option when the futures price is $19, the strike price is $20, the risk-free rate is 12% per annum and the volatility of the futures price is 20% per annum.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Draw all tree patterns corresponding to the instruction

Draw all tree patterns corresponding to this instruction (and its special cases). Pick one of the bigger patterns and show how to write a Java if-statement to match it, with the Tree representation used for the MiniJava compiler.

  Write a program to prepare the monthly charge account

Write a program to prepare the monthly charge account statement for a customer of CS CARD International, a credit card company. The program should take as input the previous balance on the account and the total amount of additional charges during the..

  Prints out a summary for a list of prescriptions

Create a class that prints out a summary for a list of prescriptions. Using your Prescription class and some if statements you will read in 3 prescriptions and print out an appropriate summary with a list of the prescriptions

  Develop a price estimation web page using html five

The main objective of this assignment is to develop a "Price Estimation" web page using HTML5 and Client- Side JavaScript. The completed page will run as shown in Figure 5.1

  Addressed with attributable risk

Which of the following questions is addressed with attributable risk?

  User-defined methods

You will create the ShoutBox class for your Virtual World. Your ShoutBox class will have a shoutOutCannedMessage() method that returns a String type.

  Program must compare the corresponding elements in two array

The program should ask the buyer to enter six digits and should store in an integer array. Six digits should be generated randomly in the range 1 through 20. The digits should be filled in a separate array of size six called lottoDigits.

  Create a complete java application

Create a complete Java application that meets these requirements and the program has an opening comments section (using block comments) with the file name, date, your name, and purpose of the program.

  Find and discuss an interesting example of recursion

Find and discuss an interesting example of recursion - thus, an example other than those presented in the readings. Your discussion should: give citations

  Write a driver program that reads in animals of type horse

Write a driver program that reads in 3 animals of type Horse and prints out the name, age and height of all non pure blood Horse objects that are 4 or more years old. The following information should be read per Horse:

  Implement the employee class and its three child classes

Implement the Employee class and its three child classes (ManagementEmployee, EngineeringEmployee and AdministrationEmployee), with all the necessary attributes and methods.

  Chat server java program

Edit a chat server java program: the files is a perfect running a chat server java program. I need to make the layout a little bit different then it is now. i also want to add imoji icons (emotion icons) into the program.

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