using System;
using System.Xml.Linq;
namespace ConsoleApp1
{
internal class Program
{
static int highScore = 50;
static string highScoreHolder = "Alfer";
public static void Main(string[] args)
{
PlayerScore(45,"Rumaiz");
PlayerScore(55,"zahidh");
PlayerScore(60,"Mohamed");
}
public static void PlayerScore(int score, string player) {
if (score > highScore)
{
highScore = score;
highScoreHolder = player;
Console.WriteLine("New high score is: " + score + " New record holder is: " + player);
}
else
{
Console.WriteLine("High score is: "+highScore+" was not broken & The record holder is: "+highScoreHolder);
}
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter