hi i really need your help i'm a beginner in java and we're having this homework here is my code its not complete and there is error please help me solve this one :( tell me what to do

``````import java.io.*;

public class hangukFishShop {

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

String fishX[] = {" Hakula"," Ngatala"," Atu"," Palukula"," Valu"," Takuo"," Mahimahi"};//fish menu

double fishY[] = { 4.50, 6.75, 4.45, 4.80, 5.10, 4.20, 6.90,};//price of the fish

int leng = fishY.length;
double discount1 = 1.80;    //discount 10%
double discount2 = 7.20;    // discount 20%
double price = 0;
double total = 0;
boolean quit = false;

System.out.println("                           WELCOME!!                              ");
System.out.println("                        HANGUK FISH SHOP!!                         ");
System.out.println("                       ____________________                         ");
System.out.println("                  Item #  FISH                \$\$PRICE per kg           ");
System.out.println("                  ********************************");

for (int i = 0;i<fishY.length;i++){
System.out.println("                   " + fishX [i]+"           "+ fishY [i]);

System.out.println("                --------------------------------");
}

for (int i=1;i<=7;i++)
System.out.println(i + ". Menu item #" + i);

System.out.println("                  ********************************");

do{

System.out.print("Enter Item number: ") ;

case 1:
System.out.println("hakula \$4.50 per kilo");
System.out.print("Kg:");
double hakul = Integer.parseInt(fishX[0]);
calcHaku();//method to calculate the hakula fish
break;
case 2:
System.out.println("Ngatala \$6.75 per kilo");
System.out.print("kg:");
int Nga = Integer.parseInt(fishX[1]);
calcNgatala();
break;
case 3:
System.out.println("'Atu \$4.45 per kilo");
System.out.print("Kg:");
double Atus = Integer.parseInt(fishX[2]);
calcAtu();
break;
case 4:
System.out.println("Palukula \$4.80 per kilo");
System.out.print("Kg:");
double  paluk = Integer.parseInt(fishX[3]);
calcPaluk();
break;
case 5:
System.out.println("Valu \$5.10 per kilo");
System.out.print("Kg:");
double  valus = Integer.parseInt(fishX[4]);
calcValu();
break;
case 6:
System.out.println("Takuo \$4.20 per kilo");
System.out.print("Kg:");
double  Tak = Integer.parseInt(fishX[5]);
//calcTakuo();
case 7:
System.out.println("Mahimahi \$6.90 per kilo");
System.out.print("Kg:");
int Mah = Integer.parseInt(fishX[6]);
calcMahimahi();

break;

case 0:
quit = true;
break;
default :
System.out.println("Invalid choice");

}
}while (! quit);
System.out.println("Bye-bye!");

public void calcHaku(){	//method to calculate the hakula fish
if (hakul == 4){			//if you buy 4kg of hakula
hakul = hakul * fishY[0];
price = hakul - discount1;		//discount 10%
System.out.println("Total = \$"+price);
}

else if (hakul == 8){			//if buy 8kg
hakul = hakul * fishY[0];		//discount 20%
price = hakul  - discount2;
System.out.println("Total = \$"+price);
}

else {					//else normal prize no discount
price = hakul * fishY[0];
System.out.println("Total \$"+price);
}
}

public void calcNGatala(){
if (Nga ==5 & Nga == 6 ){  		//

System.out.println("discount 30% on the other fish we sell");
}

else  {

System.out.println("charge at the regular price as shown on the list");
}
}

public void calcAtu(){
if (Atus == 4){
Atus = Atus * fishY[2];
price = Atus - discount1;
System.out.println("Total = \$"+price);
}

else if (Atus == 8){
Atus = Atus * fishY[2];
price = Atus  - discount2;
System.out.println("Total = \$"+price);
}

else {
price = Atus * fishY[2];
System.out.println("Total \$"+price);
}
}
public void calcPaluk(){
if (paluk == 4){
paluk = paluk * fishY[3];
price = paluk - discount1;
System.out.println("Total = \$"+price);
}

else if (paluk == 8){
paluk = paluk * fishY[3];
price = paluk  - discount2;
System.out.println("Total = \$"+price);
}

else {
price = paluk * fishY[3];
System.out.println("Total \$"+price);
}
}
public void calcValu(){
if (valus == 4)
{
valus = valus * fishY[4];
price =  valus - discount1;
System.out.println("Total \$" + price);
}
else if (valus == 8)
{
valus = valus * fishY[4];
price = valus - discount2;
System.out.println("Total \$" + price);

} else
{
price = valus * fishY[4];
System.out.println("Total \$" + price);
}
}
public void calcTakuo(){
if (Tak == 4){
Tak = Tak * fishY[5];
price =Tak - discount1;
System.out.println("Total = \$"+price);
}

else if (Tak == 8){
Tak = Tak * fishY[5];
price = valus  - discount2;
}
System.out.println("Total = \$"+price);
else {
price = Tak * fishY[5];
System.out.println("Total \$"+price);
}
}

public void calcMahimahi(){
if (Mah ==5 & Mah == 6 ){
Nga = Nga * fishY[1];
price = Nga - discount1;
System.out.println("30% discount on the other fish we sell");
}

else {
Nga = Nga * fishY[1];
price = Nga  - discount2;
System.out.println("charge at the regular price as shown on the list");
}
}

}
}``````

