Quick actions

cmd+k|ctrl+k

Navigation

Languages

tugas2.1remake

Snippet info

Language

Cpp

Visibility

public

Author

mikoshiba27

Created

2024-10-19T09:18:16.685323Z

Updated

2024-10-19T09:18:16.685323Z

#include <iostream>
#include <cstdio>
using namespace std;
// Miko Ardiansyah
// 3420230005
int main() {
    float harga_satuan = 10250.75;
    int jumlah_beli = 6;
    float subtotal, diskon, total;

    subtotal = harga_satuan * jumlah_beli;
    diskon = subtotal * 0.10;
    total = subtotal - diskon;

    printf("----------------------------------------\n");
    printf("Program Penjualan Marshmallow Plain\n");
    printf("----------------------------------------\n");
    printf("Harga Satuan   : Rp %.2f\n", harga_satuan);
    printf("Jumlah Beli    : %d\n", jumlah_beli);
    printf("----------------------------------------\n");
    printf("Subtotal       : Rp %.2f\n", subtotal);
    printf("Diskon 10 Persen : Rp %.2f\n", diskon);
    printf("Total          : Rp %.2f\n", total);
    printf("----------------------------------------\n");

    return 0;
}
INFO