Login|Contact Us
Question and Answer

Programming

Ask a Programming Question, Get an Answer ASAP!

  • Ask A Question
  • Browse Answers
  • Meet The Experts
  • How JustAnswer Works

Choose a product that lends itself to an inventory (for example,

 
Rafael Martins's Avatar
  • Answered by:Rafael Martins
  • Computer Software Engineer
  • Positive Feedback: 100.0 %
  • Accepted Answers: 446
Verified Expert
in Programming

Recent Feedback

Positive
Very Smart Guy!!
Positive
Very nice will work with Rafael again
Positive
very help full and and quick to respond he has been amazing and im glad he could...
Positive
Outstanding! Thank you a million times!
Positive
Rafael Martins did a great job with my question, and very quickly. Thanks!!
Positive
On time and answers just as soon as questions are asked.
Positive
Great work and very fast!
Positive
His work really helps
Positive
Great work
Positive
Great work

Customer Question

Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software).



·        Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.



·        Create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.



·        Post as an attachment. Please submit only the .java files. The data for this CheckPoint should be provided by you in your program. The data should not be requested from the user.

 

Optional Information:
OS: Windows Vista; Browser: Firefox

Submitted: 1499 days and 14 hours ago.
Category: Programming
Value: $9
Status: CLOSED
Picture
Expert:  Rafael Martins replied 1499 days and 12 hours ago.

HiCustomer

Thank you for choosing me to help you with this assignment.

I need more information about your question.
Could you kindly clarify this question?

Do you need a GUI? If so, which functionalities should I put on it?

Please reply as soon as possible so that I can finish answering your question.

Picture
Expert:  Rafael Martins replied 1499 days and 12 hours ago.

HiCustomer

I've just realized that your assignment is the first part of the Inventory Program.
I did the part 3 for another customer before.

But I did it again in a different way.

Here are the source files.

I hope you enjoy it.

Let me know if you need further help.

Customer replied 1499 days and 3 hours ago.

Hello again thank you for your time I did not respond yesterday because of problems with my phone. Do I place the product part first or the inventory part?

Picture
Expert:  Rafael Martins replied 1499 days and 3 hours ago.

Hi, you saw what I did until now, I mean, the source files that I uploaded for you?

Customer replied 1499 days and 1 hours ago.

Hello what I mean is do I string the inventory part1 and the product part of the program in this manner?

public class Product {

     private int itemNumber;
     private String name;
     private int unitsInStock;
     private double unitPrice;

     public Product(int itemNumber, String name, int unitsInStock,
               double unitPrice) {
          this.itemNumber = itemNumber;
          this.name = name;
          this.unitsInStock = unitsInStock;
          this.unitPrice = unitPrice;
     }

     public int getItemNumber() {
          return itemNumber;
     }

     public String getName() {
          return name;
     }

     public double getUnitPrice() {
          return unitPrice;
     }

     public int getUnitsInStock() {
          return unitsInStock;
     }

     public double getValueOfProduct() {
          return unitsInStock * unitPrice;
     }

     public void setItemNumber(int itemNumber) {
          this.itemNumber = itemNumber;
     }

     public void setName(String name) {
          this.name = name;
     }

     public void setUnitPrice(double unitPrice) {
          this.unitPrice = unitPrice;
     }

     public void setUnitsInStock(int unitsInStock) {
          this.unitsInStock = unitsInStock;
     }

     public String toString() {
          String itemStr = "Item Number: " + String.format("%-4s | ", itemNumber);
          String titleStr = "Name: " + String.format("%-20s | ", name);
          String unitsStr = "Units In Stock: " + String.format("%4d | ", unitsInStock);
          String costStr = "Unit Price: " + String.format("$ %6.2f | ", unitPrice);
          String valueStr = "Value: "
                    + String.format("$ %8.2f", getValueOfProduct());

          return itemStr + titleStr + unitsStr + costStr + valueStr;
     }

}

public class InventoryProgramPart1 {

     public static void main(String args[]) {

          Product one = new Product(1, "CD one", 125, 9.00);
          Product two = new Product(2, "CD two", 700, 12.50);
          Product three = new Product(3, "CD three", 1200, 5.80);
          Product four = new Product(4, "CD four", 275, 40.99);
          Product five = new Product(5, "CD five", 500, 9.00);
          Product six = new Product(6, "CD six", 722, 12.50);
          Product seven = new Product(7, "CD seven", 312, 5.80);
          Product eight = new Product(8, "CD eight", 47, 40.30);

          System.out.println(one);
          System.out.println(two);
          System.out.println(three);
          System.out.println(four);
          System.out.println(five);
          System.out.println(six);
          System.out.println(seven);
          System.out.println(eight);
     }
}

Picture
Expert:  Rafael Martins replied 1499 days ago.

Hi,

I guess you want to put all code in one file, right?
If so, here is it: InventoryProgramPart1.java

Let me know if you need further help.

Customer replied 1499 days ago.

Hello again thank you for your time and effort I have loaded the program into NetBeans and saved it however it will not execute.

Picture
Expert:  Rafael Martins replied 1499 days ago.

Hi,

Could you kindly paste the errors here?

Accepted Answer

Picture
Expert:  Rafael Martins replied 1499 days ago.

InventoryProgramPart1 - NetBeans

Expert TypeComputer Software Engineer
Category: Programming
Pos. Feedback: 100.0 %
Accepts: 446
Answered: 4/2/2009

Experience: Desktop, Mobile and Web Developer. 7+ years of experience. Creative solutions provider.

Ask this Expert a Question >
Customer replied 1499 days ago.

Hello I will figure out what is going on there are no errors the run prompt does not display when I open the program. I will pay you and if I have any question or i can not figure it out i will contact you. Thank you.

Picture
Expert:  Rafael Martins replied 1499 days ago.

Ok I'll be ready to help you.

 
Tweet

6 Programmers are Online Right Now

Ask Your Question Now
Programming Questions Date Submitted
Help with my final assignment for VB 5/9/2013
I am new to C programming, and this is an assignment problem. 5/9/2013
Another programming question for you the link is as follows 5/8/2013
Programming question help the link is as follows for the question 5/8/2013
i dont know programming i create OKPR508211. 5/8/2013
I need a programmer to help me with a couple of questions I 5/7/2013
Design and write a program (VB) that collects the following 5/7/2013
To RajStatements Assume that quest is an integer variable 5/6/2013
I need help on this Java programming problem. I included the 5/5/2013
a java programming question 5/5/2013
RSS
Next 10 >
Ask A Programmer
Type Your Programming Question Here...
characters left:

Top Programming Experts

See More Programmers

In The News

Nbc
Washington Post
New York Times
Cnn
Learn More

How It Works

  • Ask an Expert
  • Get a Professional Answer
  • Ask Followup Questions
  • 100% Satisfaction Guarantee
Learn More
close
Find Expert answers related to your question.
Sign up using email
We will never post anything without your permission.
Already have an account? Sign in

Ask a Programmer

Get a Professional Answer. 100% Satisfaction Guaranteed.
197 Programmers are Online Now
Type Your Programming Question Here...
characters left:
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.
Truste
Contact Us | Terms of Service | Privacy & Security | About Us | Our Network
© 2003-2013 JustAnswer LLC
  • Pearl.com
  • JustAnswer UK
  • JustAnswer Germany
  • JustAnswer Spanish
  • JustAnswer Japan