All 9 Replies

Don't expect us to guess what error you have. Exactly what error are you unable to fix? Give full details.

``````String fishX[] = {" Hakula"," Ngatala"," Atu"," Palukula"," Valu"," Takuo"," Mahimahi"};//fish menu

double fishY[] = { 4.50, 6.75, 4.45, 4.80, 5.10, 4.20, 6.90,};//price of the fish

int leng = fishY.length;
double discount1 = 1.80; //discount 10%
double discount2 = 7.20; // discount 20%
double price = 0;
double total = 0;``````

These need to be outside the main method as they are accessed in other methods of the class. Furthermore,

``if (Nga ==5 & Nga == 6 ){``

It should be &&.

And finally, all your other methods, apart from the main method need to be static.

if (Nga ==5 & Nga == 6 ){
It should be &&.

It can be & or &&, but it will always return false either way. Nga can't be both 5 and 6.

all your other methods, apart from the main method need to be static.

You can code that way, but experienced programmers will keep them all as instance methods and just create a new instance in main.

ok sori these are the error that i unable to fix its comment beside the code

``````import java.io.*;

public class hangukFishShop {

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

String fishX[] = {" Hakula"," Ngatala"," Atu"," Palukula"," Valu"," Takuo"," Mahimahi"};

double fishY[] = { 4.50, 6.75, 4.45, 4.80, 5.10, 4.20, 6.90,};

int leng = fishY.length;
double discount1 = 1.80;    //discount 10%
double discount2 = 7.20;    // discount 20%
double discount3 = 0.3;
double price = 0;
double total = 0;
double totalS = 0;
boolean quit = false;

System.out.println("                           WELCOME!!                              ");
System.out.println("                        HANGUK FISH SHOP!!                         ");
System.out.println("                       ____________________                         ");
System.out.println("                  Item #  FISH                \$\$PRICE per kg           ");
System.out.println("                  ********************************");

for (int i = 0;i<fishY.length;i++){
System.out.println("                   " + fishX [i]+"           "+ fishY [i]);

System.out.println("                --------------------------------");
}

for (int i=1;i<=7;i++)
System.out.println(i + ". Menu item #" + i);

System.out.println("                  ********************************");

do{

System.out.print("Enter Item number: ") ;

case 1:
System.out.println("hakula \$4.50 per kilo");
System.out.print("Kg:");
double hakul = Integer.parseInt(fishX[0]);
hangukFishShop.calcHaku();
break;
case 2:
System.out.println("Ngatala \$6.75 per kilo");
System.out.print("kg:");
int Nga = Integer.parseInt(fishX[1]);
hangukFishShop.calcNgatala(); //method is undefined for the type hangukFishShop
break;
case 3:
System.out.println("'Atu \$4.45 per kilo");
System.out.print("Kg:");
double Atus = Integer.parseInt(fishX[2]);
hangukFishShop.calcAtu();//method is undefined for the type hangukFishShop
break;
case 4:
System.out.println("Palukula \$4.80 per kilo");
System.out.print("Kg:");
double  paluk = Integer.parseInt(fishX[3]);
hangukFishShop.calcPaluk();//method is undefined for the type hangukFishShop
break;
case 5:
System.out.println("Valu \$5.10 per kilo");
System.out.print("Kg:");
double  valus = Integer.parseInt(fishX[4]);
hangukFishShop.calcValu();//method is undefined for the type hangukFishShop
break;
case 6:
System.out.println("Takuo \$4.20 per kilo");
System.out.print("Kg:");
double  Tak = Integer.parseInt(fishX[5]);
hangukFishShop.calcTakuo();//method is undefined for the type hangukFishShop
case 7:
System.out.println("Mahimahi \$6.90 per kilo");
System.out.print("Kg:");
int Mah = Integer.parseInt(fishX[6]);
hangukFishShop.calcMahimahi();//method is undefined for the type hangukFishShop

break;

case 0:
quit = true;
break;
default :
System.out.println("Invalid choice");

}
}while (! quit);
System.out.println("Bye-bye!");
}

public static void calcHaku(){
if (hakul == 4){//hakul cannot be resolved to a variable
hakul = hakul * fishY[0];//hakul and fishY cannot be resolved to a variable
price = hakul - discount1;//price, hakul and discount1 cannot be resolved to a variable
System.out.println("Total = \$"+price);//price cannot be resolved to a variable
}

else if (hakul == 8){//hakul cannot be resolved to a variable
hakul = hakul * fishY[0];//fishY and hakul cannot be resolved to a variable
price = hakul  - discount2;//discount2, hakul and price cannot be resolved to a variable
System.out.println("Total = \$"+price);//price cannot be resolved to a variable
}

else {
price = hakul * fishY[0];//fishY,price and hakul cannot be resolved to a variable
System.out.println("Total \$" + price);//price cannot be resolve to a variable
}
}
public static void calcNGatala(){
if (Nga < 5 & Nga > 0 ){
fishY[1] * Nga = price;//syntax error on token "*", invalid AssignmentOperator
System.out.println(" The total is = \t \$"
+ price);

System.out.println("discount 30% on the other fish we sell");
}

else if (Nga == 5 || Nga > 5){
fishY[1] * Nga = price;//syntax error on token "*", invalid AssignmentOperator
System.out.println("The total is = \t \$"
+ price);

System.out.println("\t These are prices of the fishes \n"
+ "\t ******************************* \n"
+ " Name Of Fish \t\t Price per Kilogram(kg) \n"
+ " ************ \t\t ********************** \n"
+ " 1.Hakula     \t\t \$4.50\n"
+ " 2.Atu        \t\t \$4.45\n"
+ " 3.Palukula   \t\t \$4.80\n"
+ " 4.Valu       \t\t \$5.10\n"
+ " 5.Takuo      \t\t \$4.20\n");

System.out.println(" would you like any other fish\n");
System.out.println(" Please choose from the list above");
System.out.println(" Please enter the fish number you'd like");

if (H1 == 1){
System.out.println("Hakula       \t\t \$4.50 \n");

System.out.println(" How much would you like to buy");

total = fishY[0] * num ;
totalS = total * discount3;

if (num > 0 & num < 7){

System.out.println("\nThe total amount is \t \$" +
fishY[0] * num);
System.out.println("\n minus the 30% discount = \t\$"
+ total1+ "\n");

System.out.println("\n\n5kg:\t\t\t\t  " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ (total - totalS));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + (total - totalS)) );
System.out.println("********");
System.out.println("\n\n");
}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ fishY[0] * num);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ total );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + total) );
System.out.println("********");
System.out.println("\n\n");
}

}
else if(A1 == 2){
System.out.println("Atu       \t\t \$4.45 \n");

System.out.println(" How much would you like to buy");

double total2 = fishY[2] * num1 ;
double total3 = total2 * discount3;

if (num1 > 0 & num1 < 7){

System.out.println("\nThe total amount is \t \$" +
total2);
System.out.println("\n minus the 30% discount = \t\$"
+ total3 + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ (total2 - total3));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + (total2 - total3)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ total2);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ total2 );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + total2) );
System.out.println("********");
System.out.println("\n\n");
}
}
else if (P1 == 3){
System.out.println("Palukula   \t\t \$4.80 \n");

System.out.println(" How much would you like to buy");

double total4 = fishY[3] * num2 ;
double total5 = total4 * discount3;

if (num2 > 0 & num2 < 7){

System.out.println("\nThe total amount is \t \$" +
total4);
System.out.println("\n minus the 30% discount = \t\$"
+ total5 + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ (total4 - total5));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + (total4 - total5)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ total4);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ total4 );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + total4) );
System.out.println("********");
System.out.println("\n\n");
}
}
else if (V1 == 4){
System.out.println("Valu       \t\t \$5.10 \n");

System.out.println(" How much would you like to buy");

double total6 = fishY[4] * num3 ;
double total7 = total6 * discount3;

if (num3 > 0 & num3 < 7){

System.out.println("\nThe total amount is \t \$" +
total6);
System.out.println("\n minus the 30% discount = \t\$"
+ total7 + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ (total6 - total7));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + (total6 - total7)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ total6);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ total6 );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + total6) );
System.out.println("********");
System.out.println("\n\n");
}
}
else if (T1 == 5){
System.out.println("Takuo      \t\t \$4.20 \n");

System.out.println(" How much would you like to buy");

double total8 = fishY[5] * num4 ;
double total9 = total8 * discount3;

if (num4 > 0 & num4 < 7){

System.out.println("\nThe total amount is \t \$" +
total8);
System.out.println("\n minus the 30% discount = \t\$"
+ total9 + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ (total8 - total9));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + (total8 - total9)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ total8);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[1] * Nga));
System.out.println("Discounting Price:\t + \t "+ total8 );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[1] * Nga) + total8) );
System.out.println("********");
System.out.println("\n\n");
}
}
else {
System.out.println("SORRY BUT WHAT YOU ARE LOOKING FOR CANNOT BE FOUND HERE!!");
}

