Contoh hasil program seperti di bawah ini.
Langsung aja ke syntax bro.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Latihan4
{
class Program
{
static void Main(string[] args)
{
int harga, jumlah, potongan;
float total;
Console.Write("Input Harga Barang/Unit =Rp. ");
harga = Convert.ToInt32(Console.ReadLine());
Console.Write("Jumlah Unit = ");
jumlah = Convert.ToInt32(Console.ReadLine());
Console.Write("Besar Potongan (%) = ");
potongan = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
total = harga * jumlah - (harga * jumlah * potongan / 100);
Console.WriteLine("Total Pembayaran = Rp . {0}", total);
Console.ReadKey();
}
}
}
Langsung aja ke syntax bro.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Latihan4
{
class Program
{
static void Main(string[] args)
{
int harga, jumlah, potongan;
float total;
Console.Write("Input Harga Barang/Unit =Rp. ");
harga = Convert.ToInt32(Console.ReadLine());
Console.Write("Jumlah Unit = ");
jumlah = Convert.ToInt32(Console.ReadLine());
Console.Write("Besar Potongan (%) = ");
potongan = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
total = harga * jumlah - (harga * jumlah * potongan / 100);
Console.WriteLine("Total Pembayaran = Rp . {0}", total);
Console.ReadKey();
}
}
}
EmoticonEmoticon