Anda di halaman 1dari 17

Nama Kevin

Tanggal Test 5 Maret 2024

Psikotest DISC
S TS S TS S TS
x

1. x 2. x 3.
x x
x
x CONTOH S TS
x x x X Ramah. Mudah bergaul
4. 5. 6. Penuh kepercayaan.Percaya pada
x x
orang lain
X Petualang. Pengambil resiko
x x Toleran. Penuh hormat
x
7. 8. 9.
x

x x

x x

x
10. 11. 12.
x

x x

x x x

x x x
13. 14. 15.

x x

x x
16. 17. 18.
x

x x x
19. 20. 21.
x
x x
x
x
22. 23. 24.
x x
x x

1. SOAL LOGIKA
Soal Jawaban ( A, B, C, D )

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal 1 A. 101
Soal 2 A.101
Soal 3 D. S
Soal 4 B. R
Soal 5 B. A adalah seorang ksatria dan B penipu

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
2. Soal Programming

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal 1
Nom
or
Jawa #include <stdio.h>
ban
Soal float hitungTinggiAkhir(float tinggiAwal, int lamaHari, float pertumbuhanHarian) {
float tinggi = tinggiAwal;

for (int i = 1; i <= lamaHari; i++) {


tinggi += pertumbuhanHarian;
if (i % 2 == 0) {
pertumbuhanHarian *= 1.02;
}
}

return tinggi;
}

int main() {
float tinggiAwal, pertumbuhanHarian;
int lamaHari;

printf("Masukkan tinggi awal (dalam cm): ");


scanf("%f", &tinggiAwal);

printf("Masukkan lama hari: ");


scanf("%d", &lamaHari);

printf("Masukkan pertumbuhan harian (dalam cm): ");


scanf("%f", &pertumbuhanHarian);

float tinggiAkhir = hitungTinggiAkhir(tinggiAwal, lamaHari, pertumbuhanHarian);

printf("Tinggi akhir setelah %d hari adalah: %.2f cm\n", lamaHari, tinggiAkhir);

return 0;
}

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.

Scree
Soal 2
Nomor
Jawaban #include <stdio.h>
Soal
void printPiramida(int baris) {
int spasi, bintang;

for (int i = 1; i <= baris; i++) {

for (spasi = 1; spasi <= baris - i; spasi++) {


printf(" ");
}
for (bintang = 1; bintang <= 2 * i - 1; bintang++) {
printf("*");
}
printf("\n");
}
}

int main() {
int baris;

printf("Masukkan jumlah baris piramida: ");


scanf("%d", &baris);

printPiramida(baris);

return 0;
}

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
ScreenSh
ot
Soal 3
Nomor
Jawaban #include <stdio.h>
Soal #include <string.h>

