Menentukan Huruf Mutu Menggunakan Swicth

Posted: April 18, 2010 in Daspro
Tags:

#include<stdio.h>

#include<conio.h>

void main()

{

int tugas,uts,uas,nilai;

float nama,nim,matakuliah;

char hurufmutu;

clrscr();

printf(“Masukan Pilihan Anda\n”);

printf(“===============\n”);

printf(“1 = Nilai\n “);

printf(“2 = Huruf Mutu\n”);

printf(“===============\n”);

printf(“Pilihan (1&2) : “);scanf(“%i”,pilihan);

if (1)

{nilai=(kehadiran*0.1)+(tugas*0.2)+(uts*0.3)+(uas*0.4);

printf(“Nilai Anda Adalah : %.2i)”,nilai)}

if (2)

{

switch (nilai)

{

case 80 :

printf(“Huruf Mutu = A\n”);

break;

case 79              :

case 70              :

printf(“Huruf Mutu = B\n”);

break;

case 69              :

case 60              :

case 55              :

printf(“Huruf Mutu = C\n”);

break;

case 54  :

case 40              :

printf(“Huruf Mutu = D\n”);

break;

case 39              :

case 0 :

printf(“Huruf Mutu = E\n”);

break;

default              :

printf(“Salah Masukan Nilai …!\n”);

break;

}

}

getch();

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s