IKHWANNUDIN 1655201033
TEKNIK INFORMATIKA
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package aray2dimensi;
import java.util.Scanner;
/**
*
* @author ikhwan
*/
public class ARAY2DIMENSI {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[][] array = new String[4][4];
int cek;
String bintang = "";
for(int i=0;i<array.length;i++){
for(int j=0;j<array.length;j++){
System.out.print("Input Angka baris["+i+"]"+" kolom["+j+"]= ");
array[i][j] = scan.next();
}
System.out.println("\n");
}
System.out.println("\n");
System.out.println("Hasil Nilai Inputan");
for (String[] array1 : array) {
for (int j = 0; j<array.length; j++) {
System.out.print("|" + array1[j] + "|");
bintang = array1[j];
cek = bintang.indexOf("4");
array1[j] = cek>=0 ? "**" : array1[j];
}
System.out.println("");
}
System.out.println("------------------------------------");
System.out.println("");
System.out.println("Hasil Nilai Berubah");
for (String[] array1 : array) {
for (int j = 0; j<array.length; j++) {
System.out.print("|" + array1[j] + "|");
}
System.out.println();
}
}
}
Minggu, 11 Juni 2017
PENGIRIMAN PAKET
#IKHWANNUDIN 1655201033
#TEKNIK INFORMATIKA
FLOWCHART NYA:
@author IKHWANN
*/
import java.util.Scanner;
public class Biaya_pengiriman_paket
{
public static void main(String[]args)
{
String nama,alamat;
int jarak = 0;
int berat = 0;
int biaya_per_Kg = 0;
int biaya_per_Km = 0;
int biaya_paket = 0;
int total_biaya_Kg = 0;
int total_biaya_Km = 0;
int nilai_PPN = 0;
int total_biaya = 0;
Scanner sc = new Scanner (System.in);
System.out.print("\tProgram Biaya Pengiriman Paket");
System.out.print("\n####################################################");
System.out.print("\nData Pelanggan");
System.out.print("\n####################################################");
System.out.print("\nMasukan Nama Pengirim : "); nama = sc.nextLine();
System.out.print("\nMasukan Alamat pengirim : ");
alamat = sc.nextLine();
System.out.print("\nTujuan Pengiriman");
System.out.print("\n####################################################");
System.out.print("\nMasukan Alamat Pengiriman : ");
String alamat_pengirim = sc.nextLine();
System.out.print("\nMasukan Berat");
System.out.print("\n####################################################");
System.out.print("\n Per Kg : ");
berat = sc.nextInt();
System.out.print("\nMasukan Jarak ");
System.out.print("\n####################################################");
System.out.print("\n Per Km : ");
jarak = sc.nextInt();
System.out.print("\tPilihan Paket");
System.out.print("\n####################################################");
System.out.println("\n1. Paket Reguler");
System.out.println("2. Paket Khusus");
System.out.println("3. Paket VIP");
System.out.print("");
System.out.print("Masukan Pilihan Paket : ");
int pilih = sc.nextInt();
if (pilih==1)
{
biaya_per_Kg = 10000;
biaya_per_Km = 20000;
nilai_PPN = (int) 0.1; //10%
}
else if(pilih==2)
{
biaya_per_Kg = 20000;
biaya_per_Km = 35000;
nilai_PPN = (int) 0.1; //10%
}
else if (pilih==3)
{
biaya_per_Kg = 20000;
biaya_per_Km = 35000;
nilai_PPN = (int) 0.1; //10%
}
{
total_biaya_Kg =(berat*biaya_per_Kg);
total_biaya_Km =(jarak*biaya_per_Km);
biaya_paket =(total_biaya_Kg+total_biaya_Km);
nilai_PPN = (biaya_paket*10)/100;
total_biaya =(int) (biaya_paket+nilai_PPN);
System.out.print("\nData Pengirim");
System.out.print("\n####################################################");
System.out.println("\nNama Pengirimin = "+ nama);
System.out.println("Alamat Pengirim = "+ alamat);
System.out.print("\nTujuan Pengiriman");
System.out.print("\n####################################################");
System.out.println("\nAlamat Pengiriman = "+ alamat_pengirim);
System.out.print("\nPerhitungan Biaya");
System.out.print("\n####################################################");
System.out.println("\nTotal Biaya per Kg = "+ total_biaya_Kg);
System.out.println("Total Biaya per Km = "+ total_biaya_Km);
System.out.println("Biaya Paket = "+biaya_paket);
System.out.println("PPN 10% = "+nilai_PPN);
System.out.println("Total Biaya = "+total_biaya);
System.out.print("##########################");
System.out.println("//IKHWANN485@GMAIL.//");
}
}
}
Langganan:
Postingan (Atom)