1. http://www.getonic.com/shop/13418/4600 help me win :D

    1 week ago  /  0 notes

  2. HW 1-Shopping cart

    package cart;

    import java.io.*;

    import java.util.*;

    public class CartOperations {

    public static void main(String[] args) throws IOException

    {

    char input;

    int position, quantity;

    String objectName;

    double price;

    Item newItem;

    Cart currentCart=new Cart();

    Cart wishlist=new Cart();

    Scanner keyboard=new Scanner(System.in);

    while(true){

    System.out.println();

    System.out.println(“Menu Options:”);

    System.out.println(“Add Item:\t\tA\t<Name><Price><Quantity>”);

    System.out.println(“Get Item:\t\tG\t<Position>”);

    System.out.println(“Remove Item:\t\tR\t<Position>”);

    System.out.println(“Print All Items:\tP”);

    System.out.println(“Checkout:\t\tC”);

    System.out.println(“Size:\t\t\tS”);

    System.out.println(“Save Wishlist:\t\tW”);

    System.out.println(“Check Cart/Wishlist:\tE”);

    System.out.println(“Quit:\t\t\tQ”);

    System.out.print(“Select menu option: “);

    input=(char)System.in.read();

    System.in.read(); //reads in white space to avoid additional loop

    switch(input)

    {

    case ‘A’: case ‘a’:

    System.out.println();

    System.out.print(“Enter object name: “);

    objectName=keyboard.nextLine();

    System.out.print(“Enter item quantity: “);

    quantity=keyboard.nextInt();

    if(quantity<=0)

    {

    System.out.print(“Invalid Quantity. Please enter new quantity: “);

    quantity=keyboard.nextInt();

    }

    System.out.print(“Enter item price: “);

    price=keyboard.nextDouble();

    if(price<=0)

    {

    System.out.print(“Invalid price. Please enter new price: “);

    price=keyboard.nextDouble();

    }

    newItem=new Item(objectName,price,quantity);

    currentCart.addItem(newItem);

    keyboard.skip(“\n”);

    break;

    case ‘G’: case ‘g’:

    System.out.println();

    System.out.print(“Please enter item position number: “);

    position=keyboard.nextInt();

    currentCart.getItem(position);

    break;

    case ‘R’: case ‘r’:

    System.out.println();

    System.out.print(“Please enter item number to remove: “);

    position=keyboard.nextInt();

    currentCart.removeItem(position);

    break;

    case ‘P’: case ‘p’:

    System.out.println();

    currentCart.printAllItems();

    break;

    case ‘C’: case ‘c’:

    System.out.println();

    currentCart.checkout();

    keyboard.skip(“\n”);

    currentCart=new Cart();

    break;

    case ’S’: case ’s’:

    System.out.println();

    if(currentCart.getSize()>1)

    System.out.println(“There are currently “+currentCart.getSize()+” items in the cart.”);

    else if(currentCart.getSize()==1)

    System.out.println(“There is currently “+currentCart.getSize()+” item in the cart.”);

    else System.out.println(“Cart is empty. Please enter an item.”);

    break;

    case ‘W’: case ‘w’:

    System.out.println();

    wishlist=(Cart) currentCart.clone();

    System.out.println(“Wishlist saved successfully.”);

    break;

    case ‘E’: case ‘e’:

    System.out.println();

    if(currentCart.isEqual(wishlist))

    System.out.println(“Wishlist and current cart are the same.”);

    else System.out.println(“Wishlist and current cart are not the same.”);

    break;

    case ‘Q’: case ‘q’:

    System.out.println();

    System.out.println(“Program terminating. Thank you.”);

    System.exit(0);

    break;

    default

    System.out.println(“Command not recognized. Please try again.”);

    break;

    } //end switch

    } //end while

    } //end main

    } //end class CartOperations

    class Cart

    {

    /**

    * The maximum item amount that a <code>Cart</code> object can contain.

    */

    int MAX_CART_SIZE=50;

    /**

    * The current count of items in main Cart and the wishlist Cart

    */

    int ITEM_COUNT, WISHLIST_ITEM_COUNT;

    int i;

    /**

    * Creates an array of the object <code>Item</code> called cart.

    */

    Item[] CART;

    /**

         * Construct an instance of the <code>Cart</code> class with no <code>Item</code> objects in it.

         * <dt><b>Postcondition:</b><dd>

         *    This <code>Cart</code> has been initialized to an empty list of <code>Item</code> objects.

         */

    public Cart()

    {

    CART=new Item[MAX_CART_SIZE];

    ITEM_COUNT=0;

    } //end cart constructor

        /**

         * Adds a new <code>Item</code> to the <CODE>Cart</CODE>.

         * @param input

         * a new <code>Item</code> to be added to this <CODE>Cart</CODE>

         * <dt><b>Precondition:</b><dd>

         *   This <code>Cart</code> object has been instantiated and the number of Item objects in this Cart is 

         *   less than MAX_CART_SIZE (before the item is added).

         * <dt><b>Postcondition:</b><dd>

         *     The new <code>Item</code> is now stored at the last position in the <code>Cart</code>

         */

    public void addItem(Item input)

    {

    if(ITEM_COUNT!=MAX_CART_SIZE)

    {

    CART[ITEM_COUNT]=input;

    ITEM_COUNT++;

    System.out.println(“Item added: “+input.getObject());

    }else System.out.println(“Cannot add item. Cart full.”);

    } //end addItem method

    /**

         * Prints a neatly formatted table of each <code>Item</code> in the <code>Cart</code> on its 

         * own line with its position number as shown in the sample output.

         * <dt><b>Precondition:</b><dd>

         *   The <code>Cart</code> object has been instantiated.

         * <dt><b>Postcondition:</b><dd>

         *   A neatly formatted table of each <code>Item</code> in the <code>Cart</code> on its own line. 

         */

    public void printAllItems()

    {

    if(!isEmpty()){

    System.out.println(”   Item Name\t\tQuantity\tPrice”);

    for(i=0;i<ITEM_COUNT;i++)

    {

    System.out.print(i+1+”: “);

    CART[i].printItem();

    }

    }else 

    System.out.println(“Cart is empty! Please add items.”);

    } //end printAllItems method

    /**

         * Get the <code>Item</code> at the given position in this <code>Cart</code> object.

         * @param position

         * position of the <code>Item</code> to print 

         * <dt><b>Precondition:</b><dd>

         *   This Cart object has been instantiated and position refers to

         *   a valid position in the array (between 0 and ITEM_COUNT)

         */

    public void getItem(int position)

    {

    if(position<0||position>ITEM_COUNT-1)

    System.out.println(“Invalid item number.”);

    else System.out.printf(”%-21s%-16d$%-6.2f\n”,CART[position].getObject(), 

    CART[position].getQuantity(),CART[position].getPrice()*CART[position].getQuantity());

    } //end getItem method

    /**

         * Removes the <code>Item</code> at the given position in this <code>Cart</code> object.

         * @param position

         * position of the <code>Item</code> to remove

         * <dt><b>Precondition:</b><dd>

         * This <code>Cart</code> object has been instantiated and position refers to a

    * valid position in the array (between 0 and ITEM_COUNT)

    * <dt><b>Postcondition:</b><dd>

    * The <code>Item</code> at the desired position in the <code>Cart</code> has been removed. All Items 

    * that were originally in positions greater than or equal to position are moved forward one position. 

         */

    public void removeItem(int position)

    {

    if(position>ITEM_COUNT-1)

    System.out.println(“Invalid item.”);

    else

    {

    for(i=position;i<ITEM_COUNT-1;i++)

    CART[i]=CART[i+1];

    System.out.println(“Item in position “+position+” removed.”);

    ITEM_COUNT=ITEM_COUNT-1;

    }

    } //end removeItem method

    /**

         * Clears the <code>Cart</code> of all Items and print out all purchased items.

         * <dt><b>Precondition:</b><dd>

         * This <code>Cart</code> has been instantiated.

    * <dt><b>Postcondition:</b><dd>

    * The array of Items in the <code>Cart</code> is empty and the list of purchased items is neatly displayed. 

         */

    public void checkout()

    {

    double total;

    total=0;

    printAllItems();

    for(i=0;i<ITEM_COUNT;i++)

    {

    total+=CART[i].getPrice()*CART[i].getQuantity();

    }

    System.out.printf(“Cart successfully checked out. Your total is: $%-3.2f\n”,total);

    } //end checkout method

    /**

         * Checks to see if the <code>Cart</code> is empty.

         * <dt><b>Precondition:</b><dd>

         * This <code>Cart</code> has been instantiated.

         * @return

    * A return value of <CODE>true</CODE> indicates that an instance of <code>Cart</code>

    * is empty. Otherwise the return value is <code>false</code>

         */

    private boolean isEmpty()

    {

    boolean isEmpty;

    if(ITEM_COUNT==0)

    isEmpty=true;

    else isEmpty=false;

    return isEmpty;

    } //end isEmpty method

    /**

         * Determines the number of Items currently in this <code>Cart</code>.

         * <dt><b>Precondition:</b><dd>

         * This <code>Cart</code> has been instantiated.

         * @return

    *  The number of <code>Items</code> in this <code>Cart</code>.

         */

    public int getSize()

    {

    if(!isEmpty())

    return ITEM_COUNT;

    else return 0;

    } //end getSize method

    /**

         * Generates a copy of this <code>Cart</code> object.

         * @return

         *    The return value is a copy of this <code>Cart</code>. Changes

         *    to the copy will not affect the original. The

         *    return value must be typecast to a <code>Cart</code> before it can be

         *    used.

         */

    public Object clone()

    {

    Cart WISHLIST=new Cart();

    for(i=0;i<ITEM_COUNT;i++)

    WISHLIST.addItem(CART[i]);

    WISHLIST_ITEM_COUNT=ITEM_COUNT;

    return WISHLIST;

    }

    /**

         * Checks to see if the <code>Cart</code> is equal to a wishlist.

         * @param input

         * Instance of <code>Cart</code> to be compared

         * <dt><b>Precondition:</b><dd>

         * This <code>Cart</code> has been instantiated.

         * @return

    * A return value of true indicates that <code>input</code> refers to a <code>Cart</code> object 

    * with the same Items in the same order as this Cart. Otherwise, the return value is <code>false</code>.

         */

    public boolean isEqual(Cart input)

    {

    if(ITEM_COUNT==WISHLIST_ITEM_COUNT)

    {

    for(i=0;i<ITEM_COUNT;i++)

    if(input.CART[i]!=CART[i])

    return false;

    }

    else return false;

    return true;

    }

    } //end class Cart 

    class Item

    {

    /**

    * The name of the object in <code>Item</code>

    */

    private String OBJECT;

    /**

    * The price of the object in <code>Item</code>

    */

    private double PRICE;

    /**

    * The quantity of the object in <code>Item</code>

    */

    private int QUANTITY;

    /**

         * Construct an instance of the <code>Item</code> class.

         * <dt><b>Postcondition:</b><dd>

         *    This <code>Item</code> has been initialized with an object, price, and quantity.

         */

    public Item(String object,double price,int quantity)

    {

    OBJECT=object;

    PRICE=price;

    QUANTITY=quantity;

    } //end Item constructor

    /**

         * Prints an <code>Item</code> neatly formatted.

         * <dt><b>Precondition:</b><dd>

         *   The <code>Item</code> object has been instantiated.

         * <dt><b>Postcondition:</b><dd>

         *   A neat formatted print out of an <code>Item</code> 

         */

    public void printItem()

    {

    System.out.printf(”%-21s%-16d$%-6.2f\n”,OBJECT, QUANTITY,PRICE*QUANTITY);

    } //end printItem method

    /**

         * Returns the price of an <code>Item</code>

         * @return

         *    The return value is the price of an <code>Item</code>

         */

    public double getPrice()

    {

    return PRICE;

    } //end getPrice method

    /**

         * Returns the quantity of an <code>Item</code>

         * @return

         *    The return value is the quantity of an <code>Item</code>

         */

    public int getQuantity()

    {

    return QUANTITY;

    } //end getQuantity method

    /**

         * Returns the name of an <code>Item</code>

         * @return

         *    The return value is the name of an <code>Item</code>

         */

    public String getObject()

    {

    return OBJECT;

    }

    } //end class Item

    1 month ago  /  0 notes

  3. I’m gonna start being a nerd….

    So yea, I’m going to school for computer science and haven’t posted anything recently so here are my programs.

    1 month ago  /  0 notes

  4. Dear tumblr…..

    WHY YOU NO HAVE IPAD APP???????


    Thank you
    Joe

    11 months ago  /  1 note

  5. A Little Tech Rant

    So, my mom asks me today if it’s possible to extend the range of my existing wireless network in my house so that it reaches my bedroom so my brother can do his homework in there. Sure it’s possible. I just need a repeater (in this case, I was going to use an Airport Express). So first things first. How do I set up the Airport Express to act as a repeater instead of the Selectable Dual Band router it’s designed to be. It’s simple you just set it up as part of a WDS network…… if your base station is another Apple router (e.g. Airport Express, Airport Extreme, Time Capsule). So onto the Google I go. Looking, looking, looking, AHA! I just have to set my router to allow the network to be extended. Great! Time to log into the router admin screen that I have come to know and love and wait…. where’s that setting? Back to Google to find the support for my ancient Linksys WRT300N router (it’s draft-n dammit!) to see if it even supports it. Sure enough it doesn’t. Scratch that plan let’s see about moving the router and the modem to the next floor…… that would prevent me from being able to play XBOX Live so no and I would have to call up the cable company in order to put in a new coaxial jack upstairs. So now I get the pleasure to convince my mom that we need a $190 router for my house, the Airport Extreme. Now I know there are several different dual band routers that are cheaper and don’t have many problems but I’ve been on an Apple spree recently and well the Airport Extreme also gets the highest reviews. Plus should I have an issue with the signal again, all I need is an Airport Express. Problem solved. But now the question is this. After swapping out the router and reconnecting all eight computers, 3 iPhones, iPod Touch, and 2 XBOX 360s back onto the network with all the correct ports forwarded, am I going to have to redo the networked printer I have set up because that will be a bitch. Note to self: Stop messing around with the wireless. 

    1 year ago  /  0 notes

  6. It ain’t hardcore… unless it’s hexacore! MEGA GIGABYTES SON! Everything in the computer needs to have my face on it

    1 year ago  /  0 notes

  7. Win Win starring Paul Giamatti…. and Nick Lopez lmfao 1:40 hahaha i can’t wait to see this

    1 year ago  /  0 notes

  8. killpunkrockstars:

 
