I'M having problems with code cant get it to work..
I'm trying to read in 6 different weights representing the weights in kg of 6 different bags of flour from the keyboard.calculate the total weight and the average weight of the 6 bags of flour and print out the answers.
i get 8 errors mostly incompatible type and cannot find symbol.
import java.io.*; public class flourWeight{ // //declare some variables and add values //print the values back to the screen // public static void main(String[]args)throws IOException{ //declare some variables double firstWeight ; double secondWeight ; double thirdWeight ; double fourthWeight ; double fifthWeight ; double sixthWeight ; double totalWeight=0 ; double average ; double VAT; BufferedReader kbd=new BufferedReader(new InputStreamReader(System.in));; System.out.println("Enter the weight of the Six bags of flour?"); //Bellow i have printedthe first weight second weight ... //double firstWeight ; System.out.print("first weight= "); firstWeight=kbd.readLine(); // double secondWeight ; System.out.print("Second Weight= "); secondWeight=kbd.readLine(); //double thirdWeight ; System.out.print("third weight= "); thirdWeight=kbd.readLine(); //double fourthWeight; System.out.print("fourth weight= "); fourthWeight=kbd.readLine(); // double fifthWeight ; System.out.print("fifth weight= "); fifthWeight=kbd.readLine(); // double sixthWeight; System.out.print("sixth weight= "); sixthWeight=kbd.readLine(); totalWeight= (firstWeight + secondWeight + thirdWeight + fourthWeight + fifthWeight + sixthWeight); average = ( totalWeight) / 6; //System.out.print(" sum of " + firstNumber + " and " + secondNumber + "and" + thirdNumber + "and" + fourthNumber " = " ); System.out.println("totalWeight : "+totalWeight); System.out.println(" Average : "+average); System.out.println("total priced as euros 3.50 per kg: "+totalWeight*3.50); if(totalWeight < 100) { VAT = (total/100)*23; } if(totalWeight >= 100) { VAT = (total/100)*21; } //double total = 3.50; // final double TAX_RATE = 8.5; // Tax rate in percent //double tax = total * TAX_RATE / 100; // tax is 0.2975 //System.out.println("Total: " + total); //System.out.println("Tax: " + tax); //System.out.printf("Total:%5.2f", total); }//end of main method }//end of class