GPA Calculator Issues

Honestly I have no idea why it isn't functioning. I'm trying to make a GPA calculator with different levels of classes, so like AP, Honors. For our school there's a weird system where each different class gets a different scorepoints that correlates to different grades but all have the same credit (5). When I run my code it gives me the error >= cannot accept the argument: , [true],[97],
gp(2).aia (7.3 KB)

Search for the >= block and fix the first argument, which is a boolean, but should be a number

Taifun


is it the one where x1=H

Also here is the full code

NumbersOnly is true or false
To get the text of a textbox, which in your case is a number, use the Text property

Taifun

Also to make your code more readable, you are allowed to rename your variable names... x, x1, x2.. make it easy for you and others to better understand your code

Taifun

Thank you so so so much. But now it's giving me [“”] [97]. is it another case where it's different from a number?

If you do not enter a value, it is an empty string and empfy strings can't be compared with 97

Initialize your textboxes to 0 or do some data validation, for example

If is empty course1grade Text
Then "please enter a value"
Else continue with your logic

Taifun

Ah, I see the problem now, I got one of my text boxes mixed up. I switched it around and now it seems to work. Thanks. If you don't mind, I have one last question. How do i manipulate the value of things in a list, specifically for the global gradepoint list, while using the call function of the procedure? I can't seem to get it to make changes to the values in the list. Thanks

I do not understand
Please elaborate and show us a screenshot of some relevant blocks

Taifun

Post your new aia export.

Changing things inside a list is possible if you pass the list as a parameter to a procedure, but it is not recommended.

I prefer generating new lists in value procedures, and passing the new lists down the line to other processes, for example generating easy to read ListView Elements.

See the chapters on lists and on procedures in
http://www.appinventor.org/book2

here is my aia
gp(3).aia (7.5 KB)
I want it so when the procedure's values is stored in a list which can be then used by the blocks involved in calculating the gpa.


I want the values from the procedure get value to be stored in a list which can then be access by the code that actually calculate the gpa.
I have it currently link to the list global gradepoint.

thanks

You need value procedures to capture textbox contents dynamically.


gp1.aia (8.2 KB)

Holy Moly, thank you so much, I finally get it now. You are a literal lifesaver. Seriously, thank you so so much.

A word of caution.

Two other people asked this same question.

One of them posted sample data, with one course having a different number of credits (3) versus the other courses (5).

I did not take into account the possibility that different courses would have different numbers of credits.

You would need an extra column for the course credits, and extra logic for that too.

No, you good. I just need the credit to be 5, thanks for all your help.