APRIL 13 - MAY 1, 2011
Ska is Dead presents…
The Young Guns Tour
WE ARE THE UNION
&amp; THE FORTHRIGHTS
featuring THE FAD (4/19 - 4/27)!
Be sure to check our SHOWS page &amp; SkaisDead.com for more info!
The Fad are a punk band from Levittown, NY formed in the year 2000.  8 years, 2 records, 9 drummers &amp; many tours later, The Fad called it quits to pursue other projects.  A benefit for a friend brought them back together in 2009, but many of the shows for the following “Give It A Rest” Tour were canceled due to snow.  This April 2011, Jimmy Doyle, Tom “The Birdman” Malinowski &amp; Danny Sabella, along with Reed Wolcott &amp; Jim Margle of We Are The Union will be bringing “Kill Punk Rock Stars” back on the road as part of The Young Guns Tour presented by Ska is Dead.

    killpunkrockstars:

    APRIL 13 - MAY 1, 2011

    Ska is Dead presents…

    The Young Guns Tour

    WE ARE THE UNION

    & THE FORTHRIGHTS

    featuring THE FAD (4/19 - 4/27)!

    Be sure to check our SHOWS page & SkaisDead.com for more info!

    The Fad are a punk band from Levittown, NY formed in the year 2000.  8 years, 2 records, 9 drummers & many tours later, The Fad called it quits to pursue other projects.  A benefit for a friend brought them back together in 2009, but many of the shows for the following “Give It A Rest” Tour were canceled due to snow.  This April 2011, Jimmy Doyle, Tom “The Birdman” Malinowski & Danny Sabella, along with Reed Wolcott & Jim Margle of We Are The Union will be bringing “Kill Punk Rock Stars” back on the road as part of The Young Guns Tour presented by Ska is Dead.

    1 year ago  /  16 notes  /  Source: killpunkrockstars