internal class Program { private static void Main(string[] args)//starts the program { //Declaring variables for the program string Surname = ""; string Input = ""; string NationalInsuranceNumber = ""; int Age = 0; double TimesTables = 0; double Number1 = 0; double Number2 = 0; Boolean SurnameT = false; Boolean AgeT = false; Boolean ConvertOK = false; Boolean NationalInsuranceNumberT = false; Boolean Number1T = false; Boolean Number2T = false; do//initiates a loop statement { Console.WriteLine("What is your surname?");//outputs text to user Surname = Console.ReadLine();//inputs answer from the user if (Surname.Length == 0)//checks the length of the string { Console.WriteLine("Error - Surname must contain text");//outputs text to the user } else//if conditions are not met { Console.WriteLine("Surname is accepted, your surname is " + Surname);//outputs text to the user SurnameT = true;//sets a boolean to true } } while (SurnameT == false);//ends loop when condition is met do//initiates a loop statement { Console.WriteLine("How old are you?");//outputs text to user Input = Console.ReadLine();//inputs answer from user ConvertOK = int.TryParse(Input, out Age);//converts a string to integer if (ConvertOK) if (Age < 1)//will use this if condition if the number is less than 1 { Console.WriteLine("Please enter a valid number");//outputs text to user } else//if conditions are not met { Console.WriteLine("Age is accepted, you are " + Age + " years old");//outputs text to user AgeT = true;//sets a boolean to true } } while (AgeT == false);//ends loop when condition is met do//initiates a loop statement { Console.WriteLine("What is your national insurance number?");//outputs text to the user NationalInsuranceNumber = Console.ReadLine();//inputs answer from user if (NationalInsuranceNumber.Length < 9)//will use if answer is less than 9 in length { Console.WriteLine("National insurance number is too short please give a valid number");//outputs text to user } else if (NationalInsuranceNumber.Length > 9) //will use condition if answer is more than 9 in length { Console.WriteLine("National insurance number is too long please give a valid number");//outputs text to user } else//if conditions are not met { Console.WriteLine("National insurance number is accepted, it is " + NationalInsuranceNumber);//outputs text to user NationalInsuranceNumberT = true;//sets a boolean to true } } while (NationalInsuranceNumberT == false);//ends loop when condition is met Console.WriteLine("Now you will decide on 2 numbers with each including decimal points to multiply eachother");//outputs text to user do//initiates a loop statement { Console.WriteLine("Pick a number between 1 and 10? (With a decimal point)");//outputs text to the user Input = Console.ReadLine();//inputs answer from user ConvertOK = double.TryParse(Input, out Number1);//converts a string to double if (ConvertOK)//if condition is met continue if (Number1 < 0.1 || Number1 > 10)//if number is above 10 or below 0 use this condition { Console.WriteLine("Please enter a valid number");//outputs text to user } else//if no other condition is met { Console.WriteLine("Number is accepted, your first number is " + Number1);//outputs text to user Number1T = true;//sets a boolean to true } } while (Number1T == false);//ends lop when condition is met do { Console.WriteLine("Pick a second number between 1 and 10? (With a decimal point)");//outputs text to the user Input = Console.ReadLine();//inputs answer from user ConvertOK = double.TryParse(Input, out Number2);//converts a string to a double if (ConvertOK)//if condition is met continue if (Number2 < 0.1 || Number2 > 10)//if number is above 10 or below 0 use this condition { Console.WriteLine("Please enter a valid number");//outputs text to the user } else//in no other condition is met { Console.WriteLine("Number is accepted, your second number is " + Number2);//outputs text to the user Number2T = true;//sets a boolean to true } } while (Number2T == false);//ends loop when condition is met TimesTables = Number1 * Number2;//sets timestables to number1 * number2 Console.WriteLine("Your final number is " + TimesTables);//outputs text to the user Console.WriteLine("Your surname is " + Surname + ", you are " + Age + " years old, your national insurance number is " + NationalInsuranceNumber + " and your multiplied number is " + TimesTables);//outputs text to user Console.WriteLine("To end the program please click enter");//outputs text to the user Console.ReadKey();//ends the program } }