User Profile

Collapse

Profile Sidebar

Collapse
OCD
OCD
Last Activity: Mar 28 '08, 08:25 PM
Joined: Feb 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • OCD
    replied to counting change algorithm
    in Java
    But how does this algorithm determine the number of ways? doesnt it just determine the least amount of coins needed? shouldnt the algorithm be
    Number of ways to change amount A using N kinds of coins =
    Number of ways to change amount A using all but the first
    kind of coin
    +
    Number of ways to change amount A - D using all N kinds
    of coins, where D is the denomination...
    See more | Go to post

    Leave a comment:


  • OCD
    started a topic counting change algorithm
    in Java

    counting change algorithm

    I need to write a recursive program to count the number of ways to make change from a given number of cents using quarters, dimes, and nickles. I cant figure out what the algorithm is - do you have any advice for me???
    See more | Go to post

  • OCD
    started a topic keyboard events
    in Java

    keyboard events

    How can i make it so that when a user presses control-S an object is painted in a frame? How can I combine the two key events??
    See more | Go to post

  • OCD
    started a topic linking frames
    in Java

    linking frames

    Hi I need to create two frames in java. One that is a color palette and one that you can load an image into. Then when you click on one of the colors in the color palette frame, you have to be able to draw in that color in the other frame. How can I link these two frames so that the color can be used for drawing???

    thanks
    See more | Go to post

  • OCD
    replied to parsing emails in java
    in Java
    I am haviing trouble parsing the body of the message. This is my code. it doesnt give me any errors but when I try to run it and print it to the screen nothing prints HELP!!!!

    Code:
     
     boolean messageStarted = false;
               if(line.indexOf("Message Body:") != -1)
                {
                    Scanner scan = new Scanner (line);
                    scan.useDelimiter(Pattern.compile("[<>]"));
    ...
    See more | Go to post

    Leave a comment:


  • OCD
    started a topic parsing emails in java
    in Java

    parsing emails in java

    I have to parse an email message by separating the "To", "From", "Subject" and body of the text in order to then use this for a spam filter. I am having a difficult time figuring out how to parse the messages any suggestions???
    See more | Go to post

  • OCD
    replied to monetary amounts in java
    in Java
    you have to give the least amount of 10 dollar bills, 5 dollar bills, one dollar bills, quarters, nickels, dimes, and pennies not just coins
    See more | Go to post

    Leave a comment:


  • OCD
    replied to monetary amounts in java
    in Java
    Code:
    i
    
    mport java.util.Scanner;
    import java.text.NumberFormat;
    import java.util.Locale;
    
    public class Money3
    {
                    public static void main(String args[])
                    {
                            NumberFormat fmt = NumberFormat.getCurrencyInstance  (Locale.US);
                            Scanner input = new Scanner(System.in);
    ...
    See more | Go to post

    Leave a comment:


  • OCD
    started a topic monetary amounts in java
    in Java

    monetary amounts in java

    I have to write a program to prompt for a monetary amount from a user and then change that amount into 10 dollar bills, 5 dollar bills, one dollar bills, quarters, dimes, nickels, and pennies.
    I wrote the program but sometimes it is one penny off. I have read some previous discussions about this which told me to use the BigDecimal class or swing classes but i havent learned about those yet in my class.I was wondering if there are any simpler...
    See more | Go to post
No activity results to display
Show More
Working...