Subversion Repositories wimsdev

Rev

Rev 4135 | Rev 5724 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
type=first
2
textarea="explain"
3
random="x y"
4
computed="ans"
5
 
4135 bpr 6
:A numerical exercise with two random parameters.
23 reyssat 7
 
8
The numeric reply is computed with respect to random values of two parameters,
9
according to various formulas.
10
<p>
11
Author of the model: Gang Xiao <xiao@unice.fr>
12
 
13
:%%%%%%%%%%%%%%%%%      ATTENTION      %%%%%%%%%%%%%%%%%%%%
14
 
4135 bpr 15
Remove the above header if you destroy the model tags i.e. the lines starting
16
with a ':'. Otherwise the exercise might not be recognised by Createxo.
23 reyssat 17
 
18
:%%%%%%%% Example parameters to be redefined %%%%%%%%%%%%%%%%%
19
 
20
:\title{Two parameters}
5147 bpr 21
:\author{XIAO, Gang}
23 reyssat 22
:\email{xiao@unice.fr}
23
 
24
:First parameter \x.
25
\real{x=randint(5..20)*20}
26
 
27
:Second parameter \y.
28
\real{y=randitem(20,25,30,35,40,60)}
29
 
4135 bpr 30
:The computed right answer.
23 reyssat 31
All common functions are recognized. We use \x and \y to
32
designate the random parameters defined above.
33
\real{ans=\x*(100-\y)/100}
34
 
35
:Text that explains what should be done.
36
$embraced_randitem
37
\text{explain=
4135 bpr 38
A fashion article in a clothes shop costs \x dollars. During a
39
sales period, the shop offers a reduction of \y percent on the article.
40
What is the reduced price (in dollars)?
23 reyssat 41
}
42
 
43
:%% Computations; do not modify
44
\text{explain=wims(embraced randitem \explain)}
45
 
46
:%%%%%%%%%%%%% Now the statement in html. %%%%%%%%%%%%%%%%%%%%
47
 
48
::You don't need to modify this in general.
49
 
50
\statement{\explain
51
}
52
 
53
:%%%%%%%%%%%%% Nothing to modify after. %%%%%%%%%%%%%%%%%5
54
 
55
\answer{My reply}{\ans}{type=number}
56