java else without if_JAVA编译提示java:34: error: 'else' without 'if'

不知道错在哪里?//HouseSign.java-Thisprogramcalculatespricesforcustomhousesigns.publicclassHouseSign{publicstaticvoidmain(Stringargs[]){//Thisistheworkdoneinthehousekeepi...

不知道错在哪里?

// HouseSign.java - This program calculates prices for custom house signs.

public class HouseSign

{

public static void main(String args[])

{

// This is the work done in the housekeeping() method

// Declare and initialize variables here.

double charge;

String color_char;

String wood_type;

int basis_letter;

double min_charge= 30.00;

double color_charge=12;

double wood_typeCharge=15;

double letter_Charge=3;

double add_charge;

double chr_charge;

// Charge for this sign.

charge= min_charge + add_charge;

// Number of characters.

basis_letter = 8;

// Color of characters.

color_char="gold";

// Type of wood.

wood_type = "oak";

// This is the work done in the detailLoop() method

// Write assignment and if statements here as appropriate.

if (color_char.equals("gold"));

color_charge=12;

else if(wood_type.equals("oak"));

wood_typeCharge=15;

else if(basis_letter = 8);

chr_charge=letter_Charge*2;

else

add_charge=color_charge+wood_typeCharge+chr_charge;

// This is the work done in the endOfJob() method

// Output Charge for this sign.

System.out.println("The charge for this sign is $" + charge);

System.exit(0);

}

}

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值