dhyuti-n/xlcost-variable-roles huggingface dataset:
Java program:
import java . io . * ; class GFG { static float squarearea ( float r ) { if ( r < 0 ) return - 1 ; float a = 4 * ( float ) ( Math . pow ( r , 2 ) / 5 ) ; return a ; } public static void main ( String [ ] args ) { float r = 5 ; System . out . println ( squarearea ( r ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static float rectanglearea ( float a , float b ) { if ( a < 0 b < 0 ) return - 1 ; return 2 * a * b ; } public static void main ( String args [ ] ) { float a = 10 , b = 8 ; System . out . println ( rectanglearea ( a , b ) ) ; } }

Class/struct names: GFG
Java program:
public class GFG { static float squareArea ( float l , float b , float h ) { if ( l < 0 b < 0 h < 0 ) return - 1 ; float a = ( l * b ) / ( l + b ) ; return a * a ; } public static void main ( String [ ] args ) { float l = 5 , b = 12 , h = 13 ; System . out . println ( squareArea ( l , b , h ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int MAX = 50 ; static void solveQuery ( int n , int q , int qi [ ] , int qj [ ] ) { int [ ] arr = new int [ MAX ] ; for ( int i = 0 ; i <= n ; i ++ ) arr [ i ] = 0 ; for ( int k = 0 ; k < q ; k ++ ) { int flag = 0 ; if ( qj [ k ] < qi [ k ] ) { int temp = qi [ k ] ; qi [ k ] = qj [ k ] ; qj [ k ] = temp ; } if ( arr [ qi [ k ] ] != 0 arr [ qj [ k ] ] != 0 ) flag = 1 ; else if ( qi [ k ] == qj [ k ] ) flag = 1 ; else { for ( int i = 1 ; i < qi [ k ] ; i ++ ) { if ( arr [ i ] != 0 && arr [ i ] < qj [ k ] && qi [ k ] < arr [ i ] ) { flag = 1 ; break ; } } if ( flag == 0 ) { for ( int i = qi [ k ] + 1 ; i < qj [ k ] ; i ++ ) { if ( arr [ i ] != 0 && arr [ i ] > qj [ k ] ) { flag = 1 ; break ; } } } } if ( flag == 0 ) { System . out . println ( " YES " ) ; arr [ qi [ k ] ] = qj [ k ] ; arr [ qj [ k ] ] = qi [ k ] ; } else System . out . println ( " NO " ) ; } } public static void main ( String [ ] args ) { int n = 10 ; int q = 7 ; int qi [ ] = { 1 , 2 , 2 , 2 , 9 , 10 , 8 } ; int qj [ ] = { 5 , 7 , 3 , 4 , 9 , 9 , 6 } ; solveQuery ( n , q , qi , qj ) ; } }

Index/key variables: MAX, i, k
Accumulator variables: i, k
Iterator variables: i, k
Class/struct names: GFG
Java program:
class GFG { static int squares ( int l , int b , int a ) { return ( int ) ( Math . ceil ( l / ( double ) a ) * Math . ceil ( b / ( double ) a ) ) ; } public static void main ( String [ ] args ) { int l = 11 , b = 23 , a = 14 ; System . out . println ( squares ( l , b , a ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int gcd ( int a , int b ) { if ( a == 0 b == 0 ) return 0 ; if ( a == b ) return a ; if ( a > b ) return gcd ( a - b , b ) ; return gcd ( a , b - a ) ; } static int squarearea ( int l , int b ) { if ( l < 0 b < 0 ) return - 1 ; int n = ( l * b ) / gcd ( l , b ) ; return n * n ; } public static void main ( String [ ] args ) { int l = 6 , b = 4 ; System . out . println ( squarearea ( l , b ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static double angle_triangle ( int x1 , int x2 , int x3 , int y1 , int y2 , int y3 , int z1 , int z2 , int z3 ) { int num = ( x2 - x1 ) * ( x3 - x1 ) + ( y2 - y1 ) * ( y3 - y1 ) + ( z2 - z1 ) * ( z3 - z1 ) ; double den = Math . sqrt ( Math . pow ( ( x2 - x1 ) , 2 ) + Math . pow ( ( y2 - y1 ) , 2 ) + Math . pow ( ( z2 - z1 ) , 2 ) ) * Math . sqrt ( Math . pow ( ( x3 - x1 ) , 2 ) + Math . pow ( ( y3 - y1 ) , 2 ) + Math . pow ( ( z3 - z1 ) , 2 ) ) ; double angle = Math . acos ( num / den ) * ( 180.0 / 3.141592653589793238463 ) ; return angle ; } public static void main ( String [ ] args ) { int x1 = - 1 ; int y1 = 3 ; int z1 = 2 ; int x2 = 2 ; int y2 = 3 ; int z2 = 5 ; int x3 = 3 ; int y3 = 5 ; int z3 = - 2 ; double angle_A = angle_triangle ( x1 , x2 , x3 , y1 , y2 , y3 , z1 , z2 , z3 ) ; double angle_B = angle_triangle ( x2 , x3 , x1 , y2 , y3 , y1 , z2 , z3 , z1 ) ; double angle_C = angle_triangle ( x3 , x2 , x1 , y3 , y2 , y1 , z3 , z2 , z1 ) ; System . out . println ( " Angles ▁ are ▁ : " ) ; System . out . println ( " angle ▁ A ▁ = ▁ " + angle_A + " ▁ degree " ) ; System . out . println ( " angle ▁ B ▁ = ▁ " + angle_B + " ▁ degree " ) ; System . out . println ( " angle ▁ C ▁ = ▁ " + angle_C + " ▁ degree " ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; import java . lang . * ; import java . io . * ; class GFG { static int solve ( int M , int N , int s ) { if ( N % s == 0 ) { N = N / s ; } else { N = ( N / s ) + 1 ; } if ( M % s == 0 ) { M = M / s ; } else { M = ( M / s ) + 1 ; } return M * N ; } public static void main ( String args [ ] ) { int N = 12 , M = 13 , s = 4 ; System . out . println ( solve ( M , N , s ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static int solve ( double M , double N , double s ) { int ans = ( ( int ) ( Math . ceil ( M / s ) ) * ( int ) ( Math . ceil ( N / s ) ) ) ; return ans ; } public static void main ( String [ ] args ) { double N = 12 , M = 13 , s = 4 ; System . out . println ( solve ( M , N , s ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { { int x ; int y ; } static int orientation ( Point p , Point q , Point r ) { int val = ( q . y - p . y ) * ( r . x - q . x ) - ( q . x - p . x ) * ( r . y - q . y ) ; if ( val == 0 ) return 0 ; return ( val > 0 ) ? 1 : 2 ; } static boolean doIntersect ( Point p1 , Point q1 , Point p2 , Point q2 ) { int o1 = orientation ( p1 , q1 , p2 ) ; int o2 = orientation ( p1 , q1 , q2 ) ; int o3 = orientation ( p2 , q2 , p1 ) ; int o4 = orientation ( p2 , q2 , q1 ) ; if ( o1 != o2 && o3 != o4 ) return true ; return false ; } static boolean similar ( Point p1 , Point p2 ) { if ( p1 . x == p2 . x && p1 . y == p2 . y ) return false ; return true ; } static boolean collinear ( Point p1 , Point p2 , Point p3 ) { int x1 = p1 . x , y1 = p1 . y ; int x2 = p2 . x , y2 = p2 . y ; int x3 = p3 . x , y3 = p3 . y ; if ( ( y3 - y2 ) * ( x2 - x1 ) == ( y2 - y1 ) * ( x3 - x2 ) ) return false ; else return true ; } static int no_of_quads ( Point p1 , Point p2 , Point p3 , Point p4 ) { boolean same = true ; same = same & similar ( p1 , p2 ) ; same = same & similar ( p1 , p3 ) ; same = same & similar ( p1 , p4 ) ; same = same & similar ( p2 , p3 ) ; same = same & similar ( p2 , p4 ) ; same = same & similar ( p3 , p4 ) ; if ( same == false ) return 0 ; boolean coll = true ; coll = coll & collinear ( p1 , p2 , p3 ) ; coll = coll & collinear ( p1 , p2 , p4 ) ; coll = coll & collinear ( p1 , p3 , p4 ) ; coll = coll & collinear ( p2 , p3 , p4 ) ; if ( coll == false ) return 0 ; int check = 0 ; if ( doIntersect ( p1 , p2 , p3 , p4 ) ) check = 1 ; if ( doIntersect ( p1 , p3 , p2 , p4 ) ) check = 1 ; if ( doIntersect ( p1 , p2 , p4 , p3 ) ) check = 1 ; if ( check == 0 ) return 3 ; return 1 ; } public static void main ( String args [ ] ) { Point p1 , p2 , p3 , p4 ; p1 = new Point ( ) ; p2 = new Point ( ) ; p3 = new Point ( ) ; p4 = new Point ( ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = - 1 ; p2 . y = 0 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 5 ; p4 . y = 9 ; System . out . println ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = - 1 ; p2 . y = 0 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 0 ; p4 . y = 3 ; System . out . println ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = 0 ; p2 . y = 10 ; p3 . x = 0 ; p3 . y = 11 ; p4 . x = 0 ; p4 . y = 12 ; System . out . println ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; p1 . x = 0 ; p1 . y = 9 ; p2 . x = 0 ; p2 . y = 9 ; p3 . x = 5 ; p3 . y = - 1 ; p4 . x = 0 ; p4 . y = 3 ; System . out . println ( no_of_quads ( p1 , p2 , p3 , p4 ) ) ; } }

Boolean variables: coll, same
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void equation_plane ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 , float x3 , float y3 , float z3 ) { float a1 = x2 - x1 ; float b1 = y2 - y1 ; float c1 = z2 - z1 ; float a2 = x3 - x1 ; float b2 = y3 - y1 ; float c2 = z3 - z1 ; float a = b1 * c2 - b2 * c1 ; float b = a2 * c1 - a1 * c2 ; float c = a1 * b2 - b1 * a2 ; float d = ( - a * x1 - b * y1 - c * z1 ) ; System . out . println ( " equation ▁ of ▁ plane ▁ is ▁ " + a + " ▁ x ▁ + ▁ " + b + " ▁ y ▁ + ▁ " + c + " ▁ z ▁ + ▁ " + d + " ▁ = ▁ 0 . " ) ; } public static void main ( String [ ] args ) { float x1 = - 1 ; float y1 = 2 ; float z1 = 1 ; float x2 = 0 ; float y2 = - 3 ; float z2 = 2 ; float x3 = 1 ; float y3 = 1 ; float z3 = - 4 ; equation_plane ( x1 , y1 , z1 , x2 , y2 , z2 , x3 , y3 , z3 ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static void shortest_distance ( float x1 , float y1 , float a , float b , float c ) { double d = Math . abs ( ( ( a * x1 + b * y1 + c ) ) / ( Math . sqrt ( a * a + b * b ) ) ) ; System . out . println ( " Perpendicular ▁ " + " distance ▁ is ▁ " + d ) ; return ; } public static void main ( String [ ] args ) { float x1 = 5 ; float y1 = 6 ; float a = - 2 ; float b = 3 ; float c = 4 ; shortest_distance ( x1 , y1 , a , b , c ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class solution { static void octant ( float x , float y , float z ) { if ( x >= 0 && y >= 0 && z >= 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 1st ▁ octant " ) ; else if ( x < 0 && y >= 0 && z >= 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 2nd ▁ octant " ) ; else if ( x < 0 && y < 0 && z >= 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 3rd ▁ octant " ) ; else if ( x >= 0 && y < 0 && z >= 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 4th ▁ octant " ) ; else if ( x >= 0 && y >= 0 && z < 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 5th ▁ octant " ) ; else if ( x < 0 && y >= 0 && z < 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 6th ▁ octant " ) ; else if ( x < 0 && y < 0 && z < 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 7th ▁ octant " ) ; else if ( x >= 0 && y < 0 && z < 0 ) System . out . println ( " Point ▁ lies ▁ in ▁ 8th ▁ octant " ) ; } public static void main ( String args [ ] ) { float x = 2 , y = 3 , z = 4 ; octant ( x , y , z ) ; x = - 4 ; y = 2 ; z = - 8 ; octant ( x , y , z ) ; x = - 6 ; y = - 2 ; z = 8 ; octant ( x , y , z ) ; } }

Class/struct names: solution
Java program:
import java . io . * ; class GFG { static int countNumberOfTriangles ( int n ) { return n * ( n - 1 ) * ( n - 2 ) / 6 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( countNumberOfTriangles ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static long centeredTridecagonalNum ( long n ) { return ( 13 * n * ( n - 1 ) + 2 ) / 2 ; } public static void main ( String [ ] args ) { long n = 3 ; System . out . println ( centeredTridecagonalNum ( n ) ) ; n = 10 ; System . out . println ( centeredTridecagonalNum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int pentagon_pyramidal ( int n ) { int sum = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { int p = ( 3 * i * i - i ) / 2 ; sum = sum + p ; } return sum ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( pentagon_pyramidal ( n ) ) ; } }

Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int pentagon_pyramidal ( int n ) { return n * n * ( n + 1 ) / 2 ; } public static void main ( String [ ] args ) { int n = 4 ; System . out . println ( pentagon_pyramidal ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean checkConcurrent ( int a1 , int b1 , int c1 , int a2 , int b2 , int c2 , int a3 , int b3 , int c3 ) { return ( a3 * ( b1 * c2 - b2 * c1 ) + b3 * ( c1 * a2 - c2 * a1 ) + c3 * ( a1 * b2 - a2 * b1 ) == 0 ) ; } public static void main ( String [ ] args ) { int a1 = 2 , b1 = - 3 , c1 = 5 ; int a2 = 3 , b2 = 4 , c2 = - 7 ; int a3 = 9 , b3 = - 5 , c3 = 8 ; if ( checkConcurrent ( a1 , b1 , c1 , a2 , b2 , c2 , a3 , b3 , c3 ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int center_octadecagon_num ( int n ) { return 9 * n * n - 9 * n + 1 ; } public static void main ( String [ ] args ) { int n = 3 ; System . out . print ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; System . out . println ( center_octadecagon_num ( n ) ) ; n = 13 ; System . out . print ( n + " th ▁ centered ▁ " + " octadecagonal ▁ number ▁ : ▁ " ) ; System . out . println ( center_octadecagon_num ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int centereddecagonalnum ( int n ) { return ( 5 * n * n + 5 * n + 1 ) ; } public static void main ( String [ ] args ) { int n = 5 ; System . out . print ( n + " th ▁ centered ▁ " + " decagonal ▁ number : ▁ " ) ; System . out . println ( centereddecagonalnum ( n ) ) ; n = 9 ; System . out . print ( n + " th ▁ centered ▁ " + " decagonal ▁ number : ▁ " ) ; System . out . println ( centereddecagonalnum ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int factorial ( int a , int b ) { int res = 1 ; for ( int i = 1 ; i <= ( a + b ) ; i ++ ) res = res * i ; for ( int i = 1 ; i <= a ; i ++ ) res = res / i ; for ( int i = 1 ; i <= b ; i ++ ) res = res / i ; return res ; } static void Ksmallest ( int x , int y , int k ) { if ( x == 0 && y == 0 ) return ; else if ( x == 0 ) { y -- ; System . out . print ( " V " ) ; Ksmallest ( x , y , k ) ; } else if ( y == 0 ) { x -- ; System . out . print ( " H " ) ; Ksmallest ( x , y , k ) ; } else { if ( factorial ( x - 1 , y ) > k ) { System . out . print ( " H " ) ; Ksmallest ( x - 1 , y , k ) ; } else { System . out . print ( " V " ) ; Ksmallest ( x , y - 1 , k - factorial ( x - 1 , y ) ) ; } } } public static void main ( String [ ] args ) { int x = 2 , y = 2 , k = 2 ; Ksmallest ( x , y , k ) ; } }

Accumulator variables: i, x, y
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int centered_pentagonal_Num ( int n ) { return ( 5 * n * n - 5 * n + 2 ) / 2 ; } public static void main ( String [ ] args ) { int n = 7 ; System . out . print ( n + " th ▁ Centered ▁ " + " pentagonal ▁ number : ▁ " ) ; System . out . println ( centered_pentagonal_Num ( n ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int pivotDis ( int x0 , int y0 , int x1 , int y1 ) { return ( int ) Math . sqrt ( ( x1 - x0 ) * ( x1 - x0 ) + ( y1 - y0 ) * ( y1 - y0 ) ) ; } static int minDis ( int D , int r1 , int r2 ) { return Math . max ( ( D - r1 - r2 ) , 0 ) ; } static int maxDis ( int D , int r1 , int r2 ) { return D + r1 + r2 ; } public static void main ( String [ ] args ) { int x0 = 0 , y0 = 0 , x1 = 8 , y1 = 0 , r1 = 4 , r2 = 5 ; int D = pivotDis ( x0 , y0 , x1 , y1 ) ; System . out . print ( " Distance ▁ while ▁ " + " repulsion ▁ = ▁ " + maxDis ( D , r1 , r2 ) ) ; System . out . print ( " Distance while " + " attraction ▁ = ▁ " + minDis ( D , r1 , r2 ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static void otherEndPoint ( int x1 , int y1 , int m1 , int m2 ) { float x2 = ( float ) ( 2 * m1 - x1 ) ; float y2 = ( float ) ( 2 * m2 - y1 ) ; System . out . println ( " x2 ▁ = ▁ " + x2 + " , ▁ " + " y2 ▁ = ▁ " + y2 ) ; } public static void main ( String args [ ] ) { int x1 = - 4 , y1 = - 1 , m1 = 3 , m2 = 5 ; otherEndPoint ( x1 , y1 , m1 , m2 ) ; } }

Class/struct names: GFG
Java program:
import java . util . Arrays ; import java . util . Collections ; class GFG { static void printRect ( Integer X [ ] , Integer Y [ ] , int n ) { int Xmax = Collections . max ( Arrays . asList ( X ) ) ; int Xmin = Collections . min ( Arrays . asList ( X ) ) ; int Ymax = Collections . max ( Arrays . asList ( Y ) ) ; int Ymin = Collections . min ( Arrays . asList ( Y ) ) ; System . out . println ( " { " + Xmin + " , ▁ " + Ymin + " } " ) ; System . out . println ( " { " + Xmin + " , ▁ " + Ymax + " } " ) ; System . out . println ( " { " + Xmax + " , ▁ " + Ymax + " } " ) ; System . out . println ( " { " + Xmax + " , ▁ " + Ymin + " } " ) ; } public static void main ( String [ ] args ) { Integer X [ ] = { 4 , 3 , 6 , 1 , - 1 , 12 } ; Integer Y [ ] = { 4 , 1 , 10 , 3 , 7 , - 1 } ; int n = X . length ; printRect ( X , Y , n ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean checkOrigin ( int x1 , int y1 , int x2 , int y2 ) { return ( x1 * ( y2 - y1 ) == y1 * ( x2 - x1 ) ) ; } public static void main ( String [ ] args ) { if ( checkOrigin ( 1 , 28 , 2 , 56 ) == true ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static boolean isBetween ( int a , int b , int c ) { return ( Math . min ( a , b ) <= c && c <= Math . max ( a , b ) ) ; } static boolean canJoin ( int x [ ] , int y [ ] , int i , int j , int k ) { return ( x [ k ] == x [ i ] x [ k ] == x [ j ] ) && isBetween ( y [ i ] , y [ j ] , y [ k ] ) || ( y [ k ] == y [ i ] y [ k ] == y [ j ] ) && isBetween ( x [ i ] , x [ j ] , x [ k ] ) ; } static int countLineSegments ( int x [ ] , int y [ ] ) { if ( ( x [ 0 ] == x [ 1 ] && x [ 1 ] == x [ 2 ] ) || ( y [ 0 ] == y [ 1 ] && y [ 1 ] == y [ 2 ] ) ) return 1 ; else if ( canJoin ( x , y , 0 , 1 , 2 ) || canJoin ( x , y , 0 , 2 , 1 ) || canJoin ( x , y , 1 , 2 , 0 ) ) return 2 ; else return 3 ; } public static void main ( String [ ] args ) { int x [ ] = new int [ 3 ] , y [ ] = new int [ 3 ] ; x [ 0 ] = - 1 ; y [ 0 ] = - 1 ; x [ 1 ] = - 1 ; y [ 1 ] = 3 ; x [ 2 ] = 4 ; y [ 2 ] = 3 ; System . out . println ( countLineSegments ( x , y ) ) ; } }

Index/key variables: i, j, k
Class/struct names: GFG
Java program:
import java . io . * ; import java . util . * ; class GFG { static Boolean pythagorean_quadruple ( int a , int b , int c , int d ) { int sum = a * a + b * b + c * c ; if ( d * d == sum ) return true ; else return false ; } public static void main ( String [ ] args ) { int a = 1 , b = 2 , c = 2 , d = 3 ; if ( pythagorean_quadruple ( a , b , c , d ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }

Class/struct names: GFG
Java program:
public class demo { static float pi = 3.14159f ; public static float volume ( float r , float R , float h ) { return ( float ) 1 / 3 * pi * h * ( r * r + R * R + r * R ) ; } public static float curved_surface_area ( float r , float R , float l ) { return pi * l * ( R + r ) ; } public static float total_surface_area ( float r , float R , float l , float h ) { return pi * l * ( R + r ) + pi * ( r * r + R * R ) ; } public static void main ( String args [ ] ) { float small_radius = 3 ; float big_radius = 8 ; float slant_height = 13 ; float height = 12 ; System . out . print ( " Volume ▁ Of ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; System . out . println ( volume ( small_radius , big_radius , height ) ) ; System . out . print ( " Curved ▁ Surface ▁ Area ▁ Of " + " ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; System . out . println ( curved_surface_area ( small_radius , big_radius , slant_height ) ) ; System . out . print ( " Total ▁ Surface ▁ Area ▁ Of " + " ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; System . out . println ( total_surface_area ( small_radius , big_radius , slant_height , height ) ) ; } }

Class/struct names: demo
Java program:
import java . io . * ; class GFG { int Circumference ( int a ) { return 4 * a ; } public static void main ( String args [ ] ) { GFG obj = new GFG ( ) ; int a = 5 ; System . out . println ( " Circumference ▁ of ▁ " + " a ▁ square ▁ is ▁ " + obj . Circumference ( a ) ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static double maxArea ( double a , double b , double c , double d ) { double semiperimeter = ( a + b + c + d ) / 2 ; return Math . sqrt ( ( semiperimeter - a ) * ( semiperimeter - b ) * ( semiperimeter - c ) * ( semiperimeter - d ) ) ; } public static void main ( String [ ] args ) { double a = 1 , b = 2 , c = 1 , d = 2 ; System . out . println ( maxArea ( a , b , c , d ) ) ; } }

Class/struct names: GFG
Java program:
class GFG { static class point { int x , y ; } ; static int RIGHT = 1 , LEFT = - 1 , ZERO = 0 ; static int directionOfPoint ( point A , point B , point P ) { B . x -= A . x ; B . y -= A . y ; P . x -= A . x ; P . y -= A . y ; int cross_product = B . x * P . y - B . y * P . x ; if ( cross_product > 0 ) return RIGHT ; if ( cross_product < 0 ) return LEFT ; return ZERO ; } public static void main ( String [ ] args ) { point A = new point ( ) , B = new point ( ) , P = new point ( ) ; A . x = - 30 ; B . x = 29 ; P . x = 15 ; int direction = directionOfPoint ( A , B , P ) ; if ( direction == 1 ) System . out . println ( " Right ▁ Direction " ) ; else if ( direction == - 1 ) System . out . println ( " Left ▁ Direction " ) ; else System . out . println ( " Point ▁ is ▁ on ▁ the ▁ Line " ) ; } }

Accumulator variables: x, y
Class/struct names: GFG, point
Java program:
import java . util . Arrays ; class GFG { static int minRadius ( int k , int [ ] x , int [ ] y , int n ) { int [ ] dis = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) dis [ i ] = x [ i ] * x [ i ] + y [ i ] * y [ i ] ; Arrays . sort ( dis ) ; return dis [ k - 1 ] ; } public static void main ( String [ ] args ) { int k = 3 ; int [ ] x = { 1 , - 1 , 1 } ; int [ ] y = { 1 , - 1 , - 1 } ; int n = x . length ; System . out . println ( minRadius ( k , x , y , n ) ) ; } }

Index/key variables: i, n
Accumulator variables: i
Iterator variables: i
Class/struct names: GFG
Java program:
import java . io . * ; class Geometry { static int areaRectangle ( int a , int b ) { int area = a * b ; return area ; } static int perimeterRectangle ( int a , int b ) { int perimeter = 2 * ( a + b ) ; return perimeter ; } public static void main ( String [ ] args ) { int a = 5 ; int b = 6 ; System . out . println ( " Area ▁ = ▁ " + areaRectangle ( a , b ) ) ; System . out . println ( " Perimeter ▁ = ▁ " + perimeterRectangle ( a , b ) ) ; } }

Class/struct names: Geometry
Java program:
import java . util . * ; class GFG { static int areaSquare ( int side ) { int area = side * side ; return area ; } public static void main ( String [ ] args ) { int side = 5 ; System . out . println ( areaSquare ( 4 ) ) ; } }

Class/struct names: GFG
Java program:
import java . util . * ; class GFG { public static long minPerimeter ( int n ) { int l = ( int ) Math . sqrt ( n ) ; int sq = l * l ; if ( sq == n ) return l * 4 ; else { long row = n / l ; long perimeter = 2 * ( l + row ) ; if ( n % l != 0 ) perimeter += 2 ; return perimeter ; } } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( minPerimeter ( n ) ) ; } }

Accumulator variables: perimeter
Class/struct names: GFG
Java program:
import java . util . Arrays ; class GFG { static void possibleOrNot ( long a1 , long a2 , long b1 , long b2 , long c1 , long c2 ) { long dis1 = ( long ) Math . pow ( b1 - a1 , 2 ) + ( long ) Math . pow ( b2 - a2 , 2 ) ; long dis2 = ( long ) Math . pow ( c1 - b1 , 2 ) + ( long ) Math . pow ( c2 - b2 , 2 ) ; if ( dis1 != dis2 ) System . out . print ( " No " ) ; else if ( b1 == ( ( a1 + c1 ) / 2.0 ) && b2 == ( ( a2 + c2 ) / 2.0 ) ) System . out . print ( " No " ) ; else System . out . print ( " Yes " ) ; } public static void main ( String [ ] args ) { long a1 = 1 , a2 = 0 , b1 = 2 , b2 = 0 , c1 = 3 , c2 = 0 ; possibleOrNot ( a1 , a2 , b1 , b2 , c1 , c2 ) ; } }

Class/struct names: GFG
Java program:
import java . io . * ; class GFG { static int circle ( int x1 , int y1 , int x2 , int y2 , int r1 , int r2 ) { int distSq = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ; int radSumSq = ( r1 + r2 ) * ( r1 + r2 ) ; if ( distSq == radSumSq ) return 1 ; else if ( distSq > radSumSq ) return - 1 ; else return 0 ; } public static void main ( String [ ] args ) { int x1 = - 10 , y1 = 8 ; int x2 = 14 , y2 = - 24 ; int r1 = 30 , r2 = 10 ; int t = circle ( x1 , y1 , x2 , y2 , r1 , r2 ) ; if ( t == 1 ) System . out . println ( " Circle ▁ touch ▁ to " + " ▁ each ▁ other . " ) ; else if ( t < 0 ) System . out . println ( " Circle ▁ not ▁ touch " + " ▁ to ▁ each ▁ other . " ) ; else System . out . println ( " Circle ▁ intersect " + " ▁ to ▁ each ▁ other . " ) ; } }

Class/struct names: GFG