Search:

Type: Posts; User: StrangeFruit

Search: Search took 0.26 seconds.

  1. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    after looking at my code 3 time I realized how stupid I am I use the "=+" operator instead of "+=" that is why it wasn't accumulating correctly.
  2. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    Ok I reentered this code in the first while loop and realized that the code is skipping the first two lines in the .txt file that I am receiving the data from but I don't understand why it is...
  3. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    I tried implementing this code in the while loop of the "getWeekly Sales" method and a run time exception was thrown:


    System.out.println(strtok.nextToken());
  4. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    public class SalesAnalysis
    {

    public static void main(String[] args) throws IOException
    {
    // To hold a line from the file
    String line;
    // Accumulator for all weeks...
  5. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    I have rewritten my "getWeeklySales" class but the output is not correct but I am no longer getting a run time exception.


    public static double getWeeklySales(String str)
    {
    double...
  6. Re: Starting Out With Java Programming Challenge Chapter 10 #11

    public static double getWeeklySales(String str)
    {
    double weekTotal = 0.0;

    // Create the tokenizer.
    StringTokenizer strtok = new StringTokenizer(str, ",");
    //...
  7. Starting Out With Java Programming Challenge Chapter 10 #11

    public static double getWeeklySales(String str)
    {
    double weekTotal = 0.0;

    // Create the tokenizer.
    StringTokenizer strtok = new StringTokenizer(str, ",");
    //...
Results 1 to 7 of 7