473,549 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Grade Calculator Problem

1 New Member
I have a project I am working on and have hit a road block. This is what the program must accomplish:
The Windows application opens with a text box where the user enters their SSN and 4 seperate test scores. The program will calculate the average test score. Clear the entries to start over and an exit button.
'This code is executed when the user
' clicks the Calculate Score button. It
' calculate the average test score.

Dim strTestScore1 As String
Dim intTestScore1 As Single
Dim strTestScore2 As String
Dim intTestScore2 As Single
Dim strTestScore3 As String
Dim intTestScore3 As Single
Dim strTestScore4 As String
Dim intTestScore4 As Single
Dim strAvgTestScore As String
Dim decAvgTestScore As Decimal

strTestScore1 = Me.lblTestScore 1.Text
'intTestScore1 = Convert.ToInt32 (strTestScore1)
strTestScore2 = Me.lblTestScore 2.Text
'intTestScore2 = Convert.ToInt32 (strTestScore2)
strTestScore3 = Me.lblTestScore 3.Text
'intTestScore3 = Convert.ToInt32 (strTestScore3)
strTestScore4 = Me.lblTestScore 4.Text
'intTestScore4 = Convert.ToInt32 (strTestScore4)
decAvgTestScore = Convert.ToDecim al(decAvgTestSc ore)
decAvgTestScore = Math.Round(decA vgTestScore, 1)

decAvgTestScore = ((intTestScore1 + intTestScore2 + intTestScore3 + intTestScore4) \ 4)
Me.lblAvgTestSc ore.Text = Math.Round(decA vgTestScore, 1).ToString("F1 ")
Attached Images
File Type: jpg Grade Calc.jpg (3.6 KB, 200 views)
Mar 18 '10 #1
0 1857

Sign in to post your reply or Sign up for a free account.

Similar topics

35
3135
by: Henry | last post by:
I was doing this program for an exercise in a book. The point was to create a program that would take a numerical grade from a user and convert it to a letter grade (yeah really easy). I tried to incorporate the while loop to keep the program running continuously so the user could keep entering grades to get the letter number, but I had...
4
2233
by: Raj Chudasama | last post by:
I have a controls similiar to the windows calculator. (Please press some buttons on your calculator to see what i am talking about) So when u hover over a button it will change the state (it changes to different image) if u click it will show pressed image etc now the problem: the calculator does the following
24
6298
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to have on his site, a Javascript Calculator for working out the cost of what they want, for example: 1 widget and 2 widglets = £5.00
1
3556
by: sparkid | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to run, However, i simply created this program in arrays and it runs good except i cant figure out how to compute the standard deviation. The coding is...
7
6657
by: tea-jay | last post by:
hello every body our teacher asks us to write this assiment it has 2 question i did write the first one but the other was really complicated 2 me coz our teacher doesn't know how to explain this so plz plz try to solve this problem
4
7384
by: Madmartigan | last post by:
Hello I have attempted the source code from Chapter 4 in Accelerated C++ page 70 but keep getting the above error. I'm not sure whether it is in the way I have saved the header files or because my structure is wrong all together. I have included the code. I have created 3 header files, 3 extra source files and the main source file. I have...
2
14884
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
3
2881
by: mandy335 | last post by:
public class Calculator { private long input = 0; // current input private long result = 0; // last input/result private String lastOperator = ""; // keeps track of the last operator entered /* Digit entered as integer value i * Updates the value of input accordingly to (input * 10) + i */
9
8313
tiktik
by: tiktik | last post by:
Hi... I am doing this simple Java program which displays a particular grade (A, B, C...) according to the mark entered. However I cannot arrange it in such a way that it displays "Invalid" if the user eners a grade > 100... take a look... System.out.print ("Enter mark: "); int mark = Keyboard.readInt(); char grade =' ';
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.