Math blaster app

170 views
Skip to first unread message

jaqulain

unread,
Oct 9, 2015, 12:40:38 PM10/9/15
to MIT App Inventor Forum
i had used this block coding for addition quiz ( to view  coding click on link)-->   (http://www.appinventor.org/content/ai2apps/intermediateApps/mathBlaster) now i used this coding for Subtraction quiz but problem arise when i click on answer button but answer is always "Incorrect".  
 Note: i used math blocks of subtraction for subtraction quiz. plz help to solve problem ?????????????

Abraham Getzler

unread,
Oct 9, 2015, 3:31:04 PM10/9/15
to MIT App Inventor Forum
Show us your relevant blocks and screen shots, as attachments,
using the POST REPLY button.
ABG

Scott Ferguson

unread,
Oct 9, 2015, 4:21:57 PM10/9/15
to MIT App Inventor Forum
Looking at your addition tutorial, I don't see why it would not work for subtraction as well.

Note that you can also insert an image into the text of your reply by using the icon on the toolbar that looks like a photo.
---
sf

jaqulain

unread,
Oct 10, 2015, 2:04:01 AM10/10/15
to MIT App Inventor Forum


Ghica

unread,
Oct 10, 2015, 4:39:20 AM10/10/15
to MIT App Inventor Forum
You get an incorrect result, because using subtraction you must set the global result to the first item in your list, not to 0.
Cheers, Ghica.

jaqulain

unread,
Oct 10, 2015, 8:22:51 AM10/10/15
to MIT App Inventor Forum
i agree with you Gica that i should not set globle resul to 0 ,bt what number should i set to globle result instead of zero??? so i m confused

Ghica

unread,
Oct 10, 2015, 9:21:02 AM10/10/15
to MIT App Inventor Forum
If you have a list with, for example, 6,3,4 I assume that you want the result to be 6-3-4=-1
Therefore, you should set the initial result to 6, the first element in the list, as I said, and iterate over the rest of the list starting at the second element.
Cheers, Ghica

jaqulain

unread,
Oct 10, 2015, 11:38:40 AM10/10/15
to MIT App Inventor Forum
thanx Ghica for your guidence, it will be more helpful for me if u send me source code of subtraction so that i may understand easily....waiting for ur humble reply.....

Scott Ferguson

unread,
Oct 10, 2015, 12:51:38 PM10/10/15
to MIT App Inventor Forum
You keep adding 3 numbers to the global numbers list each time the NextBtn button is clicked.
So you start with 3, then 6, then 9, etc.
At the start of the NextBtn.Clicked block you need to set numbers to empty list.
---
sf


Ghica

unread,
Oct 10, 2015, 4:42:02 PM10/10/15
to MIT App Inventor Forum
Please post your .aia, I will fix it then.
Cheers, Ghica.
Reply all
Reply to author
Forward
0 new messages