TUGAS 6.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <string.h> using namespace std; //NAMA : Yoga dwi kurniawan //NIM : 3420230019 int main() { char kodeKaryawan; string nama; string posisi; int gaji; cout << "===================================================\n"; cout << "Kode | Posisi | Gaji\n"; cout << "===================================================\n"; cout << " A | QA Engineer | 6.000.000\n"; cout << " B | FE Engineer | 7.000.000\n"; cout << " C | BE Engineer | 8.000.000\n"; cout << "===================================================\n"; cout << " Data Karyawan PT ABC \n"; cout << "===================================================\n"; cout << "Masukan Nama Anda\t: "; cin >> nama; cout << "\nKode Karyawan [A/B/C]\t: "; 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 Engineer"; gaji = 6; break; case 'B' : case 'b' : posisi = "FE Engineer"; gaji = 7; break; case 'C' : case 'c' : posisi = "BE Engineer"; gaji = 8; break; default: cout << "Kode karyawan tidak valid.\n"; return 0; } cout << " Hallo 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 << " juta perbulan\n"; cout << "===================================================\n"; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines