+ 1
Calculate area of a triangle
it is an isosceles triangle. do not use scanner using menu base ( switch case)
11 Réponses
+ 2
What inputs are you given? Two sides? One angle, one side?
Where do you get the input from, without using Scanner? Function call?
+ 2
There are different ways of calculating the area. I've given two functions:
https://code.sololearn.com/c9380BKxeo2e/?ref=app
public static double area_given_two_sides
(
double side_non_base,
double side_base
)
{
double height = Math.sqrt
(
(side_non_base * side_non_base) -
Math.pow(side_base / 2.0, 2)
);
return height * side_base / 2.0;
}
public static double area_angle_top_and_side_base
(
double angle_top_degrees,
double side_base
)
{
double angle_top = Math.toRadians(angle_top_degrees);
return Math.tan(angle_top / 2.0) * (side_base * side_base) / 4.0;
}
+ 1
Martin you know what on my next test i have to make program using global. ... well i have a month to study
0
under root a Square + b square by 4
ues int , double etc ... and System.out.peint...etc....call function
0
Martin. ..well these are the same question that we get for our test. ...we are not allowed to us things which are not taught so... we have been told not to use ( Scanner, (we just completed function ),) if we use we won't get any marks
0
no these are just for practice. ...Sir said he would not as these questions at all ... ( i am thinking that he would ask us to convert a big decimal number to binary. ..or visa versa)
0
well Martin can you explain why global is used