I wrote a script
I win.
/*
* Description: This is a simple program to collate three match scores and then average the total.
* Author: Mark Grealish (mark@mail.itsligo.ie)
* Date: 10/10/2011
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace prac1QV5
{
class Program
{
static void Main(string[] args)
{
int score0, score1, score2, addition, average; // These are our four variables. Our three match scores and then the average.
Console.Write(“Please enter the first match score: “);
score0 = Convert.ToInt32(Console.ReadLine()); // As was covered in the previous example, we tell the system to convert any input to a 32-bit number and then read the console input.
Console.Write(“You again. Please enter the second match score: “);
score1 = Convert.ToInt32(Console.ReadLine());
Console.Write(“Are you still here? Enter it already: “);
score2 = Convert.ToInt32(Console.ReadLine());
// Process this:
addition = score0 + score1 + score2;
average = addition / 3;
Console.Write(“The average score from your first match ({0}), second match ({1}) and third match ({2}) is {3}. Now go away before I insult you again!”, score0, score1, score2, average);
// Here we output the result of our multiplication. score0 = {0}, score1 = {1} and score2 = {2}. Thes are variables.
}
}
}
Categorised as: regular