Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas2.1

Snippet info

Language

Cpp

Visibility

public

Author

aderawahyu.s

Created

2024-10-19T09:09:16.670114Z

Updated

2024-10-21T10:59:26.693834Z

#include <iostream>
#include <cstdio>

using namespace std;
// Adera Wahyu Sutrisno
// 3420230039
// PPKM

int main() {
    float Harga_Per_Satuan = 10250.75;
    int Jumlah_Beli = 6;
    float Subtotal = Harga_Per_Satuan * Jumlah_Beli;
    float Diskon = Subtotal * 0.10;
    float Total = Subtotal - Diskon;

    cout << "-----------------------------------" << endl;
    cout << "Program Penjualan Marshmallow Plain" << endl;
    cout << "-----------------------------------" << endl;
    printf("Harga Satuan    : Rp %.2f\n", Harga_Per_Satuan);
    printf("Jumlah Beli     : %d\n", Jumlah_Beli);
    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