You are on page 1of 7

UTS SOAL 1 :

using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

namespace UTS_SOAL_1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("=====================================");
Console.WriteLine("Menghitung Pengeluaran Selama Sebulan");
Console.WriteLine("=====================================");
Console.Write("\nJumlah Gaji Sebulan : ");
int gaji;
gaji = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\n=====Pengeluaran Selama Sebulan======");
Console.Write("Beli Baju
: ");
float baju;
baju = Convert.ToInt32(Console.ReadLine());
Console.Write("Beli Celana
: ");
float Celana;
Celana = Convert.ToInt32(Console.ReadLine());
Console.Write("Beli Makanan
: ");
float Makanan;
Makanan = Convert.ToInt32(Console.ReadLine());
Console.Write("Beli ATK
: ");
float ATK;
ATK = Convert.ToInt32(Console.ReadLine());
Console.Write("Transport/Bensin : ");
float tf;
tf = Convert.ToInt32(Console.ReadLine());
Console.Write("Menabung
: ");
float Nabung;
Nabung = Convert.ToInt32(Console.ReadLine());
Console.Write("Pengeluaran Lain : ");
float lain;
lain = Convert.ToInt32(Console.ReadLine());
float Jum = baju + Celana + Makanan + ATK + tf + Nabung + lain;
Console.Write("\n\nJumlah Pengeluaran Selama Sebulan : " + Jum);
float sisa = gaji - Jum;
Console.Write("\nSisa gaji Selama Sebulan
}
}

OUTPUT :

: " + sisa);

UTS SOAL 2 :
using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

namespace UTS_SOAL_2
{
class Program
{
static void Main(string[] args)
{
String nama, alamat, no, input;
int a, berat;
float total;
Console.WriteLine("+========================================+");
Console.WriteLine("|Transportasi Barang & Jasa Wilayah Papua|");
Console.WriteLine("+========================================+");
Console.Write("
Inputkan Nama Anda
: ");
nama=Console.ReadLine();
Console.Write("
Inputkan Alamat Anda
: ");
alamat=Console.ReadLine();
Console.Write("
Inputkan Nomor HP Anda
: ");
no=Console.ReadLine();
Console.WriteLine("+----------------------------------------+");
Console.WriteLine("| 1. Fax - Fax
|");
Console.WriteLine("| 2. Jayapura
|");
Console.WriteLine("| 3. Manokwari
|");
Console.WriteLine("| 4. Merauke
|");
Console.WriteLine("| 5. Nabire
|");
Console.WriteLine("| 6. Serui
|");
Console.WriteLine("| 7. Sorong
|");
Console.WriteLine("| 8. Timika
|");
Console.WriteLine("| 9. Wamena
|");
Console.WriteLine("| 10. Kota Lain-Papua
|");
Console.WriteLine("+----------------------------------------+");
Console.Write("\n
Inputkan Nomor kota Tujuan : ");
input=Console.ReadLine();
a = Convert.ToInt32(input);
switch(a)
{
case 1:Console.Write("
Inputkan Berat Paket (kg)
berat=Int32.Parse(Console.ReadLine());
total=5500*berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;
case 2: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 4000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

: ");

case 3: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 6000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 4: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 5000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 5: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 6000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 6: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 7500 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 7: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 4000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 8: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 5000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 9: Console.Write("
Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 6000 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

case 10: Console.Write("


Inputkan Berat Paket (kg)
berat = Int32.Parse(Console.ReadLine());
total = 7500 * berat;
Console.Write("\n Total Biaya
: Rp. " + total);
break;

: ");

default: Console.WriteLine("Anda memasukan pilihan yang tidak


ada dalam daftar"); break;
}
Console.WriteLine("\n\n+======================================+");
Console.WriteLine("Terima Kasih Telah Menggunakan Jasa Kami");
Console.WriteLine("+======================================+");
}
}
}

OUTPUT :

UTS SOAL 3 :

using
using
using
using

System;
System.Collections.Generic;
System.Linq;
System.Text;

namespace UTS_SOAL_3
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j <= i; j++)
{
Console.Write(j + " ");
}
Console.WriteLine(" Baris ke" + i);
}
for (int i = 10; i > 0;
{
for (int j = 0; j <
{
Console.Write(j
}
Console.WriteLine("
}
}

OUTPUT :

i--)
i; j++)
+ " ");
Baris ke" + i);