Store+search+view+print inventory,store+search+print rent information

Good morning,
I need some help regarding my Java Project. I was told by my lecturer to do one program[probably java applets] to store all informations about CDs and Videos.
The program should be able to :
1)store,view,search and print the informations of CDs and Videos.
2)store,view,search and print the informations of customers
This are the informations that need to be stored for:
CDs:
1. Title of album
2. artist
3. number of tracks
4. total playing time
5. comments
Videos:
1. Title of video
2. Name of director
3. total playing time
4. comment
For search CDs and Vidoes information, user will key in the artist name(for CDs) and director name (for video)
For the renting section:
1)the employee will be able to key in customer transaction.
2) The customer must be a member to rent the CDs and Videos.If not, he / she must registers first.
3)The transaction will be recorded in terms of the CDs/Videos informations, date of rent,due date and payments.
4)The applet must also can identify which customer that has not pay/not return yet. If he or she does not return yet, he or she wont be able to rent .
Here is some of coding that I have made:
Name:TestRandomAccessFile[only for Videos]
*i dont know how to combine CDs.
*This applet coding only consists of register informations about Videos and View ONLY
//TestRandomAccessFile.java: Store and read data
//using RandomAccessFile
package Store;
import java.io.*;
import java.awt.*;
import java awt.event.*;
import javax.swing.*;
import CHapter9.MyFrameWithExitHandling;
import javax.swing.border.*;
public class TestRandomAccessFile extends MyFrameWithExitHandling
     //Create a tabbed pane to hold two panels
     private JTabbedPane jtpVideo = new JTabbedPane ();
     //Random access file for access the student.dat file
     private RandomAccessFile raf;
     //Main method
     public static void main (STring[]args)
     TestRandomAccessFile frame = new TestRandomAccessFile ();
     frame.pack ();
     frame.setTitle ("Test Random Access File");
     frame.setVisible ("True");
     //Default constructor
     // Open or create a random access file
     try
     raf=new RandomAccessFile("video.dat","rw");
     catch(IOException ex)
     System.out.print ("Error: " + ex);
     System.exit (0);
     //Place buttons in the tabbed pane
     jtpVideo.add (new RegisterVideo(raf),"Register Video");
     jtpVideo.add (new ViewVideo(raf),"View Video");
     //Add the tabed pane to the frame
     getContentPane().add(jtpVideo);
     //Register video panel
     class RegisterVideo extends Jpanel implements ActionListener
     //Button for registering a video
     private JButton jbtRegister;
     //Video information panel
     private VideoPanel videoPanel;
     //Random access file
     private RandomAccessFile raf;
     //COnstructor
     public RegisterVideo (RandomAccessFile raf)
     //Pass raf to RegisterVideo Panel
     this.raf=raf;
     //Add videoPanel and jbtRegister in the panel
     setLayout Pnew BorderLayout ());
     add (videoPanel= new VideoPanel(),BorderLayout.CENTER);
     add(jbtRegister= new JButton ("Register"),BorderLayout.SOUTH);
     //Register listener
     jbtRegister.addActionListener(this);
     //Handle button actions
     public void actionPerformed(ActionEvent e)
     if (e.getSource()==jbtRegister)
     Video video=videoPanel.getVideo();
     try
     raf.seek(raf.length());
     video.writeVideo(raf);
     catch (IOException ex)
     System.out.print ("Error:" + ex);
     //View video panel
     class ViewVideo extends JPanel implements ActionListener
     //Buttons for viewing video information
     private JButton jbtFirst,jbtNext,jbtPrevious,jbtLast;
     //Random access file
     private RandomAccessFile raf=null;
     //Current Video Record
     private Video video = new Video ();
     //Create a Video panel
     private StudentPanel studentPanel=new StudentPanel ();
     //File pointer in the random access file
     private long lastPos;
     private long currentPos;
     //Contsructor
     public ViewVideo (RandomAccessFile raf)
     //Pass raf to ViewVideo
     this.raf=raf;
     //Panel p to hold four navigation buttons
     JPanel p=new Jpanel();
     p.setLayout(new FlowLayout(FlowLayout.LEFT));
     p.add(jbtFirst=new JButton("First"));
     p.add(jbtNext=new JButton("Next"));
     p.add(jbtPrevious=new JButton("Previous"));
     p.add(jbtLast=new JButton("Last"));
     //Add panel p and studentPanel to ViewPanel
     setLayout(new BorderLayout());
     add(studentPanel;BorderLayout.CENTER);
     add(p,BorderLayout.SOUTH);
     //Register listeners
     jbtFirst.addActionListener(this);
     jbtNext.addActionListener(this);
     jbtPrevious.addActionListener(this);
     jbtLast.addActionListener(this);
     //Handle navigation button actions
     public void actionPerformed(ActionEvent e)
     String actionCommand=e.getActionCommand();
     if(e.getSource() instanceof JButton)
     try
     if ("First".equals(actionCommand))
     if(raf.length()>0)
     retrieve(0)l
     else if ("Next".equals(actionCommand))
          currentPos=raf.getFilePointer();
          if (currentPos<raf.length())
     retrieve(currentPos);
     else if ("Previous".equals(actionCommand))
          currentPos=raf.getFilePointer();
          if (currentPos<raf.length())
     retrieve(currentPos-2*2*Video.RECORD_SIZE);
     else if ("Last".equals(actionCommand))
          lastPos=raf.getFilePointer();
          if (lastPos<raf.length())
     retrieve(lastPos-2*Video.RECORD_SIZE);
     catch (IOException ex)
     System.out.print("Error:"+ex);
     //Retrive a RECORD at specific position
     public void retrieve(long pos)
     try
     raf.seek(pos);
     video.readVideo(raf);
     videoPanel.setVideo(video);
     catch (IOException ex)
     System.out.print ("Error lagi la wei:"+ex);
     //This class contains static method to read and write fixed length      //records
     class FixedLengthStringTo
     //Read fix number of the chracter from DataInput stream
     public static String readFixedLengthString(int size;DataInput in)
     throws IOException
     char c[]=new char [size];
     for (int=0;i<size;i++)
     c=in.readChar();
     return new String(c);
     //Write fixed number of chracter (string with padded space
     //to DataOutput Stream
     public static void writeFixedLengthString (String s,int size, Data.Output out) throws IOException
     char cBuffer[]=new char[size];
     s.getChars(0,s.length(),cBuffer,0);
     for (int i=s.length();i<cBuffer.length;i++)
     cBuffer[i]=' ';
     String newS=new String (cBuffer);
     out.writeChars(newS);
