I have to make this program which asks for a furniture type, the material type and calculates the cost of the furniture while displaying price and the type of material.
// Adam Bashir public class Exercise1 {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
char furntype;
char fabtype;
int c =1000;
int C =1000;
int l =750;
int L =750;
int r =1200;
int R =1200;
String couch="";
System.out.println("Please enter the type of furniture you want! C for couch L for loveseats, and R for Recliner");
furntype = (char)System.in.read();
if (furntype == 'c' || furntype == 'C') {
System.out.println("You chose a couch! It sells for $ " + c);
} else if (furntype == 'l' || furntype == 'L') {
System.out.println("You chose a loveseat! It sells for $750");
} else if (furntype == 'r' || furntype == 'R') {
System.out.println("you chose recliner! It sells for $1200");
} else {
System.out.println("Invalid choice");
}
System.out.println("Would you like fabric or leather for the couch, leather costs 35% more.");
fabtype = (char)System.in.read();
if (fabtype == 'f' || fabtype =='F') {
System.out.println("you selected fabric! your total is $" + furntype);
} else if (fabtype == 'l' || fabtype =='L') {
System.out.println("you chose leather! your new total is $" + fabtype);
} else {
System.out.println("Invalid choice");
}
}
I cannot figure out why my second set of if statements doesn't let me input the fabric choice