mg
mg
CC#
Created by Moha on 3/2/2025 in #help
Bank code
not sure if whatever mobile IDE you're using supports breakpoints but at worst you can Console.WriteLine() to see what the value of different things are at different points in your code's execution
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
-600 + 1000 is indeed 400, so your program must not be computing -600 + 1000. it must be computing something else
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
while loops don't need a semicolon at the end, but do/whiles do
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
just focus on getting the do/while working and you can re-add that part later
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
I would forget about the "Please say yes or no" part for now
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
that's a regular feeling in this line of work
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
so choice == "yes" || choice == "yes." is what goes in the parentheses of the do/while
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
you've got the logic there already, if (choice == "yes" || choice == "yes.")
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
there are infinitely many options other than true and false
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
so we definitely don't want true in the parentheses, otherwise it'll just keep going forever
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
do you want it to keep going forever?
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
so your code will look like
string choice;
do
{
// ask about withdrawing, depositing, etc.
// do the withdrawal, deposit, etc.
// ask if the user wants to go again, so now choice has a value
}
while (/* what goes here? */);
string choice;
do
{
// ask about withdrawing, depositing, etc.
// do the withdrawal, deposit, etc.
// ask if the user wants to go again, so now choice has a value
}
while (/* what goes here? */);
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
yep
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
right
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
so before the loop, should it have a value?
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
but it's just a variable. it can remain uninitialized
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
you're assigning the output of Console.ReadLine().ToLower() to it
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
it's a variable
170 replies
CC#
Created by Moha on 3/2/2025 in #help
Bank code
before the loop, should choice even have a value?
170 replies