Visual Studio and C# Programming Flashcards

1
Q

Name four (4) programming languages supported by Visual Studio 2015.

A

C#
Visual Basic
C++
F#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Using Visual C#, write a code snippet of a class Account that resembles a Bank account.

A

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”);
}
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List the two (2) types of operators required to build Boolean expressions.

A

Comparison operators (e.g., ==, !=, <, >)
Logical operators (e.g., &&, ||)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly