Tugas 2.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> using namespace std; //Nama : Dendi Yusro Romadon //Nim : 3420230013 int main() { // Deklarasi variabel double harga_satuan = 10250.75; int jumlah_beli = 6; double subtotal = harga_satuan * jumlah_beli; double diskon = 0.10 * subtotal; double total = subtotal - diskon; // Menampilkan hasil 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% : Rp " << fixed << setprecision(2) << diskon << endl; cout << "Total : Rp " << fixed << setprecision(2) << total << endl; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines