[go: up one dir, main page]

0% found this document useful (0 votes)
13 views3 pages

String

The document contains a C# program that collects and processes employee work data for two employees over five days. It calculates regular and overtime hours, as well as the corresponding wages based on predefined rates. Finally, it displays the collected data in a formatted output for each employee.

Uploaded by

maulanap599
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)
13 views3 pages

String

The document contains a C# program that collects and processes employee work data for two employees over five days. It calculates regular and overtime hours, as well as the corresponding wages based on predefined rates. Finally, it displays the collected data in a formatted output for each employee.

Uploaded by

maulanap599
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/ 3

string[] nama = new string[2];

string[,] hari = new string[2,5];

double[,] jamkerja = new double[2,5];

double[,] jamlembur = new double[2,5];

double[,] upahkerja = new double[2,5];

double[,] upahlembur = new double[2,5];

double[,] totalupah = new double[2,5];

for (int x = 0; x < 2; x++)

Console.Clear();

Console.WriteLine("Data Ke :{0}", x + 1);

Console.Write("Nama Karyawan : ");

nama[x] = Console.ReadLine();

for (int y = 0; y < 5; y++)

Console.Write("Hari Kerja : ");

hari[x,y] = Convert.ToString (Console.ReadLine());

Console.Write("Jam Kerja : ");

jamkerja[x,y] = Convert.ToDouble(Console.ReadLine());

if (jamkerja[x,y] >= 7)

jamlembur[x,y] = jamkerja[x,y] - 7;

}
else

jamlembur[x,y] = 0;

upahkerja[x,y] = jamkerja[x,y] * 10000;

upahlembur[x,y] = jamlembur[x,y] * 20000;

totalupah[x,y] = upahkerja[x,y] + upahlembur [x,y];

Console.Clear();

for (int x = 0; x < 2; x++)

Console.WriteLine();

Console.WriteLine("Nama : {0}", nama[x]);

Console.WriteLine("=====================================================================
==============");

Console.WriteLine("Hari Jam Krja Upah Kerja Jam Lembur Upah Lembur Total
Upah");

Console.WriteLine("=====================================================================
==============");

for (int y = 0; y < 5; y++)

{
Console.WriteLine("{0,-15} {3,-15} {2,-15} {3,-15} {4,-15} {3,-15}",
hari[x,y],jamkerja[x,y],upahkerja[x,y],jamlembur[x,y],upahlembur[x,y],totalupah[x,y]);

You might also like