void hapusDuplikasi(char *kata, int hapus) {


int panjang = strlen(kata);
int indeks = 0; duplikasi

for (int h = 0; h < hapus; h++) {

for (int i = 0; i < panjang; i++) {


int j;
for (j = 0; j < indeks; j++) {
if (kata[i] == kata[j]) {
break;
}

if (j == indeks) {
kata[indeks++] = kata[i];
}
}
kata[indeks] = '\0'; /
panjang = strlen(kata);
}
}

int main() {
char kata[100];
int hapus;

printf("Masukkan kata: ");


scanf("%s", kata);
printf("Masukkan jumlah duplikasi yang akan dihapus: ");
scanf("%d", &hapus);

hapusDuplikasi(kata, hapus);

printf("Output: %s\n", kata);

return 0;
}

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
ScreenSh
ot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.
This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal 4
Nomor
Jawaban #include <stdio.h>
Soal
int main() {
int jumlah_produk;

printf("Masukkan jumlah produk: ");


scanf("%d", &jumlah_produk);

int harga_produk[jumlah_produk];

for (int i = 0; i < jumlah_produk; i++) {


printf("Masukkan harga produk %d: ", i + 1);
scanf("%d", &harga_produk[i]);
}

int total_harga = 0;
for (int i = 0; i < jumlah_produk; i++) {
total_harga += harga_produk[i];
}

float diskon = 0;
char *bonus = "";

if (total_harga > 400000) {


diskon = 0.10;
bonus = "ransel";
} else if (total_harga > 200000) {
diskon = 0.07;
bonus = "payung";
} else if (total_harga > 70000) {
diskon = 0.05;
bonus = "topi";
}

int total_diskon = total_harga * diskon;

int harga_akhir = total_harga - total_diskon;

printf("Total harga: %d\n", total_harga);


printf("Diskon: %d\n", total_diskon);
printf("Bonus: %s\n", bonus);
printf("Harga akhir: %d\n", harga_akhir);

return 0;
}

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
ScreenSh
ot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal Nomor 5
Jawaban Soal #include <stdio.h>

void printTransaksi(int noAkun[], int nominal[]) {


printf("akun - debit - kredit\n");
int total_debit = 0;
int total_kredit = 0;
for (int i = 0; i < 3; i++) {
printf("%d - ", noAkun[i]);
if (nominal[i] > 0) {
printf("%d - 0\n", nominal[i]);
total_debit += nominal[i];
} else {
printf("0 - %d\n", -nominal[i]);
total_kredit -= nominal[i];
}
}
int balance = total_debit - total_kredit;
printf("Total %d - %d = ", total_debit, total_kredit);
if (balance == 0) {
printf("Balance\n");
} else {
printf("Tidak Balance\n");
}
}

int main() {
int noAkun[3];
int nominal[3];

for (int i = 0; i < 3; i++) {


printf("Masukkan nomor akun ke-%d: ", i + 1);
scanf("%d", &noAkun[i]);
printf("Masukkan nominal pada akun ke-%d: ", i + 1);
scanf("%d", &nominal[i]);
}

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
// Memanggil fungsi untuk mencetak detail transaksi akun dan status balance
printTransaksi(noAkun, nominal);

return 0;
}

ScreenShot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
3. Soal Database
Soal Nomor 1
Jawaban Soal

Insert data ke table transaksi terlebih dahulu

INSERT INTO transaksi (transaction_id, customer_name, transaction_date)


VALUES
('trx001', 'Rivaldo', '2022-10-22'),
('trx002', 'Melina', '2023-04-07');

Insert datanya ke table detail transaksi

INSERT INTO detail_transaksi (transaction_id, product_name, price, qty, discount)


VALUES
('trx001', 'Pan pizza', 30000, 1, 0.05),
('trx001', 'crown crust', 45000, 1, 0.05),
('trx002', 'cheesy bites', 47000, 2, 0.10);

ScreenShot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal Nomor 2
Jawaban Soal
UPDATE detail_transaksi
SET discount = CASE
WHEN product_name = 'Pan pizza' THEN 0.05
WHEN product_name = 'crown crust' THEN 0.05
WHEN product_name = 'cheesy bites' THEN 0.10
END
WHERE transaction_id IN ('trx001', 'trx002')
AND product_name IN ('Pan pizza', 'crown crust', 'cheesy bites');

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
ScreenShot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Soal Nomor 3
Jawaban Soal
SELECT h.id, h.customer, h.date,
SUM(d.qty) AS qty,
SUM(d.price) AS prices,
SUM(d.qty * d.discount) AS 'Total discount',
SUM(d.price - (d.qty * d.discount)) AS 'Total prices'

FROM header_transaksi h
JOIN detail_transaksi d ON h.id = d.id
GROUP BY h.id, h.customer, h.date;

ScreenShot

Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.


This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.
Copyright © 2023 PT Nusantara Duta Solusindo. All Right reserved.
This document can only be used by PT Nusantara Duta Solusindo and not for share-to-public.

Anda mungkin juga menyukai