{

System.out.println("charge at the regular price as shown on the list");
}
}
//illegal start of expression
public static void calcAtu(){//synteax error, insert "EnumBody" to complete BlockStatement, insert "enum Identifier" to complete EnumHeaderName, syntax error on token "void", @ expected
if (Atus == 4){
Atus = Atus * fishY[2];
price = Atus - discount1;
System.out.println("Total = \$"+price);
}

else if (Atus == 8){
Atus = Atus * fishY[2];
price = Atus  - discount2;
System.out.println("Total = \$"+price);
}

else {
price = Atus * fishY[2];
System.out.println("Total \$"+price);
}
}
public static void calcPaluk(){//synteax error, insert "EnumBody" to complete BlockStatement, insert "enum Identifier" to complete EnumHeaderName, syntax error on token "void", @ expected
if (paluk == 4){
paluk = paluk * fishY[3];
price = paluk - discount1;
System.out.println("Total = \$"+price);
}

else if (paluk == 8){
paluk = paluk * fishY[3];
price = paluk  - discount2;
System.out.println("Total = \$"+price);
}

else {
price = paluk * fishY[3];
System.out.println("Total \$"+price);
}
}
public static void calcValu(){//synteax error, insert "EnumBody" to complete BlockStatement, insert "enum Identifier" to complete EnumHeaderName, syntax error on token "void", @ expected
if (valus == 4)
{
valus = valus * fishY[4];
price =  valus - discount1;
System.out.println("Total \$" + price);
}
else if (valus == 8)
{
valus = valus * fishY[4];
price = valus - discount2;
System.out.println("Total \$" + price);

} else
{
price = valus * fishY[4];
System.out.println("Total \$" + price);
}
}
public static void calcTakuo(){//syntax error, insert "EnumBody" to complete BlockStatement
if (Tak == 4){
Tak = Tak * fishY[5];
price =Tak - discount1;
System.out.println("Total = \$"+price);
}

else if (Tak == 8){
Tak = Tak * fishY[5];
price = valus  - discount2;
}
System.out.println("Total = \$"+price);
else {//syntax error on token "else", delete this token
price = Tak * fishY[5];
System.out.println("Total \$"+price);
}
}

