Membuat Flowchart Program Import Java

  • Uploaded by: Gandalivs
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Membuat Flowchart Program Import Java as PDF for free.

More details

  • Words: 1,771
  • Pages: 25
Progam Resmi Modul 9 Flowchart main Program : start prosess(pilih); i=0;i<=11;i++;

try

1

2

3

4

5

6

7

8

9

10

11

default;

Pilih; catch

a.tampil();

“Inputan Salah”

c.tampil();

e.tampil();

g.tampil();

i.tampil();

k.tampil();

prosess(pilih); b.tampil();

d.tampil();

f.tampil();

h.tampil();

j.tampil();

“Program berakir”

end

Flowchart Package Tgs11,Tgs12,Tgs13,Tgs14 : a.tampil

() ;

b.tampil

Alas ; Tinggi ; Diameter ; Luas =0.5*alas *tinggi ; Luas Lingkaran =0.5*3.14 *Diameter LArsir =Luas -L;

Larsir

c.tampil

() ;

Kata 1; Kata 2;

;

;

() ;

Hasil =”kata 1.upperCase”

+”kata 2.lowerCase”

Hasil ;

d.tampil

() ;

UAS ; UTS ; Abs ;

A; B

Tot =( 0.4*UTS )+( 0.5*UAS )+( 0.1*Abs );

Sf =A; A=B; B=Sf ;

Tot ;

A,B

;

“Inputan Salah”

Progam Resmi Modul 9 Flowchart Package Tgs21, Tgs22:

e.tampil ();

f.tampil ();

i=1;i<=500 ;i++

Kata 1; Kata 2;

i%5==0

YA

pjg 1=kata 1.length (); pjg 2=kata 2.length ();

i

TIDAK

Temp =kata 1; kata 2=kata 1; kata 1=temp ;

YA

pjg 2>pjg 1 TIDAK

Hasil = "+ kata 1+" "+ kata 2

Hasil = "+ kata 1+" "+ kata 2

Hasil ;

Flowchart Package Tgs23: KPK (A,B)

g.tampil ();

A; B;

FPB (A,B)

kpk =0;

hsl _bg=m%n;

i=1;i<=n;i++ hsl_bg!= 0

YA

kpk =kpk +m; KPK (A,B); FPB (A,B);

TIDAK kpk % n==0 YA TIDAK

return kpk ;

return n ;

m = n; n = hsl _bg; hsl_bg = m%n;

Progam Resmi Modul 9 Flowchart Package Tgs31; h.tampil

() ;

kata ; bts 1; bts 2= 0; bts 2=bts 1; i=0;i
() ;i++ YA

i+1== bts 2

bts 2=bts 2+bts 1; temp =kata .substring (i,i+1);

TIDAK

kata .charAt

temp .toUpperCase ;

(i);

()

Flowchart Package Tgs32; i.tampil();

a; b; i=0;i<matr1.length;i++ j=0;j<matr1[i].length;j++ matr1[i][j] ;

jumlah(matr1,matr2,a,b); tampil(matr[][]);

i=0;i<matr.length;i++

i=0;i
j=0;j<matr[i].length;j++

j=0;j
i=0;i<matr2.length;i++ j=0;j<matr2[i].length;j++ matr2[i][j] ;

matr1[i][j] ; matr_hasil[ i][j]=matr1[i][j]+matr2[i][j];

tampil( matr1);

tampil( matr2);

jumlah(matr1,matr2,a,b);

tampil(matr_hasil[ i][j]);

Progam Resmi Modul 9 Flowchart Package Tgs41; j.ta m p();il

k a ta;

b ts1=4; b ts2=b ts1; try

c a tc h

i=0;i
T ID A K

h a sil= "IS B NInv a lid";

T ID A K k a ta.c h a rA(i)= t ='-'

(i+1!=b ts2)& &(i<1 3)

YA

b ts2=b ts2+b ts1; h a s =il "IS B N v a";lid

h a sil= "I S B NInv a lid";

h a sil

a n g k=In a te g .pe ra rs e In (k ta ta.s u b s trin(i,i+1)); g h a sil = "IS B N v a";lid

Progam Resmi Modul 9 Flowchart Package Tgs42; k.tam pil(); kalim at; chars[] = kalim at.toC harA rray (); banding []= kalim at.toC harA rray (); i=0;i
(chars[ i]!=' ') & &test(chars,banding,i)

YA

"chars[i]+ " " +hitung(chars,i)+";

j=0;j
T ID A K YA

chars[i]= =chars[j]

