Author Topic: Long division applet (for primary school level)  (Read 41871 times)

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Long division applet (for primary school level)
« Reply #15 on: April 01, 2009, 08:08:53 pm »
Things can be done in many different ways. Sometime, there is no right way or wrong way. But there are many ways due to different situation.

What I need to know is : What is the requirement:
Do you want:
 tv[0]=1000;
 tv[1]=230;
 tv[2]=200;
 tv[3]=34;
 tv[4]=30;
 tv[5]=4;
or
 tv[0]=10;
 tv[1]=230;
 tv[2]=20;
 tv[3]=34;
 tv[4]=30;
 tv[5]=4;


What if there are more numbers, like 123456
Does the teachers always want to bring down all the numbers?

Please ask the teacher to explain it in all details?
Different requirements may need to be programmed different way. (Login might be different).
Sometime, it is difficult to modify the code if an extra requirement is not fit with the situation.
That is also the reason why I always ask you for alll detail for your requirement before I created simulations for you (or other users).

It does not matter what the teacher want. The important thing is write download all the detail specifications.
It is better if the teacher who need the simulation can draw some diagram/plot to explain what s/he really want,
and it will be even better if s/he can provide the reason. (May be we can find out a better solution).

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Long division applet (for primary school level)
« Reply #16 on: April 01, 2009, 08:46:55 pm »
Things can be done in many different ways. Sometime, there is no right way or wrong way. But there are many ways due to different situation.
agreed :D

What I need to know is : What is the requirement:
Do you want:
 tv[0]=1000;
 tv[1]=230;  234 actually
 tv[2]=200;
 tv[3]=34;
 tv[4]=30;
 tv[5]=4;
or
 tv[0]=10;
 tv[1]=230;
 tv[2]=20;
 tv[3]=34;
 tv[4]=30;
 tv[5]=4;
the requirement is
tv[0]=1000; // correct is graphically is a 1000(divide) + 234(conquer) = 1234
 tv[1]=234; // so yes, the teacher always want to bring down all numbers, part of his divide and conquer idea, graphically 234
 tv[2]=200; //  correct 200(divide) +34(conquer) =234
 tv[3]=34; // so yes, the teacher always want to bring down all numbers, part of his divide and conquer idea, graphically 34
 tv[4]=30; // correct 30(divide) +4(conquer) =34
 tv[5]=4; // 4 remainder end.
[/quote]

What if there are more numbers, like 123456
Does the teachers always want to bring down all the numbers?
yes :D

Please ask the teacher to explain it in all details?
Different requirements may need to be programmed different way. (Login might be different).
Sometime, it is difficult to modify the code if an extra requirement is not fit with the situation.
That is also the reason why I always ask you for alll detail for your requirement before I created simulations for you (or other users).

It does not matter what the teacher want. The important thing is write download all the detail specifications.
It is better if the teacher who need the simulation can draw some diagram/plot to explain what s/he really want,
and it will be even better if s/he can provide the reason. (May be we can find out a better solution).


i  have given him the link at the beginning of the collaboration, i will ask him to register n discuss together.  ;)

honestly, your applet is very good, i managed to add the scaffold the way u n me think alike already.

Thanks for your help! This forum is a Gold mine of knowledge :)

By the way, i was tinkering with the codes again, i noticed may need more effort than just changing the numbers in the codes.
sorry to cause trouble again.
« Last Edit: April 01, 2009, 08:54:28 pm by lookang »

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Long division applet (for primary school level)
« Reply #17 on: April 01, 2009, 10:37:21 pm »
Let me make sure again:
Is the following what you/teacher want (number are misaligned):

  __63682_
  2 ) 127364
  120000
  --------
  7364
  6000
  -------
  1364
  1200
  -------
  164
  160
  ----
  4
  4
  ---
  0 


lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Long division applet (for primary school level)
« Reply #18 on: April 01, 2009, 11:48:27 pm »
yup. agreed

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Long division applet (for primary school level)
« Reply #19 on: April 02, 2009, 12:43:59 am »
I hope the following is what you want.

I add a setnmode() custom function to add those numbers (you want) at the end of the string.

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Long division applet (for primary school level)
« Reply #20 on: April 02, 2009, 01:10:43 pm »
nice! it is what i thought it will do.

i will examine closely the new users_ntnu_fkh_division2.xml to port the new display into the file that i have being modifying from users_ntnu_fkh_division.xml.


I intend to create a checkbox to allow toggling from the usual way to this users_ntnu_fkh_division2.xml way of looking at division.

will report here any findings here later.

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Long division applet (for primary school level)
« Reply #21 on: April 02, 2009, 03:40:38 pm »
The checkbox is there already. click inside the simulation region. Hit h and the tool bar will appear.
You will find nmode checkbox in the toolbar.
It can be set with javascript, too!

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Long division applet (for primary school level)
« Reply #22 on: April 06, 2009, 11:13:39 am »
This is the legally remixed applet.
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1036msg3842;topicseen#msg3842


I notice when the applet is downloaded and used as a standalone in the full screen view
the mask that covers the top answer is control by

maskrx=(x1+size+(n3-n2+step+2)*w*0.8); // by trial and error the position of mask

the text i2+"" is control by Pos X = x1+size+w*xshift

Is there a way to cleverly detect the width of the applet, and then calculated the amount to shift for each step of the answer?

currently the mask work well in current size of "750,600"

In full screen the mask move too much, but in current size of "750,600" the mask is nice and work well.

« Last Edit: April 06, 2009, 11:17:10 am by lookang »

Fu-Kwun Hwang

  • Administrator
  • Hero Member
  • *****
  • Posts: 3062
    • Enjoy the fun of physics with simulations
Re: Long division applet (for primary school level)
« Reply #23 on: April 06, 2009, 11:50:10 am »
The trial and error value you got is good for special window size (it will be different for 1024x768 and 800x600).
You should use the following function to get width and height of the EJS window frame and calculate suitable values for your program.

_view.drawingFrame.getWidth();
_view.drawingFrame.getHeight();

where drawingFrame is the name of your top level frame (It might be different if you changed the name when you created the view.)

lookang

  • Hero Member
  • *****
  • Posts: 1772
  • http://weelookang.blogspot.com
    • lookang web
Re: Long division applet (for primary school level)
« Reply #24 on: April 06, 2009, 08:44:04 pm »
i added
description is the XML
added description in my XML
Original works byFu-Kwun Hwang
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1039

Derived work Remix (finer customisation) legally by lookang under
This work is licensed under a Creative Commons Attribution 2.5 Taiwan License

http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1036msg3842;topicseen#msg3842
to trace its development.

By the way, Your tip is fantastic!

i managed to make it work well even in full screen due to a modifcation.

added codes

Added variables
getwidth = double
Fixed relationship
getwidth = _view.centre.getWidth(); // centre is name of view
maskrx=x1+size+(n3-n2+step+2)*w*0.82*750/getwidth;