public static void calcMahimahi(){ //synteax error, insert "EnumBody" to complete BlockStatement, insert "enum Identifier" to complete EnumHeaderName, syntax error on token "void", @ expected
if (Mah <5 & Mah > 0){
System.out.println(" The total is = \t \$"
+ fishY[6] * Mah);
}
else if (Mah == 5 || Mah > 5){
System.out.println("The total is = \t \$"
+ fishY[6] * Mah);

System.out.println("\t These are prices of the fishes \n"
+ "\t ******************************* \n"
+ " Name Of Fish \t\t Price per Kilogram(kg) \n"
+ " ************ \t\t ********************** \n"
+ " 1.Hakula     \t\t \$4.50\n"
+ " 2.Atu        \t\t \$4.45\n"
+ " 3.Palukula   \t\t \$4.80\n"
+ " 4.Valu       \t\t \$5.10\n"
+ " 5.Takuo      \t\t \$4.20\n");

System.out.println(" would you like any other fish\n");
System.out.println(" Please choose from the list above");
System.out.println(" Please enter the fish number you'd like");

if (q2 == 1){
System.out.println("Hakula       \t\t \$4.50 \n");

System.out.println(" How much would you like to buy");

double totalA = fishY[0] * num5 ;
double totalB = totalA * discount3;

if (num5 > 0 & num5 < 7){

System.out.println("\nThe total amount is \t \$" +
fishY[0] * num5);
System.out.println("\n minus the 30% discount = \t\$"
+ totalA+ "\n");

System.out.println("\n\n5kg:\t\t\t\t  " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ (totalA - totalB));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + (totalA - totalB)) );
System.out.println("********");
System.out.println("\n\n");
}
else {
System.out.println("Sorry but no discount and"
+" so the total is \$"+ fishY[0]* num5);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ totalA );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + totalA) );
System.out.println("********");
System.out.println("\n\n");
}
}//end if
else if(q2 == 2){
System.out.println("Atu       \t\t \$4.45 \n");

System.out.println(" How much would you like to buy");

double totalC = fish[2] * num6 ;
double totalD = totalC * discount3;

if (num6 > 0 & num6 < 7){

System.out.println("\nThe total amount is \t \$" +
totalC);
System.out.println("\n minus the 30% discount = \t\$"
+ totalD + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ (totalC - totalD));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + (totalC - totalD)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ totalC);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ totalC );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + totalC) );
System.out.println("********");
System.out.println("\n\n");
}
}//end else if
else if (q2 == 3){
System.out.println("Palukula   \t\t \$4.80 \n");

System.out.println(" How much would you like to buy");

double totalE = fishY[3] * num7 ;
double totalF = totalE * discount3;

if (num7 > 0 & num7 < 7){

System.out.println("\nThe total amount is \t \$" +
totalE);
System.out.println("\n minus the 30% discount = \t\$"
+ totalF + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ (totalE - totalF));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + (totalE - totalF)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ totalE);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ totalE );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + totalE) );
System.out.println("********");
System.out.println("\n\n");
}
}//END ELSE IF
else if (q2 == 4){
System.out.println("Valu       \t\t \$5.10 \n");

System.out.println(" How much would you like to buy");

double totalG = fishY[4] * num8 ;
double totalH = totalG * discount;

if (num8 > 0 & num8 < 7){

System.out.println("\nThe total amount is \t \$" +
totalG);
System.out.println("\n minus the 30% discount = \t\$"
+ totalH + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ (totalG - totalH));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + (totalG - totalH)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ totalG);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ totalG );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + totalG) );
System.out.println("********");
System.out.println("\n\n");
}
}//END ELSE IF
else if (q2 == 5){
System.out.println("Takuo      \t\t \$4.20 \n");

System.out.println(" How much would you like to buy");

double totalI = fishY[5] * num9 ;
double totalJ = totalI * discount3;

if (num9 > 0 & num9 < 7){

System.out.println("\nThe total amount is \t \$" +
totalI);
System.out.println("\n minus the 30% discount = \t\$"
+ totalJ + "\n");
System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ (totalI - totalJ));
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + (totalI - totalJ)) );
System.out.println("********");
System.out.println("\n\n");

}
else{
System.out.println("Sorry but no discount and"
+" so the total is \$"+ totalI);

System.out.println("\n\n5kg:\t\t\t\t " + (fishY[6] * Mah));
System.out.println("Discounting Price:\t + \t "+ totalI );
System.out.println("********");
System.out.println("total = \t \$" + ((fishY[6] * Mah) + totalI) );
System.out.println("********");
System.out.println("\n\n");
}
}//END ELSE IF
else {
System.out.println("SORRY BUT WHAT YOU ARE LOOKING FOR CANNOT BE FOUND HERE!!");
}

}

}
}  //';' expected
}``````

