Zadanie- system wynagrodzenia w C#
Treść zadania :
Użytkownik ma możliwość wyboru ustalenia stawki dziennej systemu wynagrodzeń:
Wariant 1: za każdą przepracowaną godzinę otrzymuje 50 zł,
Wariant 2: za pierwszą przepracowaną godzinę otrzymuje 10 groszy, za każdą następną podwojoną kwotę do tej pory zarobionych pieniędzy.
Pobierz od użytkownika liczbę przepracowanych godzin (liczba całkowita z przedziału 1-12) i wskaż, który wariant jest dla niego korzystniejszy.
Liczby pierwsze w C#.
[code lang=”csharp”] <pre>using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication { class Program { static void Main(string[] args) { int n = 0; Console.Write("Podaj liczbe: "); n = Convert.ToInt32(Console.ReadLine()); bool[] tab = new bool[n + 1]; for (int…
Oszczędzanie przez n lat w C#
[code lang=”csharp”] <pre>using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication12 { class Program { static void Main(string[] args) { string y; do { int j = 0, i = 0, n = 0, c = 0, b =…
Tabliczka mnozenia C#
[code lang=”csharp”] int a, b, i, j, k; Console.WriteLine("Podaj rozmiar tabliczki mnozenia: "); a = int.Parse(Console.ReadLine()); for (j = 1; j { if (j == 1) { Console.Write(""); Console.Write("\t{0}", j); } else { Console.Write("\t{0}", j); } } for (i =…
Kwadrat z pustym środkiem C#.
int i, j, k, l,n; Console.WriteLine(„Podaj bok kwadratu: „); int a = int.Parse(Console.ReadLine()); for (i = 1; i <= a; i++) { if (i == 1) { for (j = 1; j <= a; j++) { Console.Write(„@”); } Console.Write(„\n”);…
Tablice w C#.
Console.WriteLine(„Podaj rozmiar tablicy: „); int n = int.Parse(Console.ReadLine()); int[] t1 = new int[n]; for (int i = 0; i < n; i++) { Console.WriteLine(„Podaj liczbę : {0}”, i ); t1[i] = int.Parse(System.Console.ReadLine()); } Console.WriteLine(„W tablicy sa: „); for (int i…
Duze litery C#.
string dane; Console.WriteLine(„Podaj imie i nazwisko: „); dane = Console.ReadLine(); string[] danetab = dane.Split(new Char[] { ’ ’ }); Console.WriteLine(„\nTwoje imie i nazwisko zapisane prawidlowo: „); foreach (string x in danetab) { for (int j = 1; j <= 1;…
Program w C#…
int kontrolka = 0; Console.WriteLine(„Podaj zdanie: „); string wyraz = Console.ReadLine(); int c = wyraz.Length; int d = c – 6; Console.Clear(); Console.WriteLine(„Poprawne zdanie: „); for (int h = 0; h < c; h++) { if (h == 0) Console.Write(Char.ToUpper(wyraz[h]));…
Liczby podzielne przez 3 w C#.
string k ;
do
{
int a = 0, b = 0;
int i, l = 0;
Console.Clear();
Console.WriteLine(„Podaj pierwsza liczbe: „);
a = Int32.Parse(Console.ReadLine());
Console.WriteLine(„Podaj druga liczbe: „);
b = Int32.Parse(Console.ReadLine());
Program przepisujacy dodatnie liczby w C#.
Console.WriteLine(„Podaj rozmiar tablicy: „); int n = int.Parse(Console.ReadLine()); int[] t1 = new int[n]; int[] t2 = new int[n]; for (int i = 0; i < n; i++) { Console.WriteLine(„Podaj liczbę : {0}”, i); t1[i] = int.Parse(System.Console.ReadLine()); if (t1[i] >…