473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Storing Information with Java

Hi, I am not "getting it" with Java nearly as quickly as I should. I am writing an inventory program and I need to create a DVD inventory program that will display the following; I need to create a product class that holds the item number, name of DVD, how many I have in stock, as well as the price per DVD. Then I need to show the value of my inventory.

I am so lost, can anyone help? I have this so far:

package InventoryProgram;

import java.util.Scanner;


public class InventoryProgram {

/**
Inventory Program for DVD's
*/
public static void main(String[] args) {

Scanner input = new Scanner( System.in);
String movie_dvd; //dvd movie name
String item_number; //dvd item number
String stock_dvd; //dvd quantity in stock
String cost_dvd; //price per dvd
int sum;

System.out.println("Enter Movie's Inventory Number and Name");
movie_dvd = input.next(); // prompt
System.out.println("Enter DVD's Product Number");
item_number = input.next(); // prompt
System.out.println("Enter Quantity Available in Stock");
stock_dvd = input.next(); // prompt


System.out.printf("The Movie Name is %s", movie_dvd); // display DVD name
System.out.printf("The DVD's Product Number is %s", item_number); // display product number

System.out.printf("There are %s", stock_dvd, " available"); // display available total

System.out.printf("The Value of DVD Inventory is %d\n", sum); // display total of inventory

Thanks so much, Vickie



}
// end main method
}
Mar 6 '08 #1
2 1354
JosAH
11,448 Expert 8TB
I don't want to disappoint you but you are the umpiest who comes up with this.
Look at the top right of this page and search for "DVD inventory" and you'll see
how all the other victims like you did this assignment.

kind regards,

Jos
Mar 6 '08 #2
BigDaddyLH
1,216 Expert 1GB
Don't worry about parsing input at first. That's the least important (although most tedious) part of a console-based program. Concentrate on defining the classes first. Start small:

Expand|Select|Wrap|Line Numbers
  1. public class DVD {
  2.  
  3. }
Small enough? Then choose a use case. Come up with a test for it, then code the test and implement code to pass the test.
Mar 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing...
3
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around...
10
by: Wonderinguy | last post by:
I have a table with data stored on upper case. I would like to change it proper mixed case. For example : change data from , THIS IS A TEST to This is a test or This Is A Test. Is there any easy...
2
by: Robert Hanson | last post by:
I am new to the asp.net application building and I have read the information regarding the storing of information using session vs cookies vs viewstate. I am asking for suggestions/guidance as to...
13
by: Rhino | last post by:
Is it possible to store Java objects in DB2 V8.2 for Windows/Unix/Linux via JDBC? Specifically, if I have a 4-dimensional boolean array, i.e. boolean, can I store it directly in a column of a...
6
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to...
7
by: Mike | last post by:
I have developed an application, for psyc patients.... they type in very personal information in a web form to help them work through problems in their lives. Once they enter the info, I encrypt...
3
by: kjkrudh | last post by:
Hi, Here I am again with more questions. I am groveling for help. I am working on a program in Netbeans 5.5.1 where I created a class called Student that gets and sets Last Name, First Name and...
20
by: =?Utf-8?B?ZW1pdG9qbGV5ZXM=?= | last post by:
Hi everyone: i read from the documentation of a dll that there is a struct that uses char for storing an IP address. How can it be? and how come i can get to representate the same value in a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.