Lab Assignment 2

 

 

PLS NOTE: The text typed in the objects in the diagram, which correspond to textboxes in the table, is just done for you to be able to map objects between the table and the diagram. All textboxes (and only textboxes not buttons and labels) must appear blank in your application (like they do in a real calculator). Buttons and labels should display the symbols/words that are displayed on them in the diagram.

 

A) Simple Calculator

 

Object

Name

Function

1. Textbox

txtInput1

Takes the first input from the user

2. Textbox

txtInput2

Takes the 2nd input from the user

3. Button

btnAdd

When clicked -> adds the 2 user inputs

4. Button

btnSubtract

When clicked -> subtracts the 2 user inputs

5. Button

btnMultiply

When clicked -> multiplies the 2 user inputs

6. Button

btnDivide

When clicked -> divides the 2 user inputs

Label

lblResult

Displays the result of the operation

 

 

B) Grade Calculator

Weighted Average: An average that takes into account the proportional relevance of each component, rather than treating each component equally.

 

 

 

Object

Name

Function

1. Label

lblGrade

Displays title “Grade”

2. Label

lblWeight

Displays title “Weight”

3. TextBox

txtGrade1

Takes the homework grade input from user

4. TextBox

txtGrade2

Takes the midterm grade input from user

5. TextBox

txtGrade3

Takes the finals grade input from user

6. TextBox

txtWeight1

Takes the homework weight-age

7. TextBox

txtWeight2

Takes the midterm weight-age

8. TextBox

txtWeight3

Takes the finals’ weight-age

9. Label

lblHomework

Displays title “Homework”

10. Label

lblMidterm

Displays title “Midterm”

11. Label

LblFinals

Displays title “Finals”

12. Button

btnFinalGrade

When clicked-> computes the final grade

13. Label

lblResult

Displays the result of the computation(both the computed value and the corresponding letter grade eg. 93=A)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Rules for Grade Calulator:

1.    The grades must be inputted as values between 0-100.

2.    The weights must add up to 100.

3.    A weighted averge must be computed for the final grade ie.

(Grade1*Weight1 + Grade2*Weight2 + Grade3*Weight3)/(Weight1+Weight2+Weight3) and the result must be converted back to a grade A(90-100),B(80-89),C(70-79), D(40-60),F(0-40) and displayed along with the numeric value of the grade eg. 93 = A.