Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas2.1

Snippet info

Language

Cpp

Visibility

public

Author

tomysetiawan

Created

2024-10-30T21:42:06.900539Z

Updated

2024-10-30T21:50:51.924539Z

#include <iostream>
using namespace std;

int main() {
    //Teknik Informatika
    //Nama : Tomy Setiawan
    //NIM : 3420247021
    
    float HargaSatuan = 12360.90;
    int jumlah = 8;
    
    float subtotal;
    subtotal = HargaSatuan * jumlah;
    
    float diskon;
    diskon = subtotal * 0.1;
    
    float total;
    total = subtotal - diskon;
    
    cout<<"------------------------------------"<<endl;
    cout<<"Program Penjualan Makanan Kucing"<<endl;
    cout<<"------------------------------------"<<endl;
    printf("Harga Satuan     : Rp %.2f \n", HargaSatuan);
    printf("Jumlah Beli      : %d \n", jumlah);
    cout<<"------------------------------------"<<endl;
    printf("Subtotal         : Rp %.2f \n", subtotal);
    printf("Diskon 10 Persen : Rp %.2f \n", diskon);
    printf("Total            : Rp %.2f \n", total);
    cout<<"------------------------------------"<<endl;
    
    return 0;
}
INFO