0% found this document useful (0 votes)
23 views3 pages

Tugas T.algoritma Program

This document contains the code for a program that generates an invoice (faktur) for purchases made. It prompts the user to input purchase details like date, items bought, quantities and prices. It then prints an invoice listing the items, quantities, prices and totals. The invoice output includes company header details, item table with numbers, names, quantities, prices and totals, grand total, and closing message.

Uploaded by

Ridho Alsyahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

Tugas T.algoritma Program

This document contains the code for a program that generates an invoice (faktur) for purchases made. It prompts the user to input purchase details like date, items bought, quantities and prices. It then prints an invoice listing the items, quantities, prices and totals. The invoice output includes company header details, item table with numbers, names, quantities, prices and totals, grand total, and closing message.

Uploaded by

Ridho Alsyahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

package TUGASBESAR;

import java.io.*;
public class FakturPembelian {
public static void main(String[] args) throws Exception
{
String[]nmbrg = new String[50];
int[]jum = new int[100];
int[]hrg = new int[100];
System.out.println("\tCOOLIT ");
System.out.println("JL.PASIRKOJA NO 271 BANDUNG ");
System.out.println("
DAFTAR BARANG ");
System.out.println("========================");
System.out.println("NO NAMA BARANG");
System.out.println("========================");
System.out.println("1. Jaket Kulit");
System.out.println("2. Dompet Kulit");
System.out.println("3. Sepatu Kulit");
System.out.println("========================\n");
DataInputStream karakter = new DataInputStream(System.in);
System.out.print("Masukkan Tanggal Pembelian : ");
String tanggal=karakter.readLine();
int tanggall = Integer.valueOf(tanggal).intValue();
System.out.print("Masukkan Bulan Pembelian : ");
String bulan=karakter.readLine();
System.out.print("Masukkan Tahun Pembelian : ");
String tahun=karakter.readLine();
int tahunn = Integer.valueOf(tahun).intValue();
System.out.print("Masukkan Jumlah Barang Pembelian : ");
String jml=karakter.readLine();
int data = Integer.valueOf(jml).intValue();
for(int i=0;i<data; i++)
{
System.out.print("Nama Barang ke-"+(i+1)+ ":");
String nm=karakter.readLine();
nmbrg[i]=nm;
System.out.print("Jumlah : ");
String jlh=karakter.readLine();
int jlah = Integer.valueOf(jlh).intValue();
jum[i]=jlah;
System.out.print("Harga Rp.: ");
String har=karakter.readLine();
int harg = Integer.valueOf(har).intValue();
hrg[i]=harg;
}
System.out.println("\t\t\t\tCOOLIT ");
System.out.println("\t\t\tJL.PASIRKOJA NO 271 BANDUNG ");
System.out.println("\t\t\t
TELP. 022-4256753");
System.out.println("\n\t\t\t
FAKTUR PEMBELIAN");
System.out.println("\t\t\t\t\t\t\t "+tanggal+bulan+tahun);
System.out.println("==========================================================
===============");
System.out.println("NO NAMA BARANG
JUMLAH
HARGA
TOTAL ");
System.out.println("==========================================================
===============");
int tpenj=0;
for(int i=0;i<data; i++)

{
System.out.println((i+1)+ " \t"+nmbrg[i]+" \t\t"+jum[i]+" \t\t"+hrg[i]+ "
\t\t"+(jum[i]*hrg[i]));
tpenj = tpenj + (jum[i]*hrg[i]);
}
System.out.println("==========================================================
===============");
System.out.println("\t\t\t\t\tTOTAL KESELURUHAN : \t"+tpenj);
System.out.println("==========================================================
===============");
System.out.println("PERHATIAN !!!");
System.out.println("Barang yang sudah dibeli tidak dapat dikembalikan atau
ditukar.");
System.out.println("\n\t\t\tTerima Kasih Atas Kunjugan Anda ");
}
}

You might also like