using System;
using System.Collections.Generic;
using System.Text;
namespace _303_fall_2007_lecture_16
{
class Program
{
static void DisplayVariables(int x, double y, string name)
{
Console.WriteLine("x = " + x + " y = " + y + " name = " + name);
}
static void Main(string[] args)
{
int a = 42;
double b = 13.9;
string c = "Alice";
DisplayVariables(a, b, c);
Square(a);
DisplayVariables(a, b, c);
Square2(ref a);
DisplayVariables(a, b, c);
int uc;
GetChoice(out uc);
Console.WriteLine("uc = " + uc);
}
private static void Square(int p1)
{
p1 = p1 * p1;
}
private static void Square2(ref int p1)
{
p1 = p1 * p1;
}
private static void GetChoice(out int choice)
{
int c;
do
{
Console.Write("Enter a choice 1-6: ");
c = Convert.ToInt32(Console.ReadLine());
} while ((c < 1) || (c > 6));
choice = c;
}
}
}