© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
41 replies
eazy35

❔ need help with homework (while loop)

hey guys, I am a novice programmer
I currently go to school for an MSIS degree
I am learning c#

I have a homework project that wants me to create a loop for a vending machine and i got everything to work (according to what the homework asked of me), but when it comes to calculate the total cost it only calculates the cost of the last thing i ordered.

can anyone help me with this problem? thank you in advanced.

the power point pics explain the home work.

I also posted my code. my code works for the loop but it just does not add the total money of all my orders only the last order.
image.png
image.png
code_a.txt1.98KB
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

I need help with for loop homework :(
C#CC# / help
2y ago
Need help with homework
C#CC# / help
3y ago
✅ Help with Homework
C#CC# / help
3y ago