এই নিবন্ধে, আমরা একটি ট্রাপিজিয়াম এলাকা খুঁজে কিভাবে বুঝতে হবে. ট্র্যাপিজিয়াম হল এক ধরনের চতুর্ভুজ যার অন্তত এক জোড়া পাশ একে অপরের সমান্তরাল থাকে। ট্র্যাপিজিয়ামের সমান্তরাল বাহুগুলিকে বেস বলা হয় এবং ট্র্যাপিজিয়ামের অ-সমান্তরাল বাহুগুলিকে পা বলা হয়। একে ট্র্যাপিজয়েডও বলা হয়।
একটি ট্রাপিজিয়ামের ক্ষেত্রফল −
সূত্র ব্যবহার করে গণনা করা হয়(height/2 * (side_1 + side_2). i.e. Area = ½ x (sum of the lengths of the parallel sides) x perpendicular distance between parallel sides
নীচে একই একটি প্রদর্শনী আছে. a এবং b সমান্তরাল বাহুর দৈর্ঘ্য সহ একটি ট্রাপিজিয়ামের ক্ষেত্রফল এবং ট্রাপিজিয়াম h এর উচ্চতা −

ইনপুট
ধরুন আমাদের ইনপুট হল −
side_1 = 5 side_2 = 6 height = 6
আউটপুট
কাঙ্খিত আউটপুট হবে −
Area of trapezium is: 33.0
অ্যালগরিদম
Step 1 - START Step 2 – Declare three integer values namely side_1 , side_2 and height. Declare a float value namely my_area. Step 3 - Read the required values from the user/ define the values Step 4 – Calculate the area of the trapezium using the formula (height/2 * (side_1 + side_2) and store the result Step 5- Display the result Step 6- Stop
উদাহরণ 1
এখানে, একটি প্রম্পটের উপর ভিত্তি করে ব্যবহারকারী দ্বারা ইনপুট প্রবেশ করানো হচ্ছে। আপনি আমাদের কোডিং গ্রাউন্ড টুলে এই উদাহরণটি লাইভ চেষ্টা করতে পারেন
।
import java.util.Scanner;
public class AreaOfTrapezium {
public static void main(String args[]){
int side_1 , side_2 , height ;
System.out.println("Required packages have been imported");
Scanner my_scanner = new Scanner(System.in);
System.out.println("A reader object has been defined ");
System.out.print("Enter the length of the first parallel side: ");
side_1 = my_scanner.nextInt();
System.out.print("Enter the length of the first parallel side : ");
side_2 = my_scanner.nextInt();
System.out.print("Enter the heigth of the trapezium : ");
height = my_scanner.nextInt();
float my_area = (height/2 * (side_1 + side_2));
System.out.println("The area of trapezium is: " + my_area);
}
} আউটপুট
Required packages have been imported A reader object has been defined Enter the length of the first parallel side: 5 Enter the length of the first parallel side : 6 Enter the heigth of the trapezium : 6 The area of trapezium is: 33.0
উদাহরণ 2
এখানে, পূর্ণসংখ্যা পূর্বে সংজ্ঞায়িত করা হয়েছে, এবং এর মান অ্যাক্সেস করা হয়েছে এবং কনসোলে প্রদর্শিত হয়েছে।
public class AreaOfTrapezium {
public static void main(String args[]){
int side_1 = 5, side_2 = 6, height = 6;
System.out.println("The sides and height of the trapezium is defined as " +side_1 + ", " + side_2 + " and " + height);
float my_area = (height/2 * (side_1 + side_2));
System.out.println("The area of Trapezium is: " + my_area);
}
} আউটপুট
The sides and height of the trapezium is defined as 5, 6 and 6 The area of Trapezium is: 33.0