Create a class to encapsulate the data and behavior

Assignment Help JAVA Programming
Reference no: EM13782793

Reading

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: EM13782793

Questions Cloud

Major responsibilities and functions of the controllers offi : • Major responsibilities and functions of the controller's office. • Major types of financial statements and their purposes. • Roles of internal and external audits. • Importance of accurate forecasting. • Purpose of yield management strategies.
Establishing correlation between variables : Describe different methods of establishing correlation between variables and provide an example of each (pearson's r & spearman rho).
Evaluate the effectiveness of those fiscal policy : Identify fiscal policies that are currently being recommended by government leadership - Evaluate the effectiveness of those fiscal policy recommendations from the Keynesian and Classical model perspectives.
Staffing and administrative issues in behavioral health : Staffing and Administrative Issues in Behavioral Health.
Create a class to encapsulate the data and behavior : 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
Limit overaggressive law enforcement : The Fourth Amendment is supposed to limit overaggressive law enforcement and government practices and make sure there are no unreasonable searches and seizures conducted on citizens.
What is an example of a global policing system : What is an example of a global policing system? How do global policing systems impact criminal activity on a global level? How can we better improve the approach in which global policing agencies combat crime on a global scale
Basic assumptions associated with chryslers culture : What are the observable artifacts, espoused values, and basic assumptions associated with Chrysler's culture? Explain.
Case study on management and org theory : Tom had always wanted to start his own business. He was talented in many areas and had great people skills.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Develop the myclone class

You will also create another class of your choice. Your programmer-defined class should have at a minimum two instance variables and one method - You will create a Virtual World application as your final project. This Virtual World will have sever..

  Correct example of inheritance

Which of the following relationships is not a correct example of inheritance?  Parent to Children  Aunt to Uncle  Grandparent to Grandchild

  Instantiate two savingsaccount objects

saver1 and saver2, with balances of $2000.00 and $3000.00, respectively (was trying to figure out the formula, what I have written so far is as follows, and I am trying to see if I missed something

  Create file lab7.java with a main method.

Create file Lab7.java with a main method. Inside your main method, write a segment of code which instantiates an object of the Student class (This class has been created for you in the  Student.java  file that is provided as part of this lab).

  One-dimensional array to solve the

In C#, Use a one-dimensional array to solve the following problem. A company pays its salespeople on a commission basis. The salespeople each receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who gros..

  What is an illustration of a javascriptr framework in the

what is an example of a javascriptr framework? in the framework you have described what is an example of an application

  Balancing binary search trees

Balancing Binary Search Trees,  Consider the file BST.java (a link to this file is provided below for downloading purposes) which defines a generic Binary Search Tree class.

  Create a histogram bar

Demonstrates an example of the user interface during your program's execution

  Demonstrate the use of conditional and looping structures

The application should have two classes; at least one class in addition to the application's controlling class. The source code must demonstrate the use of conditional and looping structures.

  Describe the basic c syntax for creating a class comprise

explain the basic c syntax for creating a class. include an explanation of the private and public section of a class

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

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