Tuesday, July 14, 2009

Visual Basics.NET. Help me please.?

I am taking a course in Visual Basics. We are using microsft visual basic 6.0 I have been struggling with this course all semester. People say visual basics was easier and better than C++ but I like C++ better. Can someone please help me.





We have to make a program to do the following.As an IF statement





A program that accept admission


It should accept ranking from high school, score on admission test.


Admit only if


Ranking%26lt;=10% and testsocre%26gt;=70%


Ranking%26lt;=20% and test score %26gt;=80%


Ranking%26lt;=30% and test score%26gt;=90%


Else do not admit.


I dont have the software at home but this is what i did in class.


Dim Score As Integer


Dim Ranking As Integer


Dim Admit As String


Dim AdmissionDeclined As String


If Score %26gt;= 20 And Ranking %26lt;= 10 Then Admit() Else If Score %26gt;= 80 And Ranking %26lt;= 20 Then Admit() Else If Score %26gt;= 90 And Ranking %26lt;= 30 Then Admit() Else AdmissionDeclined()


End Sub. I dont have enough characters to print the whole code

Visual Basics.NET. Help me please.?
First of all your code has score %26gt;= 20 when I think you mean score %26gt;= 70. That is probably just a typo. Secondly, make sure you have elseif as one word and you need "end if" after the else. In VB you always have to end an if with an "end if" statement Other than that, it appears everything else should work.





Oh and to let you know, VB has its strengths and C++ has its strengths. You really can't say one is better than the other because they are designed with different ideas in mind. C++ is great for memory management and speed, VB is great for GUI and database front end design.





Hope this helps you and good luck with the course. Stick with it, VB can take you places.





Enjoy!
Reply:It looks like you're on your way. What is the specific problem you're having?





You need to create methods for Admit() and AdmissionDeclined()


No comments:

Post a Comment