Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication17
- {
- class Program
- {
- static void Main(string[] args)
- {
- //3
- int a, b, num1, num2;
- for (a = 1; a <= 50; a++)
- {
- Console.WriteLine("Please enter 2 numbers:");
- num1 = int.Parse(Console.ReadLine());
- num2 = int.Parse(Console.ReadLine());
- if (num1 < num2)
- {
- for (b = num1; b <= num2; b++ )
- Console.Write(b + " ");
- }
- if (num1 > num2)
- {
- for (b = num2; b <= num1; b++)
- Console.Write(b + " ");
- }
- Console.WriteLine();
- }
- // 4
- int hrs, i, totalhrs, k;
- double hrpay, payment, avg, sumpay = 0;
- for (i = 1; i <= 500; i++)
- {
- totalhrs = 0;
- Console.WriteLine("Employee No. " + i + ":");
- for (k = 1; k <= 25; k++)
- {
- if (k > 2)
- Console.WriteLine("How many hours did you work on the " + k + " day?");
- else if (k == 2)
- Console.WriteLine("How many hours did you work on the second day?");
- else if (k == 1)
- Console.WriteLine("How many hours did you work on the first day?");
- hrs = int.Parse(Console.ReadLine());
- totalhrs += hrs;
- }
- Console.WriteLine("How much money do you get for a single hour?");
- hrpay = int.Parse(Console.ReadLine());
- payment = hrpay * totalhrs;
- Console.WriteLine("Worker ID " + i + " got " + payment + "$ this mounth.");
- sumpay += payment;
- }
- avg = sumpay / 500;
- Console.WriteLine("The average payment was: " + avg + "$.");
- //5
- int i, k, j;
- for (i = 1; i <= 10; i++)
- {
- for (k = 1; k <= 10; k++)
- {
- j = i * k;
- if (j < 10)
- Console.Write(j + " ");
- else
- Console.Write(j + " ");
- }
- Console.WriteLine();
- }
- //6
- int a, b;
- for (a = 1; a <= 6; a++)
- {
- for (b = 1; b <= 6; b++)
- {
- Console.Write("(" + a + "," + b + ") " );
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement