i have this much but i dont get why my high profitable items is 0 and bonus is 0...should be 1 and 20
import java.util.Scanner;// program uses class Scanner public class Assign4 { public static void main(String[] args) { new Assign4 (); Scanner input = new Scanner( System.in ); double total; // sum of values double Commission=0; // Commission earned double earnings=0;// number with decimal point for average double bonus=0;// bonus amount for high value items total = 0; // initialize total int valueCounter = 0; // initialize loop counter bonus = 0; // initialize bonus int bonusCounter = 0; //initialize bonus counter System.out.print( "Enter item Value, or -1 to quit: " ); double value = input.nextDouble(); // loop until sentinel value read from user while ( value != -1 ) { total = total + value; // add value to total valueCounter = valueCounter + 1; // increment counter // prompt for input and read next value from user System.out.print( "Enter item Value, or -1 to quit: " ); value = input.nextDouble(); } // end while // termination phase // if user entered at least one amount... if ( valueCounter != 0 ) { if ( value>=350.00 ) { bonusCounter = bonusCounter + 1; // bonus counter // calculate commission with bonus earnings for high value item Commission = ((double) total /100)* 9+20; total = (double) total; earnings = (double)Commission + 200; } else if(value<350.00) { // calculate commission of total amount Commission = ((double) total /100)* 9; total = (double) total; earnings = (double)Commission + 200; } } // display everything System.out.printf("Items Sold : " + valueCounter); System.out.printf("\nTotal Amount: $%.2f\n", total); System.out.printf("Commission: $%.2f\n", Commission); System.out.printf("High profitable items: " +bonusCounter); System.out.printf("\nBonus : $%.2f\n", bonus); System.out.printf("Earnings: $%.2f\n", earnings); // end if // end class Assign4 } }