## Forum archive 2000-2006

### Michael Gage - Java applet example

by Arnold Pizer -
Number of replies: 0
 Java applet example topic started 5/9/2000; 4:06:45 PMlast post 5/9/2000; 4:06:45 PM
Michael Gage - Java applet example
5/9/2000; 4:06:45 PM (reads: 2402, responses: 0)

## The Java applet example

To obtain this problem
(1 pt)
###### mathbean applet from David Ecks

The graph above represents the function

 f(x) = x2 + a x +b
where a and b are parameters.

For each value of a find the value of b which makes the graph just touch the x-axis.
if a= 0.5 then
if a= 2.5 then
if a= 0 then

Does this relationship between a and b specify b as a function of a? (Yes or No)
Does this relationship between a and b specify a as a function of b? (Yes or No)
Write a formula for calculating this value of b from a .
b =

Enter this code

DOCUMENT();

PGbasicmacros.pl,
PGchoicemacros.pl,
);
TEXT(beginproblem());
$javaApplet = <<EOF; < applet code="mathbeans.SliderGraphApplet.class" archive="/applets/mathbeans.jar" codebase="../classes/" width=480 height=380> < PARAM NAME="variable1" VALUE="a"> < PARAM NAME="variable2" VALUE="b"> < param name="function" value="x^2 +a*x +b"> < param name="limits" value="-2 2 -9 9"> </applet> < H6><A HREF="http://math.hws.edu/mathbeans/applets/index.html">mathbean applet from David Ecks </A> </H6> EOF TEXT(MODES( TeX => " \fbox{ The java applet was displayed here}", Latex2HTML => "\begin{rawhtml}$javaApplet \end{rawhtml}",
HTML_tth => $javaApplet, HTML =>$javaApplet,
));

$a1= random(-3,3,.5);$a2= random(-3,3,.5);
$a3= random(-3,3,.5);$b1 =($a1/2)**2; ANS( num_cmp($b1, reltol => 10, format=>'%0.2g'));
ANS( num_cmp( $b2,reltol => 10, format=>'%0.2g')); ANS( num_cmp($b3, reltol => 10,format=>'%0.2g'));
BEGIN_TEXT
$PAR The graph above represents the function $f(x) = x^2 + a x +b$ where $$a$$ and $$b$$ are parameters.$PAR

For each value of $$a$$ find the value of $$b$$ which makes the
graph just touch the x-axis. $BR if a=$a1 then \{ ans_rule(10) \}$BR if a=$a2 then \{ ans_rule(10) \}$BR if a=$a3 then \{ ans_rule(10) \}
$PAR Does this relationship between a and b specify b as a function of a? \{ ans_rule(4) \} (Yes or No)$BR
Does this relationship between a and b specify a as a function of b? \{
ans_rule(4) \} (Yes or No)$BR Write a formula for calculating this value of $$b$$ from $$a$$.$BR b
= \{ ans_rule(40) \}
END_TEXT
ANS(str_cmp('Yes') ); ANS(str_cmp('No') );
ANS(function_cmp( '(a/2)^2', 'a') );
ENDDOCUMENT();