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

  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