|
-
Oct 31st, 2007, 09:57 AM
#1
Thread Starter
New Member
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!
-
Oct 31st, 2007, 10:28 AM
#2
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.
-
Oct 31st, 2007, 10:52 AM
#3
Thread Starter
New Member
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?
-
Oct 31st, 2007, 10:57 AM
#4
Thread Starter
New Member
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?
-
Oct 31st, 2007, 12:26 PM
#5
Fanatic Member
Re: Help with Loops
Nevermind, it helps if I actually read the post!! I will try to repost shortly.
Good Luck!
D
Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP
Please Rate If I helped you. 
Please remember to mark threads as closed if your issue has been resolved.
Reserved Words in Access | Connection Strings
-
Oct 31st, 2007, 03:49 PM
#6
Re: Help with Loops
use my code in the other forum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|