Tugas6.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <string.h> using namespace std; // Nama : Nagita Elsa // Nim : 3420230026 void garis (){ cout<<"================================================================="<<endl; } int main() { char kode, nama[30], posisi[30]; int gaji; garis(); cout<<"|Kode | Posisi | Gaji |"<<endl; garis(); cout<<"|A | QA Engineer | 6.000.000 |"<<endl; cout<<"|B | FE Engineer | 7.000.000 |"<<endl; cout<<"|C | BE Engineer | 8.000.000 |"<<endl; garis(); garis(); cout<<"\t\tData Karyawan PT ABC "<<endl; garis(); cout<<"Masukkan Nama Anda : \n",cin>>nama; cout<<"Kode Karyawan [A/B/C] : \n"; cin>>kode; cout<<"\n"; garis(); switch (kode) { case 'A': case 'a': strcpy(posisi,"QA Engineer"); gaji = 6; break; case 'B': case 'b': strcpy(posisi,"FE Engineer"); gaji = 7; break; case 'C': case 'c': strcpy(posisi,"BE Engoneer"); gaji = 8; break; default: strcpy(posisi,"Kode Salah"); gaji = 0; } garis(); cout<<"\t\tHasil Switch Case "<<endl; garis(); puts("Halo Selamat datang %s.\n", nama); puts("Kode yang kamu pilih adalah %c.\n", kode, posisi); }
Editor Settings
Theme
Key bindings
Full width
Lines