TUGAS 6.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <string.h> using namespace std; //NAMA : MOH.FAQIH S.KARIM //NIM : 3420230034 int main() { char kodeKaryawan; string nama; string posisi; int gaji; cout << "========================================\n"; cout << "Kode | Posisi | Gaji\n"; cout << "----------------------------------------\n"; cout << " A | QA kasir | 6.000.000\n"; cout << " B | FE pelayan | 7.000.000\n"; cout << " C | BE OB | 8.000.000\n"; cout << "========================================\n"; cout << " Data Karyawan PT KANTIN ICE CUBE \n"; cout << "========================================\n"; cout << "Masukkan Nama Anda\t:moh faqih s karimm "; cin >> nama; cout << "\nKode Karyawan [A/B/C]\t:FE "; cin >> kodeKaryawan; cout << "\nKode Yang Dipilih\t: " << kodeKaryawan << endl; cout << "----------------------------------------\n"; cout << " Hasil Switch Case"; cout << "\n----------------------------------------\n"; switch (kodeKaryawan) { case 'A': case 'a': posisi = "QA kasir"; gaji = 6000000; break; case 'B': case 'b': posisi = "FE pelayan"; gaji = 7000000; break; case 'C': case 'c': posisi = "BE ob"; gaji = 8000000; break; default: cout << "Kode karyawan tidak valid.\n"; return 0; } cout << "Halo selamat datang " << nama << ".\n"; cout << "Kode yang kamu pilih adalah " << kodeKaryawan << ".\n"; cout << "Untuk kode " << kodeKaryawan << " maka posisi kamu adalah " << posisi << ".\n"; cout << "Dengan posisi " << posisi << " maka gaji kamu adalah " << gaji << " per bulan.\n"; cout << "========================================\n"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines