I am relatively new to the world of programming and I was wondering if anybody could help me with a small project. I am trying to create two programs in VB.Net that each do one of the following individual actions:
Find the average grade given several user-inputted scores on assignments. The program should also provide the following feedback according to the final score (i.e. A, B, C, D, F).
Run two separate threads printing numbers (or words) in ascending and descending orders. (The numbers (or words) should be given by the user.)
I have a basic understanding of VB.Net, but I am having trouble when it comes to creating even remotely complex programs. I have a few ideas on how I may go about these, such as using an arraylist for the first question that takes user input to find the grades, and then uses a series of If-Then-Else statements to display the letter grade, and possibly using steps simply with dual threading that would result in numerical order being printed in ascending order and descending order. Any help or advice would be greatly appreciated.
P.S. I will be adding the code I 开发者_如何学运维have so far for both of these programs shortly. In the meantime, if you can help me at all with the information I have given you, it would be helpful.
Here's some pseudocode to help you get started on #1:
- get list of scores from user input (Console.Readline() if this is a console app)
- assign scores to an array or list (List would be a good choice)
- get the total score (assuming they're not weighted, if you have a List then you can just use the Sum() method)
- get the number of grades (again, if you have a List then you can use Count() method)
- divide total by count to get average (if you need a decimal average, you'll have to cast your values to double first, or if your average can be an int just leave them all as int)
- use an if-then-else to compare the average to each grade cutoff (if > 90 then "A", else if > "80" then "B", etc)
精彩评论