You are on page 1of 2

Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XDDDD
{
class AccountCreditInformation
{

public string Credit()


{
return "Balance is Credited";
}
}
class DebitInformation : AccountCreditInformation
{

public string Debit()


{
return "Balance is Debited";
}
}

class Program
{
static void Main(string[] args)
{
DebitInformation x = new DebitInformation();

int incomplete = 1;
while (incomplete == 1)
{
Console.WriteLine("Determine whether the balance should be credited or
debited. C for Credit or D for Debit.");
char d = Console.ReadKey().KeyChar;
Console.WriteLine();
switch (d) //honestly recycled from my own code xddddd
{

case 'C':
case 'c':
Console.WriteLine(x.Credit());
incomplete--;
break;

case 'D':
case 'd':
Console.WriteLine(x.Debit());
incomplete--;
break;

default:
Console.WriteLine("Invalid Input! Try Again! ");
Console.WriteLine();
continue;

}
Console.ReadKey();
}
}
}

} //turns out this one was an essay. Second submission is the code + file

Output

You might also like