I need to create a bingo card...

Hi I am totally clueless and started my class well behind everybody else. I am not asking for solution to my assignment is the assignment is to create the whole game, all I am asking is how to start. I am supposed to start by creating a Bingo Card. We were given some codes already, like Arraybag, BagADT etc. using General <T>. Could somone please help me get started?
I am trying to create a bingocard class. I am supposed to use the Arraybag.
// ArrayBag.java Author: Lewis/Chase
// Represents an array implementation of a bag.
import java.util.*;
public class ArrayBag<T> implements BagADT<T>
private static Random rand = new Random();
private final int DEFAULT_CAPACITY = 100;
private final int NOT_FOUND = -1;
private int count; // the current number of elements in the bag
private T[] contents;
// Creates an empty bag using the default capacity.
public ArrayBag()
count = 0;
contents = (T[])(new Object[DEFAULT_CAPACITY]);
// Creates an empty bag using the specified capacity.
public ArrayBag (int initialCapacity)
count = 0;
contents = (T[])(new Object[initialCapacity]);
// Adds the specified element to the bag.
// Expands the capacity of the bag array if necessary.
public void add (T element)
if (size() == contents.length)
expandCapacity();
contents[count] = element;
count++;
// Adds the contents of the parameter to this bag.
public void addAll (BagADT<T> bag)
Iterator<T> scan = bag.iterator();
while (scan.hasNext())
add (scan.next());
// Removes a random element from the set and returns it. Throws
// an EmptySetException if the set is empty.
public T removeRandom() throws EmptyBagException
if (isEmpty())
throw new EmptyBagException();
int choice = rand.nextInt(count);
T result = contents[choice];
contents[choice] = contents[count-1]; // fill the gap
contents[count-1] = null;
count--;
return result;
// Removes one occurrence of the specified element from the bag
// and returns it.Throws an EmptyBagException if the bag is empty
// and a NoSuchElementException if the target is not in the bag.
public T remove (T target) throws EmptyBagException,
NoSuchElementException
int search = NOT_FOUND;
if (isEmpty())
throw new EmptyBagException();
for (int index=0; index < count && search == NOT_FOUND; index++)
if (contents[index].equals(target))
search = index;
if (search == NOT_FOUND)
throw new NoSuchElementException();
T result = contents[search];
contents[search] = contents[count-1];
contents[count-1] = null;
count--;
return result;
// Returns a new bag that is the union of this bag and the
// parameter.
public BagADT<T> union (BagADT<T> bag)
ArrayBag<T> both = new ArrayBag<T>();
for (int index = 0; index < count; index++)
both.add (contents[index]);
Iterator<T> scan = bag.iterator();
while (scan.hasNext())
both.add (scan.next());
return both;
// Returns true if this bag contains the specified target
// element.
public boolean contains (T target)
int search = NOT_FOUND;
for (int index=0; index < count && search == NOT_FOUND; index++)
if (contents[index].equals(target))
search = index;
return (search != NOT_FOUND);
// Returns true if this bag contains exactly the same elements
// as the parameter.
public boolean equals (BagADT<T> bag)
boolean result = false;
ArrayBag<T> temp1 = new ArrayBag<T>();
ArrayBag<T> temp2 = new ArrayBag<T>();
T obj;
if (size() == bag.size())
temp1.addAll(this);
temp2.addAll(bag);
Iterator<T> scan = bag.iterator();
while (scan.hasNext())
obj = scan.next();
if (temp1.contains(obj))
temp1.remove(obj);
temp2.remove(obj);
result = (temp1.isEmpty() && temp2.isEmpty());
return result;
// Returns true if this bag is empty and false otherwise.
public boolean isEmpty()
return (count == 0);
// Returns the number of elements currently in this bag.
public int size()
return count;
// Returns an iterator for the elements currently in this bag.
public Iterator<T> iterator()
return new ArrayIterator<T> (contents, count);
// Returns a string representation of this bag.
public String toString()
String result = "";
for (int index=0; index < count; index++)
result = result + contents[index].toString() + "\n";
return result;
// Creates a new array to store the contents of the bag with
// twice the capacity of the old one.
private void expandCapacity()
T[] larger = (T[])(new Object[contents.length*2]);
for (int index=0; index < contents.length; index++)
larger[index] = contents[index];
contents = larger;
======================================================
I started my class like this:
* BingoCard.java
* Created on January 28, 2006, 9:08 PM
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
public class BingoCard {
/** Creates a new instance of BingoCard */
public BingoCard() {
public static void main (String[] args)
ArrayBag<BingoCard> bingoBag = new ArrayBag<BingoCard>();
BingoCard Card;
What can I do or am I doing wrong? Please help me learn.

Hey thanks for all the help. I got figured out so thanks again. :D

Similar Messages

  • When I try to send a calendar invite I get the following error ... iCal was unable to send the invitation.  To be able to send invitations, you need to create an address card for yourself in Address Book.

    I have deleted and recreated "My Card" several times, but iCal is still not recognizing the card.  The application was working fine until a few weeks ago.  I recently purchased Microsoft Office for Mac but have not installed any other new software.  Also checked to make sure my mac software is updated.  Help!!!

    ebnovotny,
    Have you also used Address Book>Card>Make This My Card?
    If you have, you could also quit iCal, find the com.apple.ical.plist file in your Macintosh HD/Users/yourusername/Library/Preferences folder and drag it to the Desktop. Then log out/in or restart and check if your card is recognized.

  • How to create a post card with elements 8.0?

    I need help creating a post card using my pics..

    Try this video tutorial:
    http://www.photoradar.com/techniques/video/get-creative-with-type

  • HT2534 i need to create an apple id with out card

    i need to create an apple id with out card can u give any suggestions..............for me

    You can create an iTune and App Store account without credit card details
    1. Sign out of current Apple ID if you are sign-in to one (important)
    2. Go to App Store and select a free app
    3. Tap INSTALL APP
    4. Create New Apple ID
    5. Confirm Your Country
    6. Agree with Terms and Conditions
    7. Fill in your Apple ID and Password (you must create a new Apple ID; don't use your old Apple ID)
    8. Create and answer your secret question
    9. Select NONE for Payment Method
    10. Fill in Billing Address
    11. Submit application for new Apple ID
    12. Wait for verification email
    13. When email arrive, verify your account
    14. Start downloading your free apps

  • Need to create alv report to show pan card number.

    Hi,
    I need to create alv report to show employee and vendor  name , number ,  Pan card number .This is for hr module.
    could any one tell me table and fields for this and how I can relate them with foriegn and primary key.
    Regards,
    Moderator Message: Do your own work
    Edited by: kishan P on Oct 5, 2010 10:38 AM

    Yes, but it only has one generic Date column, no start date and end date. I can't use that twice in the prompt. Although I can specify it to be 'between', but I'm not sure I can pass values to both variables like that.
    Currently I have used Campaign Start Date and Campaign End Date to enter values in calender format to the variables.

  • Can i replace my email in iTune account? with same credit card information? or do i need to create new one with same credit card? thanks

    hello all,
    i have an account on iTune, can i replace the email with another one and keep all information of credit card? sorta like creating a new account but you are not?
    or do i need to create new account but keep the credit card information?
    thanks all

    You have posted in the itunes U forum, where colleges, universities and museums post educational content for students.
    Try posting in the appropriate forum.
    Do not create a new account.  Go to your account in itunes and change whatever you like.  Your account name is in the upper right corner of itunes.  Click the drop down arrow and select account.

  • Hi.  I have a Macbook Pro Model 5,5 with one 800 firewire port.  I need to create two firewire 800 ports but only have an SD card slot (this is for video interface with 2 cameras).  Is this possible or do I have to have an express card slot in order to do

    Hi.  I have a Macbook Pro Model 5,5 with one 800 firewire port.  I need to create two firewire 800 ports but only have an SD card slot (this is for video interface with 2 cameras).  Is this possible or do I have to have an express card slot in order to do this?

    Hi Jessica,
    No, the SD slot will not work, you need an ExpressCard/34 slot.
    I do not know if it works with cameras, but with two or more HDs, if the first one has two FW ports, you can "daisy chain" one or more additional HDs from it.

  • My phone number appears on my daughters iTouch and she can receive my text messages.  If I need to creaye a new user account for her itouch, can i use the same iTunes account or do i need to create a new iTunes account?

    My phone number appears in my daughters list of acceptable numbers to receive texts or messages on her iTouch.
    I sync her iTouch on my iTunes account.
    Do I need to create a separate iTunes account for her to prevent this from happening?  or can i use the same itunes account and just create a separate a differne user name for the same itunes account?
    If i need to create a separate iTunes account, how can i save her data and game levels?

    I recommend that you
    Create a NEW account/ID for her using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Use the new ID on her iPod but only for:
    Settings>Messages>Send and Receive
    Settings>FaceTime
    and Settings>iCloud if you want her to have separate Contacts Calendar and some other things.
    Continue to use the same/common Apple ID for Settings>iTunes and App stores so you can share purchases.

  • Is this the product I need to create PDF from a form online?

    Hello,
    I need to develop an application where the user fills out an online form and a pdf is automatically created and emailed to them, a copy is also archived. Am I looking in the corect place by exploring LiveCycle PDF Generator or am I looking for something else? I am currently using php and MySQL but from the looks of it may be necesary to use XML. This is very new to me so any direction would be much appreciated.
    Thanks
    Nils Satterstrom

    I am in the same boat as Nils. Has anyone made any discoveries on this? I have a call in to a "specialist" at Adobe, but it will be 3-5 days before someone gets back to me. I want to collect the data using PHP/MySQL and then populate a PDF template of some sort to create a print-ready PDF that I can send to my printer.
    An example of how we plan on using this is with business cards. We're going to create a business card template PDF with form fields for Name, Title, Phone, Email, etc. and then have the user enter in their information and then create a print-ready PDF we could send to the printer to get printed. I am unclear on which Adobe product would work for this. The pre-sales team at Adobe said we might want to look into InDesign server and LiveCycle. I guess the starting price tag for either of those is $10,000.
    Any insight would be great. Thanks!

  • Payment of Expense Report invoice created from credit card transactions

    We are implementing corporate credit cards into iExpenses using the company pay method. When expense reports are created from aquitting credit card transactions and exported into Payables does anyone know if it is possible to pay the expense report invoice that has been created without needing to run the Create Credit Card Issuer Invoice program? The reason for this question is that I want to avoid running this program as our credit card provider direct debits our account from our bank account rather than us transmitting the funds to them and don't need to create an invoice for the credit card provider. Any assistance would be gretly appreciated. Thanks

    Hi  Harry
    You can use the badi TRIP_POST_FI   .you can create custom table & mention the different symbolic account number  & change your  symbolic account based on your expense type by using the above badi. While you do FI posting  your expense types will get posted in two hit two different G/L account
    It will surely solve your problem.. I had same issue in my earlier project which i have done the above solution.
    Thanks
    Anwar Hossain

  • Need to create stupid proof templates for non-designers

    Ok folks, I'm new to this forum having come across it in search of a solution to my problem.
    I need to create illustrator template files (.ai not .ait) that customers can download and use to create their own artwork for print. I have to create them in every printable paper format from business cards to A3 posters, folding, non-folding yada yada.
    Now, previously, we used an .ai file with a guide layer we created. This guide layer had all relevant info, was named accordingly. It was set not to print and locked. As I tend to use print to file, distiller and all, this has always been perfectly adequate to create my pdfs. Of course, this doesn't work the same way when saving a pdf, which is what most people do. However, customers who wish to download the templates are having some difficulty with the concept of 'make sure you delete the guide layer before saving your pdf'.
    For the most part, the customers using these files are not illustrator literate. Even though there are clear instructions to 'delete' the guide layer when saving the needed pdfs, they are failing to do so. This means when the .ai (with the non printable layer) is saved to pdf, the guide layer as a hidden object is saved within the pdf. Upon printing at our printing facilities, the guide layer has been printed with disasterous results.
    A possible solution we came up with was to use the ruler guides to create the guide layer. For this solution to work though, I need to be able to use different colours for different guides within the same document. Which we can't. We can only change all the guide colours and they are all the same colour.
    Another idea would be to outline text indicating various printable and non-printable areas and making them into guides via View>guides>make guides, which works to an extent but looks messy, especially when viewing the full page and again, isn't particularly distinctive, leading back to having different guides in different colours.
    I've come across another possible solution involving template layers. Viewing the resulting pdf seems fine and in all purposes it does what we need, except for when reopening the saved (not printed) pdf back in illustrator, the template layer is still there and I need it gone. The same way it would be if the .ai were printed to postscript and sent through distiller.
    My ideal solution would be to have to ability to have the different coloured ruler guides in place throughout my document, but as I previously stated, all guides have to be the same colour and that's useless in this instance.
    So, has anyone got any bright ideas. Coincidentally I need to create the same templates for both psd and indesign but I'll cross that bridge when I've figured this out.

    Hey Mike, thanks for the response.
    1. Not a chance, if, even when the process is described in great detail in an info pdf, available as info on the website (with screenshot instructions) and mentioned in the .ai file itself, they aren't even deleting the guide layer, then turning off 'Preserve illustrator editing capabilities' is kind of a stretch. Like I said, the folks these templates are to be designed for are not illustrator literate for the most part.
    2. Not sure if this would work. I'd have to look into it.
    3. Beyond my capabilities. I'll let you know if number 2 works.
    One possible solution I've come up with uses the idea of a template layer always on top, with 'DELETE THIS LAYER' and screenshot of layers pallette and clear little red arrows etc. If I can the template layer to always remain on top, with their artwork layer underneath, they would have to toggle hide/unhide to view their artwork, and the reminder to remove the guide layer would be pretty much in their face. That's not a guarantee either though.
    Personally, I think what I've been asked to achieve is a pretty hard task and honestly, I'm thinking there are no failsafe options.

  • Need to create a user policy form

    Can anyone help?
    I need to create a policy form in Dreamweaver CS4 that a user needs to accept, or not, before proceeding further to another page in my site? After they accept the form the functionality needs to take the individual to another page where they are able to make charitable contributions using credit cards that would be sent directly to the organizations bank. They are trying to avoid using PayPal.
    This is my first time using this concept and I'm getting lost.
    Thanks
    Swany

    Unfortunately it's not perfect. With the other recommendation a user could simply go to the URL without viewing the policy page and thus not accepting the terms. For instance in the example anyone could just go to http://google.com without accepting the terms. Just view source code and see where GoTo URL directs upon accept. Also because there is no server side restriction to the page then the page is crawled by search engines so someone searching for your page online may go to your form page without first being redirected to the policy page.
    With server side restriction the page is not crawled by search engines so the page will not come up in search results and users could not simply visit the URL because it would restrict access and redirect to the "login" AKA policy page first. Server side authentication is always the best method.
    If you'd still like to go about doing it the recommended way let me know and I can walk you through the process. Basically just create a MySQL database table for the users username and password then user Dreamweaver Server behaviors to create the restrict access page and login page. It's pretty straight-forward to use the server behaviors in Dreamweaver once the database is setup. I walked someone through how to setup a database with GoDaddy recently and it's a similar process with other hosts.
    If the other imperfect method that can be worked around works for you then that's great!

  • Creating a folded card

    As a long-time Windows user, I have in the past created many greetings cards and "brochures" using MS Publisher which has an option of a publication layout to produce book-fold publications where I can produce four pages, and then print pages 4 and 1 side by side, and then 2 and 3 on the reverse side (and then fold it like a greetings card).
    I am a fairly new Mac user and seeking an alternative to MS
    Publisher and have been testing out the trial version of Pages (v.1.0.2) on a real brochure which I have a need to produce and I just cannot get it to do this logically. I have set the document to print two pages side by side, but I have to lay it out with my back page as page 1, then my front page as page 2. If I then set the layout to be facing
    pages in order to set inside and outside margins, the pages re-arrange themselves into a different order! The Help files say that odd pages will always be on the right hand side. So - I then reset my pages back to their logical order, and sure enough page 1 is then on the right, followed by 2 and 3 side by side, followed by 4 on the left. However, there is then no way I can then print 4 and 1 side by side, followed by 2 and 3.
    I have tried this with all pages in separate sections, and with all pages in one section, and with pages 2-3 in one section, but it makes no difference. I can of course go back to calling page 4 page 1 as above, and that works fine provided I don't want my pages numbered, but it seems a very basic need for anyone trying to use a simple DTP type program. Is there any way to do this? I have read the thread headed "Newby trying to make booklet" posted on 17th January and the answer seems to be that the only way is to export the document to PDF and use a booklet program to print from. This seems crazy!
    I would be really grateful for any help, even if it's to say - stop looking - you can't do it. (And in that case is there a good simple not-too-expensive DTP program for the Mac that would do what I want?)

    Hello Sally,
    welcome to the Pages Discussions. The easyst way to
    have a "four-pager" by one fold is, to have a
    document with only two sheets. Create page 1 and page
    4 on the first sheet and the pages 2-3 on the second
    sheet of the document. You have to set the paper size
    in Pages to landscape, than you can fold the sheet
    after printing.
    But if you want to have more then a "four-pager" (and
    not a many folded flyer), you have to use the
    solution David mentioned.
    Thank you Frank. This is the solution I had ended up with, which does work, but really it is as I guessed, and there is no automatic way.

  • How to create a letterpress card using iPhoto on my iMac?

    How to create a letterpress card using iPhoto on my iMac

    You CAN'T do it with Flash Player. You'd need Flash Professional and you'll need to learn Actionscript. I've been through the Lynda.com training for Flash, and it's not something you learn in a few minutes or even hours, or can be gleened from a guide. It takes days and possibly weeks, even if you're already good with Photoshop and/or Illustrator and Fireworks.

  • Having trouble creating a comp card, any suggestions?

    Having trouble creating a comp card, any suggestions?

    What trouble are you having? We need details, or we can't be of any help.
    This question is kind of like calling a mechanic on the phone and saying "I'm having some trouble with my car; any suggestions?"

Maybe you are looking for

  • How to update metadata (e.g. keywords, author) for pdf created from spool

    Hi Experts, My requirement is that smart-form spool will be converted into PDF and will be saved on to application server. Now, a third party tool will read the data and print it. I want to update properties of this PDF like author, keywords. These p

  • The VCC property was not found on the resource

    Hi all, I used a subversion to download/upload process in one of my application. At a point it give an error like this. svn: The VCC property was not found on the resourceCan someone tell me what that error means, and how to fix it. Thanks in advance

  • Vendor Name

    Guys, How do I bring Vendor Name along with Vendor Number to BI.  It looks like this is nowhere in the 0FI_AP_4 or 0FI_AP_6 extractors.  Any clues? Thanks, Recca

  • Can I create and order photo book using iPhoto in UAE?

    Hello, Curretly I'm in UAE, Dubai. Can I create and order a phto book using iPhoto and get it in my Dubai or Abu Dhabi address? Regards

  • Calling Procedure in Form Personalization in R12

    Hi, I'm trying to call a procedure in form Personalization (R12). Tried below versions but getting error, could you suggest ? ='begin XXHI_DFF_NULL(''' || $KANBAN_CARDS.KANBAN_CARD_NUMBER || ''' ); end' ===============================================