473,804 Members | 3,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing Information with Java

1 New Member
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 InventoryProgra m;

import java.util.Scann er;


public class InventoryProgra m {

/**
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.prin tln("Enter Movie's Inventory Number and Name");
movie_dvd = input.next(); // prompt
System.out.prin tln("Enter DVD's Product Number");
item_number = input.next(); // prompt
System.out.prin tln("Enter Quantity Available in Stock");
stock_dvd = input.next(); // prompt


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

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

System.out.prin tf("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 1367
JosAH
11,448 Recognized Expert MVP
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 Recognized Expert Top Contributor
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
2148
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 database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
3
4728
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 2Mb) are stored in BLOB column. The amount of documents for the first year should not exceed 5/6 Giga, but I cannot make prevision for the next years. Those documents are mainly just accessed (update and delete are not so
10
8379
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 way to do this. Thanks
2
1961
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 when each is appropriate. I noticed that in the case of cookies, there is a liability because of web browser settings migh disallow the storing of cookies. Thanks in advance, Bob Hanson
13
3716
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 DB2 table? If so, how do I do it? It would be VERY convenient if I could store this boolean array directly in a column of a DB2 table but I'm not at all clear on whether this is possible, even after reading the documentation in the Information...
6
3204
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 me like there were performance issues at the time. How about the different types? The MS docs I would expect Access to differentiate and handle appropriately (i.e. .DOC and .XLS).. but how about ..PDF? and can I stash a .TXT document in the...
7
1887
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 the data and store it in a MySQL database. Users can then print, edit, delete or share the information they entered with their therapist. I'm not happy storing this in the database for two reasons: (1) my host places restrictions on my database...
3
1383
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 Student ID. Now the program to run as a samle of this class will store the first Student I get and put it into slot of my array and then I increment my NumStudents, as a count to moveon to the next array slot. The problem is that it only puts the...
20
2825
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 string VB.NET data type, knowing that this is its equivalence (for char4)? Next is the data type definition '''unsigned char
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7613
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4291
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.