j+1;

T ID A K

hitung(chars[], i)

test( chars[ ],banding[],i)

temp=chars[i]; jumlah= 0;

temp=chars[i]; jumlah=0;

j=0;j
j=0;j<=i;j++; YA

temp==chars[ j] TID A K

YA jum lah++;

temp==banding[j] T ID A K

jumlah<2 R eturn;

jumlah++;

TID A K false;

R eturn;

YA

true;

Progam Resmi Modul 9 Output Program : Output Main Menu :

Output pilihan program 1:

Setelah progam pilihan berakir kembali ke main program pilihan .

Progam Resmi Modul 9 Output pilihan program 2:

Output pilihan program 3:

Output pilihan program 4:

Progam Resmi Modul 9 Output pilihan program 5:

Output pilihan program 6:

Output pilihan program 7:

Progam Resmi Modul 9

Output pilihan program 8:

Output pilihan program 9:

Progam Resmi Modul 9

Output pilihan program 10: Jika inputan benar :

Jika inputan salah :

Output pilihan program 11:

Progam Resmi Modul 9

Output Program jika inputan tidak sesuai : Ada 11 kesempatan pemilihan , setelah itu program akan selesai !

//Source Code Program Main : import java.io.*; import Tgs4.Tgs11; import Tgs4.Tgs12; import Tgs4.Tgs13; import Tgs4.Tgs14; import Tgs4.Tgs21; import Tgs4.Tgs22; import Tgs4.Tgs23; import Tgs4.Tgs31;

Progam Resmi Modul 9 import Tgs4.Tgs32; import Tgs4.Tgs41; import Tgs4.Tgs42; class ProgUtama{ public static void main(String[] args)throws Exception { for(int i=0;i<=11;i++) { DataInputStream ww=new DataInputStream(System.in); System.out.println("\n------------------------------------------------------------------"); System.out.println("\t\t\tTuGas Resmi\n"); System.out.println("------------------------------------------------------------------\n"); System.out.println("1. Menghitung Luas SegiTiga di dalam Lingkaran\n"); System.out.println("2. Mencetak huruf besar pada kalimat huruf kecil dan sebaliknya\n"); System.out.println("3. Menghitung Nilai akhir yg didapat dari 40%UTS , 50%UAS , 10%Absen \n"); System.out.println("4. Swap File\n"); System.out.println("5. Membuat deret bilangan yang habis dibagi 5,antara bilangan 1-500\n"); System.out.println("6. Membandingkan 2 kata,jika salah satu lebih panjang, kata itu diganti huruf besar semua\n"); System.out.println("7. Menghitung KPK dan FPB\n"); System.out.println("8. Mengubah huruf kecil menjadi huruf besar dengan posisi huruf yang ditentukan user\n"); System.out.println("9. Penjumlaha Array 2 dimensi(penjumlahan Matrix)\n"); System.out.println("10. Input ISBN dengan ketentuan inputan 13 char angka,tiap karakter keempat diisi '-'(Strip)\n"); System.out.println("11. Mengetahui jumlah dan posisi suatu huruf dari kalimat\n"); System.out.print("\tTugas ke berapa pilihan anda ? "); try { int pilih=Integer.parseInt(ww.readLine()); prosess(pilih); }catch(Exception e){ System.out.println("\t\tInputan Salah!!!!!!"); } } }

Progam Resmi Modul 9 public static void prosess(int pilihan)throws Exception { System.out.println("\n---------------------------------------------------------------------"); System.out.println("\t\tProgram Pilihan Anda"); System.out.println("---------------------------------------------------------------------\n"); switch(pilihan) { case 1: Tgs11 a=new Tgs11(); a.tampil(); break; case 2: Tgs12 b=new Tgs12(); b.tampil(); break; case 3: Tgs13 c=new Tgs13(); c.tampil(); break; case 4: Tgs14 d=new Tgs14(); d.tampil(); break; case 5: Tgs21 e=new Tgs21(); e.tampil(); break; case 6: Tgs22 f=new Tgs22(); f.tampil(); break; case 7: Tgs23 g=new Tgs23(); g.tampil(); break;

Progam Resmi Modul 9 case 8: Tgs31 h=new Tgs31(); h.tampil(); break; case 9: Tgs32 i=new Tgs32(); i.tampil(); break; case 10: Tgs41 j=new Tgs41(); j.tampil(); break; case 11: Tgs42 k=new Tgs42(); k.tampil(); break; default: System.out.println("Inputan anda tidak sesuai"); break; } System.out.println("\nProgram Pilihan berakir"); } } // Package Tgs11 package Tgs4; import java.io.*; public class Tgs11 { public void tampil()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

