-
Help with Loops
Hi i'm new to VB.net and i'm trying to figure out a way to do this question.
• Write a solution using Structured English and
• Using the Structured English develop a Visual Basic.Net program to solve it.:
• The program must include a decision statement and a loop structure;
for the following:
The student canteen runs a discount scheme for meals allowing a student to obtain 10 meals a week from the breakfast, lunch and teas it serves Mon – Fri. In any one day only two meals may be purchased i.e one day a student could have a breakfast and lunch but not a tea but another day they may decide to have a lunch and a tea but no breakfast. Write a program to obtain the meal plans of a student for one week. It should display error messages if the rules of the discount scheme are broken (e.g. more than 10 meals a week or more than 2 a day) but also indicates if a student is missing some meals e.g. only 9 taken in the week.
I'm thinking that doing checkboxes and then looping them for each day? i'm not sure where to start any help please!
-
Re: Help with Loops
Since this is homework, if you show us what you have done so far and what particular items that you're having problems with then we can try to help you to solve them, but generally we don't give you the solution as a whole because that is cheating and it's unfair to other students.
-
Re: Help with Loops
Well i just have no idea where to start really. If you could set me in the right direction as i have an idea of setting error messages. Its just im not sure on how to display this. Do i use a checked list box?
-
Re: Help with Loops
So something like for Monday
If chkbreakfast.checked Then
Total +=1
If chklunch.checked Then
Total +=1
Ifchktea.checked Then
Total +=1
and then add a loop for tuesday, wednesday etc? and error messages if more than 2 and also if they dont add up to 10 an error?
-
Re: Help with Loops
Nevermind, it helps if I actually read the post!! I will try to repost shortly.
Good Luck!
D
-
Re: Help with Loops
use my code in the other forum