pemrograman

My Blog

Latest blog

 Hai, perjalanan kali ini berisi tentang progres coding aku selama kuliah.

Nah sekarang aku membuat program kasir sederhana, berikut adalah source code-nya

package ProgramKasir;

/**

 *
 * @author hakam
 */
import java.util.Scanner;
public class programkasir {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    //total = berat*harga - (berat*harga)/0.05
    int berat, harga1kilo;
    float diskon = 0.05F;
     double total, hargatotal, kembali, cash;
         //input
        System.out.println("Toko Beras Cemerlang");
        System.out.print("Jumlah (Kg)     = " );
          berat = sc.nextInt();
        System.out.print("Harga per Kg    = ");
          harga1kilo = sc.nextInt ();
          total = berat*harga1kilo; 
        System.out.println("Total           = "+total);
        System.out.println("Diskon          = "+diskon);
          hargatotal = total-(total*diskon);
        System.out.println("Harga total     = "+hargatotal);
        System.out.print("Cash            = ");
          cash = sc.nextInt();
          kembali = cash-hargatotal;
        System.out.println("Kembali         = "+kembali);
        System.out.println("TERIMA KASIH");
        System.out.println("TELAH BERBELANJA DI TOKO CEMERLANG");      
    }
    
}




Terimakasih, semoga kalian juga lancar buat belajar codingnya.
Kalau ada kesulitan boleh nih isi kolom komentar :)



Contact Me

Contact With Me

Break

Random Posts

randomposts

Recent Posts

recentposts
banner image

Lorem Ipsum is simply dummy text of the printing and type setting industry when an unknown printer took a galley of type

  • 9908B Wakehurst St.Rockaway
  • 990800113322
  • info@domain.com
  • www.yourinfo.com