Question: Can someone tell me what is wrong with my code? It won't compile because of the periods tasking for user input, and it's having trouble

Can someone tell me what is wrong with my code? It won't compile because of the periods tasking for user input, and it's having trouble with the Math.pow operation...

import java.util.Scanner;

public class FirstAssignment {

public static void main(String[] args){

// declaring variables and formulas

Scanner sc = new Scanner (System.in);

double sideA;

double sideB;

double sideC;

double angleA;

double angleB;

double angleC;

double sinA;

double cosA;

double tanA;

//taking user input

System.out.println("What is the length of side a?");

sc.sideAdouble();

System.out.println("What is the length of side b?");

sc.sideBdouble();

// working out side c

sideC = (Math.pow(sideA,2)) = (Math.pow(sideB,2));

//angles of A, B, C

angleA = Math.asin(sideA / sideC);

angleB = (angleA - angleC);

angleC = 90.00;

//sine, cosine, and tangent of angle A

sinA = (sideA / sideC);

cosA = (sideB / sideC);

tanA = (sideA / sideB);

//output of the program

System.out.println("The Length of side 'a' is " + sideA);

System.out.println("The length of side 'b' is " + sideB);

System.out.println("The length of side 'c' is " + sideC);

System.out.println("Angle A is " + angleA);

System.out.println("Angle B is " + angleB);

System.out.println("Angle C is " + angleC);

System.out.println("The sine of angle A is " + sinA);

System.out.println("The cosine of angle A is "+ cosA);

System.out.println("The tangent of angle A is " + tanA);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!