Jump to content
  • Advertisement

Rebel Coder

  • Content Count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About Rebel Coder

  • Rank
  1. yeah thanks man, but it's a different sintax so what you're saying does not apply but thanks anyways
  2. Problem: -Create a java program in which an airline can keep track of it's seating assignments. -Using the InputDialog Method ask the user how many people will be coming aboard the plane. - The plane consists of only 5 seats. - Keep assigning people to the seats in the plane until all seats are filled. -Once every seat is filled tell the user no more seats are avaiable. Question: Ok I have a simple question. How do I make it so that I can read the elements inside an array and if any one of them gets to or above 5 it stops letting me input numbers. For example, let's say I have 2 in index 0 and 3 in index 1, that makes 5 so I don't want to store anything more and when i go and input another number it doesn't let me. Another example, let's say index 0 holds the number 5 then it won't let me progress to index 1 because I already have the desired number which is 5. I hope that was pretty clear. This is for a plane assignment seating program with only 5 seats. This is what I have so far: [source lang="java"]import javax.swing.JOptionPane; public class Seating { public static void main(String args[]) { int seatstaken = 0; int seats[] = new int [5]; do{ JOptionPane.showMessageDialog(null, "Welcome to Coqui Air!"); for ( int i= 0; i < seats.length; i ++){ seats = Integer.parseInt(JOptionPane.showInputDialog("How many people will be traveling with you today?")); } for (int i = 0; i <seats.length; i++){ seatstaken += seats; } }while(seatstaken <5); if (seatstaken > 5){ JOptionPane.showMessageDialog(null, "Plane full."); } } }[/source] It's pretty terrible code, but I'm a beggining java programmer and my proffessor did not explain this subject of arrays at all, he just gave us a very brief example and it did not clear up my doubts whatsoever. Also in his example he uses a scanner for input, the problem requires that we use the JOptionPane user input method. Any help is appreciated as I have been trying to solve this since 4 pm my time.
  3. I think I'm very excited for Assasin's Creed 3 don't you think :D
  4. Now to figure out what to do for the next 2 hours in college. #bored
  5. Rebel Coder

    Save my life from miserable hours of manual labor xD

    @Sik: I did it with Microsoft Word. @frob: I will check that out, thanks
  6. So guys, being the awesome community that you are I came to ask for help with a little problem. See I have to make some cards for my college precinct for the night of honors yada yada, basically an activity. Now I have the list of people and its about 800 people D:, gotta get this done by wednesday. So here's what I've been doing, I created my labels, got them all set up real sexy like and I've been manually inserting each person into the label and let's say it's going very,........ slow. So what I want to know (because yes I do not know how) is if I can grab lets say 20 people from the rows of my table and then copy them and paste them into my labels document all at the same time and it will just create new labels for me as the need arises, instead of me having to copy one then paste one into the label and so on, and when my labels run out, copy and paste those again. I hope I explained what I want to do right , I just don't wanna spend hours on this because I'll die haha, if this can be done please let me know. If not I will see you at my funeral after I am done xD
  7. Need to pick an investigation topic based on computer science for college. Im in an investigative mood.
  8. So my teacher gave us this awesome project where we have to data bind the information the user enters on a textbox and selects on a drop down list at the click of a button. He gave us this video which showed us how to get the database set up with the table easy peasy, then when it came to the button coding part, the guy in the video was using C# and I need to do it in VB -___-, I've been looking around and no one can give me a clear answer. So how do I make it so when I click the button it saves the info on a textbox to my table and a dropdownlist selection. If anyone can tell me I'd really appreciate it.
  9. Working with C# and XNA. It;s gonna get le boot once WP8 comes out but at least it's fun to work with. Plus I'm gonna make a game for my gf
  10. Rebel Coder

    It finally happened

    Yeah it is an awesome feeling to get something working after trying to figure it out for a while although the same thing happens to me lol then I have to backtrack because I forgot where I left off on another problem.
  11. Rebel Coder

    It finally happened

    Thanks for the nice comments guys, made the post a little easier to read lol
  12. Rebel Coder

    It finally happened

    Agreed dude it is a great feeling
  13. Rebel Coder

    It finally happened

    Indeed my good sir, but I did not know that and I was excited so yeah that happened EDIT Btw your game Gnoblins looks sweet
  14. #UbiE3 Watch_Dogs is amazing!!! Definitely a day one purchase for me
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!