Looks like missing or mis-matched {} somewhere, but without proper indentation it's going to be a nightmare to find. Also your deliberately unhelpful variables names make the code incomprehensible. And why is there so mush repeated code?

@JamesCherrill

that 1Mio times worse than you wrote, just for joke put this code to your IDE, really k*i*l*l*e*d my patience on lineNo 132., sure that not just Debuger test, that was unpalatable IQ test,

you forget the "break;" in case 6..

Why are the errors buried in the code like that?

To the OP: the value on the left hand side of the = sign must be a variable - a single variable, not an arithmetic expression or a method call or anything else.
It's not an equal sign like in math, where you're saying "these two things mean the same thing", it's an assignment operator. It means "evaluate the expression on the right, and assign that value to the place indicated on the left. `fishY[1]*Nga` is not an expression that can be understood as a place to put a value.

To go a little deeper, a variable actually has two "values", its "left-hand value" and its "right-hand value". Which one is meant depends on which side of the assignment operator it appears on. The RHV is what we think of as the "value" of the expression - it's what we're looking to change when we say "set foo equal to 34". The LHV is the address on the stack: it's where the RHV is stored.

Take this brief sequence:

``````int a = 3;
int b = 4;
inc c = a + b;``````

Imagine that we know how the stack is constructed, and variables are assigned addresses on the stack in order of their appearance.* Here are the left-hand and right-hand values before and after the addition operation:

``````Variable name    LHV    RHV before   RHV after
a              1         3            3        // unchanged by the addition
b              2         4            4        // unchanged by the addition
c              3         0            7        // unassigned before evaluation

3             NONE       3            3        // always evaluates the same
a+b            NONE       7            7        // always evaluates the same for the same a and b``````

* Substantially true, as it happens, but that doesn't matter

``public static void calcTakuo(){//syntax error, insert "EnumBody" to complete BlockStatement``

The compiler is trying to read this line as part of the previous method, due to a problem with your curly braces*.
Fix your indentation. Do it by hand, not with your IDE, and use Allman syle, like this:

``````public void a()
{
int q = 0;
while (true)
{
if (q >-5)
{
q++;
}
else
{
break;
}
}
}``````

You see how easy it is to figure out what's going on when you line up the opening and closing braces?
Fixing your code by hand will force you to look at each line of it. When you get to the place where you omitted the brace, you'll see it right away. In the process, you might spot some of your other errors.

[EDIT: Okay, I see the problem. It's got to do with the immediately preceding error, not exactly with your curly brace placement. Fix your indentation anyway, it'll do you good]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.