= ");

Progam Resmi Modul 9 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*dm; LArs=Luas-L; //Output System.out.println("Luas Arsiran

= "+LArs);

} }

// Package Tgs12 package Tgs4; import java.io.*; public class Tgs12{ public void tampil()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());

Progam Resmi Modul 9 } } // Package Tgs13 package Tgs4; import java.io.*; public class Tgs13{ public void tampil()throws Exception { DataInputStream ww= new DataInputStream(System.in); int UTS,UAS,Abs; double Tot; //Input Data System.out.print("Nilai UAS ="); String x= ww.readLine(); UAS=Integer.parseInt(x); System.out.print("Nilai UTS ="); String o= ww.readLine(); UTS=Integer.parseInt(o); System.out.print("Nilai Absen ="); String p= ww.readLine(); Abs=Integer.parseInt(p); //Proses nilai total Tot=(0.4*UTS)+(0.5*UAS)+(0.1*Abs); //+50/100*UAS+10/100*Abs //Output System.out.println("Nilai Total = "+Tot); } } // Package Tgs14 package Tgs4; import java.io.*; public class Tgs14{ public void tampil()throws Exception { DataInputStream ww= new DataInputStream(System.in); int A,B,Sf;

Progam Resmi Modul 9 //Input A,B System.out.print("A = "); String x= ww.readLine(); A=Integer.parseInt(x); System.out.print("B = "); String o= ww.readLine(); B=Integer.parseInt(o); //Proses Sf=A; A=B; B=Sf; //Output System.out.println("A = "+A); System.out.println("B = "+B); } }

// Package Tgs21 package Tgs4; import java.io.*; public class Tgs21{ public void tampil()throws Exception { for(int i=1;i<=500;i++) { if(i%5==0) { System.out.print(i+" "); } } }

Progam Resmi Modul 9 } // Package Tgs22 package Tgs4; import java.io.*; public class Tgs22{ public void tampil()throws Exception { DataInputStream ww=new DataInputStream(System.in); //input kata System.out.print("kata 1= "); String kata1=ww.readLine(); System.out.print("kata 2= "); String kata2=ww.readLine(); //PROSES int pjg1=kata1.length(); int pjg2=kata2.length(); if(pjg1
Progam Resmi Modul 9 { //Input Data DataInputStream xx=new DataInputStream(System.in); System.out.print("masukan bilangan A = "); int A=Integer.parseInt(xx.readLine()); System.out.print("masukan bilangan B = "); int B=Integer.parseInt(xx.readLine()); //Proses dan Output System.out.println("KPK dari A dan B adalah : "+ KPK(A,B)); System.out.println("FPB dari A dan B adalah : "+ FPB(A,B)); } //procedure KPK public static int KPK(int m,int n){ int kpk=0; for(int i=1;i<=n;i++) { kpk=kpk+m; if(kpk % n==0) { break; } } return kpk; } //procedure FPB public static int FPB(int m,int n){ int hsl_bg=m%n; while (hsl_bg!=0) { m = n; n = hsl_bg; hsl_bg = m%n; } return n; } } // Package Tgs31

Progam Resmi Modul 9 package Tgs4; import java.io.*; public class Tgs31{ public void tampil()throws Exception { DataInputStream xxx=new DataInputStream(System.in); System.out.print("kalimat

= ");

String kata=xxx.readLine(); System.out.print("batas geser = "); int bts1=Integer.parseInt(xxx.readLine()); int bts2=bts1; System.out.print("hasil = "); for(int i=0;i
Progam Resmi Modul 9 for(int j=0;j
");

Progam Resmi Modul 9 { for(int i=0;i
: \n");

char chars[] = kalimat.toCharArray(); char banding[]= kalimat.toCharArray(); for(int i=0;i
Progam Resmi Modul 9 { if((chars[i]!=' ')&&test(chars,banding,i)) { System.out.print("\tJumlah huruf "+chars[i]+" = "+hitung(chars,i)+" Pada posisi "); for(int j=0;j
Progam Resmi Modul 9 if(temp==banding[j]) { jumlah++; } } if(jumlah<2){ return true; } else{ return false; } } }

Related Documents


More Documents from "Himatekom Politeknik Madiun"

Tug As 9
June 2020 20
Modul 4,5,6 Revisi
June 2020 25
Tugas Praktikum O9
June 2020 16
Modul 78
June 2020 18