Okay, so i am new to C#, not new to programming as i know enough of HTML, CSS PHP etc to be able to code a few things, i also know a little of C++. To help me learn i have been taking online lessons and adapting them to fit my own future gaming needs. This is a script i have created that would display your max health, by multiplying your strength and endurance together.
If you could spare a minute to look over the code, check it is correct And/Or suggest ways, methods etc that would help it improve or integrate better that would be fantastic :). Without Further Ado, my code:
using System;
namespace MaxHealthApplication
{
class MaxHealth
{
// variables
double strength;
double stamina;
public void Acceptdetails()
{
strength = 4;
stamina = 3;
}
public double GetMaxHealth()
{
return strength * stamina;
}
public void Display()
{
Console.WriteLine("Strength: {0}", strength);
Console.WriteLine("Stamina: {0}", stamina);
Console.WriteLine("MaxHealth: {0}", GetMaxHealth());
}
}
class ExecuteMaxHealth
{
static void Main(string[] args)
{
MaxHealth r = new MaxHealth();
r.Acceptdetails();
r.Display();
Console.ReadLine();
}
}
}