Create class to encapsulate the data and behavior of product

Assignment Help JAVA Programming
Reference no: EM131307762

Assignment

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 _<classInstanceVariable> 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: EM131307762

Questions Cloud

What is unreasonable about this result : The manufacturer of a smoke alarm decides that the smallest current of α radiation he can detect is 1.00 µA .
What are the four common characteristics shared by the ngos : Name the various classifications of nongovernmental organizations, and describe each.- What are the four common characteristics shared by the NGOs?
Determine what percentage of the appeal has been funded : From this list, try to determine why some countries ' appeals are fully funded, while others fall very far short of their request. Is this an issue of inequality in relief distribution, or is it something else?
What does this statement mean : People will work to achieve equity! Remember this statement because you will need to manage such perceptions of your employees. What I want you to think about is what does this statement mean? How will an employee achieve equity in their compe..
Create class to encapsulate the data and behavior of 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.
If disaster happen in us would organization respond : In what countries around the world is that organization working right now? If a disaster happened in the United States, would that organization respond? Why or why not?
Explain what is meant by acclimatization : Imagine that you coach a track team. You have three athletes who compete in the shot-put event. All three have good technique and achieve similar trajectory angles. One can put the shot farther than the others. Using the concepts of energy, work, ..
Implement a base class appointment and derived classes : Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, "see the dentist") and a date and time.
Goal of emergency management in regards to terrorism threat : What are the five groups that must be fully engaged in the nation's war on terrorism?- What is the goal of emergency management in regards to the terrorism threat?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Discuss: inheritance loops and conditional statements

"The process of identifying the classes or functions for replacement" - I you can also define things that are used in the program. ie, define and discuss: inheritance, loops, conditional statements, variables, methods, objects, IDEs, and so on.

  Identify how you can encapsulate the data

Describe the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why?

  Write a java program that would simulate a number of cars

Write a JAVA program that would simulate a number of cars' (e.g. 4) speed meter using the concept of Multithreading. A car's speed can be both increased and decreased using specified keys from the keyboard

  Create a class that uses the genetricstack class

Create a new class named GenericStack that specifies a type variable that gives for generics - Use the peek method to return the first item and show that item, and use the size method to return the number of items again and show that value.

  Create a java program that performs distributed systems task

Can someone create a Java program that performs the following distributed systems tasks? This should be easy for a Java programmer

  Describe the steps to program development

What is the function of parseFloat and parseInt and what will be result if we send "abcd" through a prompt() input and pass it through parseInt()?

  Write a complete java program to simulate ahmed''s show

Suppose you're on a game show and you're given the choice of three doors. Behind one door is a car; there is nothing behind the others. The car and is placed randomly behind the doors before the show. The rules of the game show are as follows:

  Create a secure parts inventory catalog system

You will create a secure Parts Inventory Catalog system using Model 2 architecture. The application will require a user to have the proper access right to enter the system, and when satisfied, presents the catalog of items currently available in t..

  Write an app that allows user to enter a seven-digit number

Write an application that prompts the user to enter the sales for each employee, then it calculates the salesperson's salary. The process repeats until the user finishes entering all employees' information

  Implementation of the finger protocol

Server programs are rarely implemented as non-threaded applications, even though that is how you implemented your previous server application.

  Process of identifying classes or functions for replacement

A 700- to 1050-word paper describing the following: How the two programs were selected and The process of identifying the classes or functions for replacement

  Write a program that prompts a user to enter a us dollar

Write a program that prompts a user to enter a US dollar amount. Output a table similar to the one in the example below. The second prompt should ask the user to enter a 1 to convert to euros, a 2 to convert to pounds and a 3 to convert to ruble..

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