Thursday, April 7, 2022

Area of the Triangle Solver in Java

 A program to solve the area of the triangle using Java programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

Please subscribe to my channel  https://www.youtube.com/channel/UCOs-lpOoIeJoh6gpJthPoGg


=================================================

Want to support my channel?


GCash Account


Jake Pomperada

09173084360


Paypal

https://paypal.me/jakerpomperada


Patreon

https://www.patreon.com/jakerpomperada





Program Listing

// area_of_the_triangle.java
// Written By: Mr. Jake R. Pomperada, BSCS, MAED-IT
// July 9, 2015   Thursday
// Email Address:  jakerpomperada@gmail.com
//                 jakerpomperada@yahoo.com

import java.util.Scanner;
 
public class area_of_the_triangle {
 
   public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
       
      char ch;
      double base_triangle = 0;
      double height_triangle = 0;
      double solve_area = 0;
 do {
      System.out.println();
      System.out.print("\tAREA OF THE TRIANGLE SOLVER ");
      System.out.println("\n\n");
      System.out.print("What is the length of base of the triangle : ");
      base_triangle = input.nextDouble();
 
      System.out.print("What is the length of height of triangle : ");
      height_triangle = input.nextDouble();
 
      solve_area = (base_triangle * height_triangle) / 2;
     
      System.out.println();
      System.out.println("The Area of Triangle is : " + solve_area + ".");
      System.out.println();
      System.out.print("\nDo you want to continue (Type y or n) : ");
      ch = input.next().charAt(0);                        
     } while (ch == 'Y'|| ch == 'y');  
      System.out.println();
      System.out.print("\t THANK YOU FOR USING THIS PROGRAM");
      System.out.println("\n\n");
      input.close();
   }
 
}

No comments:

Post a Comment