1.Output : Luas Arsiran Proses : Luas Stiga=0,5*alas*tinggi; Luas Lingkaran = 0,5*3,14*diameter; Luas Arsiran=Luas Stiga-Luas Lingkaran; Input : Alas,Tinggi,Diameter SourceCode: class ganda{ public static void main(String []arggss)throws Exception { DataInputStream ww= new DataInputStream(System.in); double Luas, L, LArs; //input alas System.out.print("Input Alas STiga
= ");
String x= ww.readLine(); double alas=Double.parseDouble(x); //input tinggi System.out.print("Input Tinggi STiga = "); String o= ww.readLine(); double ting=Double.parseDouble(o); //input Diameter System.out.print("Input diameter
= ");
String k= ww.readLine(); double dm=Double.parseDouble(k); //Proses Luas=0.5*alas*ting; L=0.5*3.14*5; LArs=Luas-L; //Output System.out.println("Luas Arsiran } } Output
:
= "+LArs);
FlowChart
:
2.Output :BAHAS pemrograman Proses : kata1.Uppercase(); Kata2.Lowercase(); Input : kata1,kata2 SourceCode : import java.io.*; class Ganda2{ public static void main(String[]args) throws Exception { DataInputStream ww= new DataInputStream(System.in);
String kata1,kata2; System.out.println("Input = "); System.out.print("
Kata 1 = ");
kata1=ww.readLine(); System.out.print("
Kata 2 = ");
kata2=ww.readLine(); System.out.println("Output = "+kata1.toUpperCase()+" "+kata2.toLowerCase()); } } Output :
FlowChart : START
kata1; kata2;
kata1.toUpperCase(); kata2.toLowerCase()
kata1,kata2
STOP