Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
JagoVB JagoVB is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 508
Rep Power: 14
JagoVB mempunyai hidup yang Normal
Default [ask] if else

Ane dapet soal



Tentukan upah perminggu seorang karyawan, jumlah jam kerja yang normal selama seminggu adalah 48 jam, kelebihan jam kerja dianggab lembur, dengan upah lembur adalah 3000/jam, bila dimisalkan gaji karyawan PT. ABC dikelompokan berdasarkan golongannya upah perjam tiap karyawan bergantung pada golongannya, dengan ketentuan sebagai berikut

Jika Gol = A maka upah perjam = 4000

Jika Gol = B maka upah perjam = 5000

Jika Gol = C maka upah perjam = 6000

Jika Gol = D maka upah perjam = 7000




trus script ane



#include

#include



main(){



int jjk, jumlah_jjk,x, y;

char g;



printf ("\n Golongan ? ");

scanf ("%c", &g);

printf ("\n Masukan jam kerja karyawan ! ");

scanf ("%d", &jjk);





if ((g=='a'))

x = 48 * 4000 + (jjk - 48) * 3000 ;

y = jjk * 4000;

if ((jjk > 48 ))

printf ("\n Jumlah jam kerja %d ", x );

else if ((jjk 48 ))

printf ("\n Jumlah jam kerja %d ", x );

else if ((jjk 48 ))

printf ("\n Jumlah jam kerja %d ", x );

else if ((jjk 48 ))

printf ("\n Jumlah jam kerja %d ", x );

else if ((jjk
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 04:53 PM.


no new posts