Isaguirre_Figure.java - Isaguirre Daniel G WTHFS 1:30-6:00 import java.util.Scanner public class Isaguirre_Figure public static void main(String args

Isaguirre_Figure.java - Isaguirre Daniel G WTHFS 1:30-6:00...

This preview shows page 1 out of 1 page.

/** Isaguirre, Daniel G. WTHFS 1:30-6:00 */ import java.util.Scanner; public class Isaguirre_Figure { public static void main(String[] args) { // this creates a scanner object that scans values from the input stream Scanner figure = new Scanner(System.in); //output statement that prompts the user to input the figure to compute System.out.println("Menu: Compute Area of"); System.out.println("1.Trapezoid\n2.Ellipse\n3.Equilateral Triangle"); System.out.print("Choice: "); int choice = figure.nextInt(); switch (choice) { // This will run the case when when user input trapeziod case 1: System.out.print("Trapezoid\nEnter h: "); float h = figure.nextFloat(); System.out.print("Enter b1: "); float b1 = figure.nextFloat(); System.out.print("Enter b2: "); float b2 = figure.nextFloat();

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture