#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main()
{
char nim[10],nama[5];
int nil_tugas,nil_uts,nil_uas;
float nil_akhir;
clrscr(); //hapus layar
gotoxy(15,3);cout<<"UNIVERSITAS DIAN NUSWANTORO";
gotoxy(15,4);cout<<"jl.Nakula I/5 Semarang";
gotoxy(10,5);cout<<"NIM : ";cin>>nim;
gotoxy(10,6);cout<<"Nama : ";cin>>nama;
gotoxy(10,7);cout<<"Nilai Tugas : ";cin>>nil_tugas;
gotoxy(10,8);cout<<"Nilai UTS : ";cin>>nil_uts;
gotoxy(10,9);cout<<"Nilai UAS : ";cin>>nil_uas;
nil_akhir=(0.2*nil_tugas)+(0.35*nil_uts)+(0.45*nil_uas);
gotoxy(10,10);cout<<"Nilai Akhir : "<<nil_akhir<<endl;
if(nil_akhir<=60)
{
gotoxy(10,12);cout<<"ANDA TIDAK LULUS";
}
else
{
gotoxy(10,12);cout<<"ANDA LULUS";
}
if (nil_akhir>=85)
{
gotoxy(30,10);cout<<" A ";
}
else if (nil_akhir>=70)
{
gotoxy(30,10);cout<<" B ";
}
else if (nil_akhir>=60)
{
gotoxy(30,10);cout<<" C ";
}
else if (nil_akhir>=50)
{
gotoxy(30,10);cout<<" D ";
}
else
{
gotoxy(30,10);cout<<" E ";
}
getch();
}
Cetak Nilai angka | nil_akhir=(0.2*nil_tugas)+(0.35*nil_uts)+(0.4*nil_uas) |
Cetak kelulusan | If nil_akhir <=60 cetak TIDAK LULUS else cetak LULUS |
Cetak nilai huruf | If nil_akhir>=85 cetak A; if nil_akhir >=70 cetak B If nil_akhir>=60 cetak C; if nil_akhir>=50 cetak D else cetak E |
Flowchart nya
0 komentar:
Posting Komentar