Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

what the output , input and processing tasks should be to meet the requirements

ID: 3661689 • Letter: W

Question

what the output, input and processing tasks should be to meet the requirements you have been given.

1) (10 pts) A program calculates the volume of a prism whose base is a regular n-sided polygon. A prism is a polyhedron with an n-sided polygonal base. another congruent parallel base (with the same rotational orientation) and in other faces. necessarily all parallelograms) joining corresponding sides of the two base An example of a hexagonal prism is depicted in Figure 1 The formula to calculate the volume of a prism with a regular n-sided polygon base is ha cot Where V: Volume of the prism (in cubic units of length) a: Length of the side of the prism (in units of length) h: Height of the prism (in units of length n: Number of sides of the prism TT: Mathematical constant approximately equal to Figure 1. A hexagonal 3.1416 prism with side length a, cos 0 and height h. Cot: Cotangent trigonometric function cot sin

Explanation / Answer

class Prism{
String name;
     double a=2;
     double n=4;
     double h=5;
     double l=6;
void calculate(){
System.out.println(3*a*l+a*h);
}
void calculate1(){
System.out.println((a*h*l)/2);
}
}
class CalPr{
public static void main(String args[]){
Prism pr1=new Prism();
  pr1.name="Prism-Area";
  System.out.println(pr1.name);
  pr1.calculate();

Prism pr2=new Prism();
  pr2.name="Prism-Volume";
  System.out.println(pr2.name);
  pr2.calculate1();
    }

}