![]() |
|
#1
|
|||
|
|||
Test Score DataAm absolute new to the field.
I am getting started with this project. Can any one of you suggest the right simplest approach to get this done. I have not learned arrays yet. I kind of know that, one way to accomplish this project is using an array. But at this time i do not want to use an array. so here is the project: Test Score :Text Box User Entry Num of Scores : LBL Average Score : LBL Best Score : LBL EnterBtn ResetBtn ExitBtn The use enters a test score ranging 0 to 100 and then clicks the enterBtn. For each score the application adds one to the Num of Scores, Calculates the Average Score, and determines what the best score is so far. Then, it displays the results. I know that the average score is the sum of all scores divided by the Num of Scores. The specifications is: To make this work, i had to declare module level variables for the Num of scores, the sum of the scores, and best score. Pls advise the best simplest approach. Thanks a bunch/Saru |
|||
|
#2
|
||||
|
||||
Re: Test Score DataHi Saru,
Welcome to the GID Forums™. Do you use VB or C#? If VB, You can find information and tutorial here: Creating a Simple Application Cheers, Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#3
|
|||
|
|||
Re: Test Score DataVisualstudio.net
|
|
#4
|
||||
|
||||
Re: Test Score DataSaru,
Visual Studio.NET supports a lot of languages. For example, :C++, C#, JScript, Visual Basic, Transact-SQL, and Visual FoxPro etc, etc... But, for your project, I think Visual Basic is the best possible solution. Go to the link in my earlier post, and that will help you in creating a simple application. Once you learn the basics right, then go on to complete the program. You can also buy a good book, if you are serious in learning Visual Basic, or any other language. Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#5
|
|||
|
|||
Re: Test Score DataThanks for your response. I am using visual basic.
Can you tell how i would save the numbers in a variable and display the best score of all the numbers without using an array. Thanks/Saru |
|
#6
|
||||
|
||||
Re: Test Score DataYeah. You can do this program without arrays.
First, add one textbox to get the user input. Create three buttons as you said, for submit, reset and cancel. Now, the textbox name would be textbox1 by default. After this, we have to create labels. Labels are used to display text. So, if you want to do like this: Quote:
Code:
The text in label5, label6 and 7 should be null. Delete all the existing text in them. Then also rename the button text, namely submit, reset and cancel. So, the form has been created, and looks something like this: Code:
Now, the name of the buttons are: submit, reset and cancel. The name of the labels which contains: number of scores ==> numlabel average of scores ==> avglabel best score ==> bestlabel Now, to coding the inner details: First, create a variable say score as integer. Like this: VB / Visual Basic Code:
You also need to create four more variables, to calculate the number of scores, average score and best score, and a final one for total score. And initialize all variables to 0 at start. Like: VB / Visual Basic Code:
Then, go to the form, and double click the submit button. It will go to a code, where it displays like this: VB / Visual Basic Code:
Now, you have get the text in the textbox, convert it to integer. Like this: VB / Visual Basic Code:
Now, add 1 to number of scores, and add score to total score. To find the average, divide the total by the number of scores. Then, check whether best score is leser than score. If it is, then change the best score to score. here is a sample: VB / Visual Basic Code:
We have to add some more to the command1_click. We have to change the text in the labels. We can do like this: VB / Visual Basic Code:
For reset, just assign all variables to zero. Then clear the text in all labels. For cancel, add the exit function. Learn the basics before going into the program. If you dont understand any of these things, post again to clarify. Regards , Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#7
|
|||
|
|||
Re: Test Score DataThank You very much Paramesh.
I was half way thru with trying to get the best score doing my way. But your reply was a step by step walk thru. Let me tell you, you are a good teacher. It worked for me. Thank you so very much. What part of india are you from? Are you in USA or in India? Thanks Again, Saru Brochu |
|
#8
|
||||
|
||||
Re: Test Score DataThank You Saru!
I am in Chennai, Tamil Nadu, India. Where are you from? ![]() Best Regards, Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#9
|
|||
|
|||
Re: Test Score DataVery Nice. I am in USA but I was born in Bangalore.
I am taking a job as .Net Developer entry level on Jan3rd 2006. I might need help from you. Here is my Direct email Address. saru0516@yahoo.com Thanks a lot for helping me. Saru Brochu |
Recent GIDBlog
Problems with the Navy (Enlisted) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 13:12 |
| Strange C++ code memory leakage problem | gaoanyu | C++ Forum | 7 | 04-Nov-2005 08:09 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 07:10 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 15:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The