[SOLVED] I need help fixing an error
Can anyone help me fix my error, the error occurs in the red line
import javax.swing.JOptionPane;
public class ShapesCalc {
public static void main(String[] args) {
//Prompt the user to Enter S, C, or T
String shapeString = JOptionPane.showInputDialog("Enter S, C, or T: ");
char shape = line.charAt(shapeString);
switch(shape) {
case 's':;
case 'S': {
String lengthString = JOptionPane.showInputDialog("Enter length of side: ");
double length = Double.parseDouble(lengthString);
//Calculate perimeter and area of square
double perimeter= ( 4 * length);
double area=(length*length);
String output = "Perimeter is equal to: " + perimeter + "\n" + "Area is equal to: " + area;
JOptionPane.showMessageDialog(null,output);
}; break;
case 'c':;
case 'C': {
String radiusString = JOptionPane.showInputDialog("Enter radius: ");
double radius = Double.parseDouble(radiusString);
//Calculate circumference and area of circle
double circumference= (2*3.14*radius);
double area = (Math.PI * (radius * radius));
String output2 ="Circumference is equal to: " + circumference + "\n" + "Area is equal to: " + area;
JOptionPane.showMessageDialog(null,output2);
}; break;
case 't':;
case 'T': {
String baseString = JOptionPane.showInputDialog("Enter length of base: ");
double base = Double.parseDouble(baseString);
String heightString = JOptionPane.showInputDialog("Enter height of triange: ");
double height = Double.parseDouble(heightString);
//Calculate area of triangle
double area = (base * height) / 2;
String output3 = "Area is equal to: " + area;
JOptionPane.showMessageDialog(null,output3);
}; break;
default: {
JOptionPane.showMessageDialog(null,"Incorrect variable please enter S,C, or T only");
System.exit(1);
};
}