Visual Studio and C# Programming Flashcards
Name four (4) programming languages supported by Visual Studio 2015.
C#
Visual Basic
C++
F#
Using Visual C#, write a code snippet of a class Account that resembles a Bank account.
i. Private Class field AccountName, AccountBalance with appropriate data types.
public class Account
{
private string AccountName;
private decimal AccountBalance;
}
ii. Behavior that allows acceptance of an amount to be withdrawn only if there is enough money in the account balance.
public void Withdraw(decimal amount)
{
if (amount <= AccountBalance)
{
AccountBalance -= amount;
Console.WriteLine($”Withdrawn amount: {amount}, Remaining balance: {AccountBalance}”);
}
else
{
Console.WriteLine(“Insufficient funds”);
}
}
List the two (2) types of operators required to build Boolean expressions.
Comparison operators (e.g., ==, !=, <, >)
Logical operators (e.g., &&, ||)