So i was looking at hybrids tutorials to learn C# and i came across this assignment he wanted us to do and i wasnt going to skip it just because no one will know i skipped it, and i didnt want to cheat myself, so he gave me this "Problem" and i had to answer it in C#. i think i did it right, but im really not sure. so can someone take a look at it for me? if you dont know how to code, dont post in this thread, im looking for some real help and not some smartass answers, so thanks in advance to whoever helps me.
Problem:
Angelica has a bank account. Each month, she gains an interest of 0.03%. There withdrawal fee of $1.00 (every time money is withdrawn from the account $1.00 is also subtracted). Today, Angelica withdraws $20, but what will her balance be next month? Angelica will input her balance into your program.
What i have in C#:
Problem:
Angelica has a bank account. Each month, she gains an interest of 0.03%. There withdrawal fee of $1.00 (every time money is withdrawn from the account $1.00 is also subtracted). Today, Angelica withdraws $20, but what will her balance be next month? Angelica will input her balance into your program.
What i have in C#:
Code:
[COLOR="#3300cc"]namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double balance = double.Parse(Console.ReadLine());
balance = balance + (balance * 0.03);
balance = balance - (20 - 1);
Console.WriteLine(balance); // First month
balance = balance + (balance * 0.03);
Console.WriteLine(balance); // Second Month
}
}
}[/COLOR]