# Beginner programming

Hi,
I'm working on my homework which is about creating a program that calculate grades and marks.
When running my program I receive the error message TYPE MISMATCH, especially on functions like

Let Total\$= (Asmark + Finmark + Exmark)/ 3

If Asmark >= 60 then.....
...
The message highlights the numbers...

I will appreciate if someone can help me on this.

• : Hi,
: I'm working on my homework which is about creating a program that calculate grades and marks.
: When running my program I receive the error message TYPE MISMATCH, especially on functions like
:
: Let Total\$= (Asmark + Finmark + Exmark)/ 3
:
: If Asmark >= 60 then.....
: ...
: The message highlights the numbers...
:
: I will appreciate if someone can help me on this.
:
: Thanks in advance.
:
:
:

You' re trying to assign a numeric value to a string variable.

[code]Let Total[b]\$[/b]= (Asmark + Finmark + Exmark)/ 3[/code]

Strip the \$ sign.
• : : Hi,
: : I'm working on my homework which is about creating a program that calculate grades and marks.
: : When running my program I receive the error message TYPE MISMATCH, especially on functions like
: :
: : Let Total\$= (Asmark + Finmark + Exmark)/ 3
: :
: : If Asmark >= 60 then.....
: : ...
: : The message highlights the numbers...
: :
: : I will appreciate if someone can help me on this.
: :
: : Thanks in advance.
: :
: :
: :
:
: You' re trying to assign a numeric value to a string variable.
:
: [code]Let Total[b]\$[/b]= (Asmark + Finmark + Exmark)/ 3[/code]
:
: Strip the \$ sign.
:

or if you would like to have the amount as a string, use the STR\$([italic]value[/italic])function...like so:

[code]
LET Total\$ = STR\$((Asmark + Finmark + Exmark) / 3)
[/code]

plus...unless you are either required to by your instructor, or are working on an [b]OLD[/b] version of basic (pre QBasic)...then strip the LET... Total\$ = STR\$((Asmark + Finmark + Exmark) / 3) will work just as good...there's no point in using a LET statement