0% found this document useful (0 votes)
23 views2 pages

Nama: Riyanto NPM: 18313009 Kelas: Ti 18 B Using Using Using Using Using Namespace Class Static Void String String Int

The document contains code for a C# program that takes in a student's name, student ID number, and test score as input. It then determines the grade based on the score and prints it out, and allows the user to repeat the process. Specifically, it gets input from the user, uses if/else statements to assign a letter grade based on test score thresholds, and includes a goto statement to allow repeating the input and grading.

Uploaded by

amir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Nama: Riyanto NPM: 18313009 Kelas: Ti 18 B Using Using Using Using Using Namespace Class Static Void String String Int

The document contains code for a C# program that takes in a student's name, student ID number, and test score as input. It then determines the grade based on the score and prints it out, and allows the user to repeat the process. Specifically, it gets input from the user, uses if/else statements to assign a letter grade based on test score thresholds, and includes a goto statement to allow repeating the input and grading.

Uploaded by

amir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

NAMA : RIYANTO

NPM : 18313009
KELAS : TI 18 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace tugas_bapak_najib
{
class Program
{
static void Main(string[] args)
{
string nama, pilihan;
int nilai, npm;

mulai:
Console.Clear();

Console.Write("Masukkan Nama Mahasiswa : ");


nama = Console.ReadLine();
Console.Write("Masukkan NPM : ");
npm = int.Parse(Console.ReadLine());
Console.Write("Masukkan Nilai : ");
nilai = int.Parse(Console.ReadLine());

if (nilai >= 80)


{
Console.WriteLine("Nilai A");
}
else if (nilai >= 70)
{
Console.WriteLine("Nilai B");
}
else if (nilai >= 60)
{
Console.WriteLine("Nilai C");
}
else if (nilai >= 50)
{
Console.WriteLine("Nilai D");
}
else
{
Console.WriteLine("Nilai E");
}
Console.Write("\nApakah anda ingin mengulangi [Y/N] : ");
pilihan = Console.ReadLine();
if (pilihan == "Y" || pilihan == "y")
{
goto mulai;
}

Console.ReadKey();
}
}
}

You might also like