Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas2.1

Snippet info

Language

Cpp

Visibility

public

Author

muhammadirfanzidni801

Created

2024-10-19T09:58:56.236731Z

Updated

2024-10-19T09:58:56.236731Z

#include <iostream>
#include <iomanip>
// Muhammad Irfan Zidni
// 3420230014
// Tekhnik  Informatika
using namespace std;

int main() {
    double harga_satuan = 10250.75;
    int jumlah_beli = 6;
    double subtotal = harga_satuan * jumlah_beli;
    double diskon_persen = 10;
    double diskon = (diskon_persen / 100) * subtotal;
    double total = subtotal - diskon;
    
    cout << "----------------------------------------" << endl;
    cout << "Program Penjualan Marshmallow Plain" << endl;
    cout << "----------------------------------------" << endl;
    cout << "Harga Satuan     : Rp " << fixed << setprecision(2) << harga_satuan << endl;
    cout << "Jumlah Beli      : " << jumlah_beli << endl;
    cout << "----------------------------------------" << endl;
    cout << "Subtotal         : Rp " << fixed << setprecision(2) << subtotal << endl;
    cout << "Diskon 10 Persen : Rp " << fixed << setprecision(2) << diskon << endl;
    cout << "Total            : Rp " << fixed << setprecision(2) << total << endl;
    cout << "----------------------------------------" << endl;

    return 0;
}
INFO