File name:CD
package Kedai;
import java.io.*;
     public class CD
     private String title;
     private String artist;
     private String tracks;
     private String time;
     private String comment;
     //Specify the size of four string fileds in record
     final static int TITLE_SIZE=32;
     final static int ARTIST_SIZE=32;
     final static int TRACKS_SIZE=20;
     final static int TIME_SIZE=10;
     final static int COMMENT_SIZE=40;
     //the total size of the record un bytes,a Unicode
     //character is 2 bytes size
     final static int RECORD SIZE= (TITLE_SIZE+ARTIST_SIZE+TRACKS_SIZE+TIME_SIZE+COMMENT_SIZE);
     //Default constructor
     public CD()
     //Construct with specified data
     public CD (String title,String artist,String tracks,String time,String comment)
     this.title=title;
     this.artist=artist;
     this.tracks=tracks;
     this.time=time;
     this.comment=comment;
     public String getTitle()
     return title;
     public String getArtist()
     return artist;
     public String getTracks()
     return tracks;
     public String getTime()
     return time;
     public String getComment()
     return comment;
//Write a CD to a data output stream
public void writeCD (DataOutput out) throws IOException
FixedLengthStringIO.writeFixedLengthString(title,TITLE_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(artist,ARTIST_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(tracks,TRACKS_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(time,TIME_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(comment,COMMENT_SIZE,out);
//Read CD from data input stream
public void readCD(DataInput in) throws IOException
title=FixedLengthStringIO.readFixedLengthString(TITLE_SIZE,in);
artist=FixedLengthStringIO.readFixedLengthString(ARTIST_SIZE,in);
tracks=FixedLengthStringIO.readFixedLengthString(TRACKS_SIZE,in);
time=FixedLengthStringIO.readFixedLengthString(TIME_SIZE,in);
comment=FixedLengthStringIO.readFixedLengthString(COMMENT_SIZE,in);
File name:Video
package Kedai;
import java.io.*;
     public class Video
     private String title;
     private String director;
     private String time;
     private String comment;
     //Specify the size of four string fileds in record
     final static int TITLE_SIZE=32;
     final static int DIRECTOR_SIZE=32;
     final static int TIME_SIZE=10;
     final static int COMMENT_SIZE=40;
     //the total size of the record un bytes,a Unicode
     //character is 2 bytes size
     final static int RECORD SIZE= (TITLE_SIZE+DIRECTOR_SIZE+TIME_SIZE+COMMENT_SIZE);
     //Default constructor
     public Video()
     //Construct with specified data
     public Video (String title,String director,String time,String comment)
     this.title=title;
     this.director=director;
     this.time=time;
     this.comment=comment;
     public String getTitle()
     return title;
     public String getDirector()
     return director;
     public String getTime()
     return time;
     public String getComment()
     return comment;
//Write a video to a data output stream
public void writeVideo (DataOutput out) throws IOException
FixedLengthStringIO.writeFixedLengthString(title,TITLE_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(director,DIRECTOR_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(time,TIME_SIZE,out);
FixedLengthStringIO.writeFixedLengthString(comment,COMMENT_SIZE,out);
//Read video from data input stream
public void readVideo(DataInput in) throws IOException
title=FixedLengthStringIO.readFixedLengthString(TITLE_SIZE,in);
director=FixedLengthStringIO.readFixedLengthString(DIRECTOR_SIZE,in);
time=FixedLengthStringIO.readFixedLengthString(TIME_SIZE,in);
comment=FixedLengthStringIO.readFixedLengthString(COMMENT_SIZE,in);
I need help in terms of:
1)store,view,search and print the informations of CDs and Videos.
2)store,view,search and print the informations of customers
What should I modify my coding above?What should I do next?Can anyone give me the code since I'm not good enough in creating Java coding.Please. The submission is on 30 September

You made three mistakes:
1) You posted to a JSP/JSTL forum when asking about applet code. Maybe you should redirect your thread to a more appropriate forum - Like one for Applets or general Java Programming.
2) You waited for the last few days to try tosolve your problem. If you spent time working on it little by little you would be closer to a solution.
3) You begged for someone to do the work for you. Asking for help is one thing. That I was willing to do, even though you posted to the wrong forum, but then you said: "someone do it for me because I am not good enough" which really means: "Someone help me cheat and hand in your work as my own because I am too lazy to do it myself."
If you can't do the work, maybe you should drop the course.

Similar Messages

  • How can i print specific pages against searched word or name (in one print command) from 1000 pages

    how can i print specific pages against searched word or name (in one print command) from 1000 pages

    Thanks, Alex!
    ok, I try first approach in print4.vi, but Labview return an error (view jpg); if I cut From, To controls, the VI print all pages. The same things happen also if I trasform I32 in Variant.
    I don't try second approach, because at this time I have only one report
    I try also with VB macro: this is better (print3.vi) but.....if I use:
    Sub Print_Pages_From_To()
    ActiveDocument.ActiveWindow.PrintOut Range:=wdPrintFromTo, From:="2", To:="3"
    End Sub
    is ok; print the pages selected; if I use:
    Sub PrintPages()
    ActiveDocument.ActiveWindow.PrintOut  Pages:="2-3"  
    End Sub
    printer print all pages.
    what do you think?
    regards,
    Italo
    Attachments:
    print Problem.jpg ‏39 KB
    print4.vi ‏19 KB
    print3.vi ‏19 KB

  • Where is the search field in iTunes Store?

    What happened to the search field in the store?

    It should be at the top right of the iTunes screen :
    When viewing the store that field should search the store, if you are viewing your library then it will search that

  • I updated my Itunes and now I don't have a search option in the Store.. What happened to the Search option?

    I updated my Itunes and now I don't have a search option in the Store.. What happened to the Search option?
    I used to be able to type a song title in there and an artist and it would show me my options. Now I have no Search option under Store. 
    Even when you go to the store, there is no way to search for a song.

    Hit the '''Alt''' key ''(Cmd for Mac)'' to show the Menu bar, then open View > Toolbars and select Menu bar, so it has a check-mark.

  • ITunes 11.0.2.26 will not allow me to do a search at the iTunes store.  How do I fix it?

    iTunes 11.0.2.26 will not allow me to do a search at the iTunes store.  How do I fix it?

    Stop whining and you're much more likely to get help.
    Managing content on the iOS device has not changed in any way with the new version of iTunes.
    It is still possible to "drag and drop" content onto the device, my personal opinion is that this is a silly way of managing content.
    Simply select the content desired to sync to the device and synce.
    IF you really want to "drag and drop" content, then Manually manage content on the device must be select from the summary tab for the device.  Then drag and drop content all you desire.  This may require having the sidebar displayed.  To display the sidebar, type Cntrl + S.

  • I downloaded IOS6 and all my apps, including the App Store icon, disappeared. If I go to the Passport icon, there is an App Store button, but I have to search through all the apps to find the one I want  and then click on "Open" to use it.  Help!

    I downloaded IOS6 and all of my app icons, including the App Store icon disappeared. Now to use an icon, I have to go to Passport and click on the App Store button at the bottom and search through all of the apps to find the one I want and then click on Open. There doesn't seem to be a way to delete the app and start over.

    Hey PlayerPS,
    Thanks for the question, and welcome to Apple Support Communities.
    It sounds like the application you are looking for is indeed still on your iPhone. You can confirm this by searching in the Spotlight Search for this application. It may have accidentally been moved to a folder, or an additional Home screen:
    iOS: Understanding Spotlight Search
    http://support.apple.com/kb/HT3636
    via http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    Thanks,
    Matt M.

  • When I try to search in the App store I get a "cannot connect to iTunes" error.

    Everything else in the store works, i.e. top charts, updating apps, etc. It's not my internet because iTunes works on my phone via wifi and 3G. I have tried taking the iPad back to factory settings, resetting the iPad with an iCloud back up, tried using another network, tried setting the time a year ahead and reverting back, tried setting the DNS to 8.8.8.8 and 8.8.4.4 and still wont work. Note: This is only when I try to search in iTunes.
    Addition: iTunes wont let me search either. So App Store and iTunes wont let me search.

    That is a know problem. See:
    https://discussions.apple.com/thread/4319809?tstart=0

  • When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?

    When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?  Thanks

    sandrafromsilver spring wrote:
    When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?  Thanks
    Go to the following link:
    http://jaxov.com/2010/11/how-to-enable-airprint-service-on-mac-os-x-10-6-5/

  • The App Store closes everytime I use the search for an app on my ipod touch using iOS6.

    Can I do anything to stop the App Store closing everything I use the search function?

    See if this helps:
    IOS 6 App store crash: Apple Support Communities

  • HT204266 How do I submit a question to apple? When I try to search int the App Store on my iPod touch 4g on iOS 6, the App Store crashes.

    I have an iPod touch 4g on iOS 6, but whenever I try to search in the App Store, it crashes. Could somebody tell this to apple so they can update?

    That is a know problem. See:
    https://discussions.apple.com/thread/4319809?tstart=0

  • I have an ipad2 and we purchased an HP office jet 6600.  I can not connect to print.  In searching the net, I have been advised to get the firmware update but can not find it.  Can you advise?

    I have an ipad2 and we purchased an HP office jet 6600.  I can not connect to print.  In searching the net, I have been advised to get the firmware update but can not find it.  Can you advise?

    Is the HP on the airprint list?
    iOS AirPrint Printers  http://support.apple.com/kb/HT4356
    How to Print from Your iPad: Summary of Printer and Printing Options
    http://ipadacademy.com/2012/03/how-to-print-from-your-ipad-summary-of-printer-an d-printing-options
    Print from iPad / iPhone without AirPrint
    http://ipadhelp.com/ipad-help/print-from-ipad-iphone-without-airprint/
    How to Enable AirPrint on a Mac and Use Any Printer
    http://ipadhelp.com/ipad-help/how-to-use-airprint-with-any-printer/
     Cheers, Tom

  • How do I get my Iphone 4s photos to a store printer like Walmart to print Christmas cards?

    how do I get my Iphone 4s photos to a store printer like Walmart to print Christmas cards?  I have a windows PC, and am new to owning an Iphone so am pretty dumb about how to do this, and very late in getting my cards out this year!  Any help would be greatly appreciated. 

    See Here
    https://discussions.apple.com/message/15013564#15013564

  • Halfway through the OS X Yosemite update it says I am not connected to the internet (when I know I am because I can search through the app store). How can I fix this? I cannot get on Safari because it requires an update to Mac OS X 10.9 or later.

    Halfway through the OS X Yosemite update it says I am not connected to the internet (when I know I am because I can search through the app store). How can I fix this? I cannot get on Safari because it requires an update to Mac OS X 10.9 or later.

    Just to be clear. You have downloaded the Yosemite installer. However you say while it's updating you get the error you are not online. This is confusing since you shouldn't be able to use your computer in the process of updating.
    Exactly where do you see you need to 10.9 to get on Safari?

  • How do you change the Print Products Store from USA to UK like you can do in IPhoto?

    How do you change the Print Products Store from USA to UK like you can do in IPhoto?

    Please keep in mind that Aperture is not an enhanced iPhoto, it is a different application with a different philosophy and a different intended audience. If you approach it with that in mind you will have a lot less frustration as you learn Aperture.
    Aperture adds a layer of complexity that is not needed by many.  iPhoto is a very powerful application and fits the needs of many amateur photographers.
    As for your original issue, as I said I am surprised that iPhoto allows you do switch countries like that and am not surprised that Aperture doesn't. If this is something you really need to do working in Aperture but using iPhoto to order the prints is a good work around and will not be all that difficult to do once you get the hang of it.
    As for your new question, the books in iPhoto and Aperture are different enough that the code that created the book in iPhoto wouldn't work in Aperture. What happens when you import an iPhoto library into Aperture is that the images in the book are combined into an album in Aperture with the same name as the iPhoto book. You will need to re-create the book in Aperture uaing the images in this album.
    Hope this helps, post back if you have anymore questions.
    regards

  • The search function in App Store, is not working in my iPhone 4, after upgrading to ios6

    The search function in App Store, is not working in my iPhone 4, after upgrading to ios6. Does anyone have a solution for this problem?

    Having the same problem.  No response from Apple as I tried all the suggestions.  Had to perform a system restore.  Currently iy's working.  Make sure you backup everything to your computer.  IOS6 is still glitchy in other areas.

Maybe you are looking for