Contoh hasil program seperti di bawah ini.
Langsung aja ke syntax bro.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Latihan5
{
class Program
{
static void Main(string[] args)
{
int gapok, tunjangan, bonus, ptkp, pph, gakot, pajak, gaber;
Console.Write("Input Gaji Pokok =Rp. ");
gapok = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Tunjangan =Rp. ");
tunjangan = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Bonus =Rp. ");
bonus = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Pendapatan Tidak Kena Pajak(PTKP) =Rp. ");
ptkp = Convert.ToInt32(Console.ReadLine());
Console.Write("Input pph(%) =Rp. ");
pph = Convert.ToInt32(Console.ReadLine());
gakot = gapok + tunjangan + bonus;
pajak = (gakot - ptkp) * pph / 100;
gaber = gakot - pajak;
Console.WriteLine();
Console.WriteLine("Besar Gaji Kotor =Rp. {0} ", gakot);
Console.WriteLine("Besar Pajak (5%) =Rp. {0} ", pajak);
Console.WriteLine("Besar Gaji Bersih =Rp. {0} ", gaber);
Console.ReadKey();
}
}
}
Langsung aja ke syntax bro.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Latihan5
{
class Program
{
static void Main(string[] args)
{
int gapok, tunjangan, bonus, ptkp, pph, gakot, pajak, gaber;
Console.Write("Input Gaji Pokok =Rp. ");
gapok = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Tunjangan =Rp. ");
tunjangan = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Bonus =Rp. ");
bonus = Convert.ToInt32(Console.ReadLine());
Console.Write("Input Pendapatan Tidak Kena Pajak(PTKP) =Rp. ");
ptkp = Convert.ToInt32(Console.ReadLine());
Console.Write("Input pph(%) =Rp. ");
pph = Convert.ToInt32(Console.ReadLine());
gakot = gapok + tunjangan + bonus;
pajak = (gakot - ptkp) * pph / 100;
gaber = gakot - pajak;
Console.WriteLine();
Console.WriteLine("Besar Gaji Kotor =Rp. {0} ", gakot);
Console.WriteLine("Besar Pajak (5%) =Rp. {0} ", pajak);
Console.WriteLine("Besar Gaji Bersih =Rp. {0} ", gaber);
Console.ReadKey();
}
}
}
EmoticonEmoticon