Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace zadanie_1
- {
- public partial class Form1 : Form
- {
- decimal[,]rejestracja;
- public Form1()
- {
- InitializeComponent();
- rejestracja = new decimal[20, 5];
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void ącznaLiczbaToolStripMenuItem_Click(object sender, EventArgs e)
- {
- decimal suma_tydzień = 0;
- for (int i = 0; i < rejestracja.GetLength(0); i++)
- {
- for (int j = 0; j < rejestracja.GetLength(1); j++)
- {
- suma_tydzień = suma_tydzień + rejestracja[i, j];
- }
- }
- label3.Text = "Łączna suma" + suma_tydzień + " ";
- }
- private void informacjaToolStripMenuItem_Click(object sender, EventArgs e)
- {
- int max = int.MinValue;
- int max_id = -1;
- for (int i = 0; i < rejestracja.GetLength(0); i++)
- {
- decimal max_z_wiersza = 0;
- for (int j = 0; j < rejestracja.GetLength(1); j++)
- {
- max_z_wiersza = max_z_wiersza + rejestracja[i, j];
- }
- if (max_z_wiersza > max)
- {
- max_z_wiersza = max;
- max_id = i + 1;
- }
- label4.Text = "Najwięcej zrobił" + max_z_wiersza + " ";
- label5.Text = "I" + +max_id + " ";
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int nr_pracownika = (int)numericUpDown1.Value - 1;
- int nr_dnia = (int)numericUpDown2.Value - 1;
- decimal godziny = numericUpDown3.Value;
- rejestracja[nr_pracownika, nr_dnia] = godziny;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement