Professional Documents
Culture Documents
using System;
namespace Assignment1
{
class Program
{
const int MaxYear1Credits = 60; // number of ECs in first year
namespace Assignment2
{
class Program
{
static void Main(string[] args)
{
// read (first) number
Console.Write("Enter a number: ");
int number = int.Parse(Console.ReadLine());
Console.WriteLine();
Console.WriteLine("end of program");
}
}
}
using System;
namespace Assignment3
{
class Program
{
const int ARRAY_SIZE = 20;
const int MIN_VALUE = 1;
const int MAX_VALUE = 99;
namespace Assignment4
{
class Program
{
static void Main(string[] args)
{
Random rnd = new Random();
for (int i = 1; i <= 10; i++)
{
int number1 = rnd.Next(1, 51); // 1..50
int number2 = rnd.Next(1, 6); // 1..5
int remainder;
int result = IntegerDivision(number1, number2, out remainder);
Console.WriteLine($"{number1,2} / {number2} = {result,2} ({remainder})");
}
Console.WriteLine();
Console.WriteLine("end of program");
}
remainder = number1;
return quotient;
}
}
}
using System;
using System.Windows.Forms;
namespace Assignment5
{
public partial class NSDayTicketForm : Form
{
const double DayTicketSecondClass = 53;
const double DayTicketFirstClass = 87.46;
const double RailRunner = 2.50; // 4..11 years
public NSDagkaartForm()
{
InitializeComponent();
}
double price = 0;
if (nrOfDayTickets > 0)
{
if (rbSecondClass.Checked)
{
price = nrOfDayTickets * DayTicketSecondClass;
}
else // if (rbFirstClass.Checked)
{
price = nrOfDayTickets * DayTicketFirstClass;
}
}
txtPrice.Text = price.ToString("0.00");
}
}
}