Quick actions

cmd+k|ctrl+k

Navigation

Languages

Algoritma 6.2

Snippet info

Language

Cpp

Visibility

public

Author

ilhamsatriaa29

Created

2024-11-16T01:12:39.325836Z

Updated

2024-11-16T01:12:58.765522Z

#include <iostream>
#include <string.h>

//Nama : Ilham Satria Wijaya
//NIM : 3420230031

using namespace std;

void garis() {
    cout << "======================================================" << endl;
}

char* cek_posisi(char kode) {
    char* posisi;
    switch (kode) {
        case 'A':
            strcpy(posisi, "Junior Progammer");
            break;
            
        case 'B':
            strcpy(posisi, "Senior progammer");
            break;
            
        case 'C':
            strcpy(posisi, "Lead Progammer");
            break;
            
        default :
            strcpy(posisi, "Kode salah");
    }
    return posisi;
}


void judul() {
    garis ();
    puts("\tProgram Menentukan Posisi");
    garis ();
}

int main() {
    char kode_posisi;
    judul();
    cout << "Masukan Kode Posisi : ", scanf("%s", &kode_posisi);
    cout << endl;
    printf("Posisi yang anda pilih adalah %s", cek_posisi(kode_posisi));
    cout << endl;
    garis();

cout << "Nama : Ilham Satria Wijaya" << endl;
cout << "Email : [email protected]" << endl;

return 0;
}
INFO