mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Added some descriptions
This commit is contained in:
@@ -4,6 +4,9 @@ namespace Change
|
|||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Prints header.
|
||||||
|
/// </summary>
|
||||||
static void Header()
|
static void Header()
|
||||||
{
|
{
|
||||||
Console.WriteLine("Change".PadLeft(33));
|
Console.WriteLine("Change".PadLeft(33));
|
||||||
@@ -17,6 +20,14 @@ namespace Change
|
|||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets user input for price and payment.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// False if any input can't be parsed to double. Price and payment returned would be 0.
|
||||||
|
/// True if it was possible to parse inputs into doubles. Price and payment returned
|
||||||
|
/// would be as provided by the user.
|
||||||
|
/// </returns>
|
||||||
static (bool status, double price, double payment) GetInput()
|
static (bool status, double price, double payment) GetInput()
|
||||||
{
|
{
|
||||||
Console.WriteLine("Cost of item? ");
|
Console.WriteLine("Cost of item? ");
|
||||||
@@ -38,6 +49,10 @@ namespace Change
|
|||||||
return (true, price, payment);
|
return (true, price, payment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Prints bills and coins for given change.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="change"></param>
|
||||||
static void PrintChange(double change)
|
static void PrintChange(double change)
|
||||||
{
|
{
|
||||||
var tens = (int)(change / 10);
|
var tens = (int)(change / 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user