class Program
{
static void Main(string[] args)
{
double ntugas, nuts, npartisipasi, nuas;
double nakhir;
Console.Write("Nilai Tugas ="); ntugas = double.Parse(Console.ReadLine());
Console.Write("Partisipasi=");
npartisipasi = double.Parse(Console.ReadLine());
Console.Write("Nilai UTS =");
nuts = double.Parse(Console.ReadLine());
Console.Write("Nilai UAS =");
nuas = double.Parse(Console.ReadLine());
nakhir=hitungNilaiAkhir(npartisipasi, ntugas, nuts, nuas);
Console.Write("Nilai Akhir =" + nakhir);
Console.Write("Nilai Huruf=" + KonversiKeHuruf(nakhir));
Console.ReadKey();
}
public static double hitungNilaiAkhir(double np, double nt, double nuts, double nuas)
{
return 0.3*np+0.2*nt+0.3*nuts+0.2*nuts;
}
public static String KonversiKeHuruf(double na)
{
string nh = "";
if (na > 85 && na <= 100)
{
nh = "A";
}
else if (na > 80 && na <= 85)
{
nh = "A-";
}
return nh;
}
}
}
Tidak ada komentar:
Posting Komentar