Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- namespace Employees
- {
- /*
- internal enum Proffesion
- {
- Accountant = 1,
- Seamstress,
- Seller
- }
- enum typeSalary
- {
- Hourly = 1,
- Daily
- }
- */
- /* class Employe
- {
- private Proffesion prof;
- private typeSalary typesal;
- private int salaryRate;
- private int ID;
- }
- class TimeEmploye
- {
- private int ID;
- private int hoursWorked;
- }*/
- static class Program
- {
- static void Main()
- {
- decimal s = 0;
- bool f = false;
- /*ArrayList in1 = new ArrayList();
- ArrayList in2 = new ArrayList();
- int el;
- while (!f)
- {
- el = Int32.Parse(Console.ReadLine());
- in1.Add(el);
- if (el == -1)
- {
- f = true;
- }
- }
- while (f)
- {
- el = Int32.Parse(Console.ReadLine());
- in2.Add(el);
- if (el == -1)
- {
- f = false;
- }
- }
- int[] arr1 = (int[]) in1.ToArray(typeof(int));
- int[] arr2 = (int[]) in2.ToArray(typeof(int));*/
- int[] arr1 = new int[]{1, 1, 10, 1, 2, 1, 8, 2, 2, 2, 100, 3, 3, 1, 15, 4, -1};
- int[] arr2 = new[] {1, 250, 2, 300, 3, 245, 4, 100, 4, 50, -1};
- for (int i = 0; i < arr1.Length-1; i += 4)
- {
- // [0] - proff
- // [1] - zp typesalary
- // [2] - salary rate
- // [3] - id
- Console.Write(" { " + arr1[i+3] + " } " );
- for (int j = 0; j < arr2.Length-1; j += 2)
- {
- if (arr1[i + 3] == arr2[j])
- {
- if (arr1[i] == 1)
- {
- if (arr1[i + 1] == 1)
- {
- decimal salary = arr1[i + 2] * arr2[j + 1];
- Console.Write("Salary: " + salary + " + ");
- s = s + salary;
- }
- else
- {
- decimal value = arr2[j + 1] / 24;
- var salary = arr1[i + 2] * Math.Round(value);
- Console.Write("Salary: " + salary + " + ");
- s = s + salary;
- }
- //S = S + ();
- }
- if (arr1[i] == 2)
- {
- if (arr1[i + 1] == 1)
- {
- decimal value = arr2[j + 1] / 24;
- decimal salary = arr1[i + 2] * arr2[j + 1];
- //value = arr2[j + 1] / 24;
- var bonus = Math.Round(value) * salary * (decimal) 0.01;
- Console.Write("Salary: " + salary + " ");
- Console.Write("Bonus: " + bonus + " ");
- salary += bonus;
- //Console.Write(salary + " + ");
- s = s + salary ;
- }
- else
- {
- decimal value = arr2[j + 1] / 24;
- //decimal value = arr2[j + 1] / 24;
- decimal salary = (arr1[i + 2] * arr2[j + 1]);
- var bonus = Math.Round(value) * salary * (decimal) 0.01;
- Console.Write("Salary: " + salary + " ");
- Console.Write("Bonus: " + bonus + " ");
- salary += bonus;
- //Console.Write(salary + " + ");
- s = s + salary;
- }
- }
- if (arr1[i] == 3)
- {
- if (arr1[i + 1] == 1)
- {
- decimal salary = arr1[i + 2] * arr2[j + 1];
- var bonus = salary * (decimal) 0.01;
- Console.Write("Salary: " + salary + " ");
- Console.Write("Bonus: " + bonus + " ");
- salary += bonus;
- //Console.Write(salary + " + ");
- s = s + salary;
- }
- else
- {
- decimal salary = (arr1[i + 2] * arr2[j + 1]);
- var bonus = salary * (decimal) 0.01;
- Console.Write("Salary: " + salary + " ");
- Console.Write("Bonus: " + bonus + " ");
- salary += bonus;
- //Console.Write(salary + " + ");
- s = s + salary;
- }
- }
- }
- }
- }
- Console.Write(" = " + s);
- }
- }
- }
Add Comment
Please, Sign In to add comment