Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Problem2
- ERROR caught by Translator while processing problem file:JoshAstroProblems/Chapter00/Problem02.pg
- ****************
- Missing operand after '*'; see position 5 of formula at line 92 of (eval 3057)
- Died within main::Formula called at line 92 of (eval 3057)
- from within main::Compute called at line 43 of (eval 2909)
- ****************
- ------Input Read
- 1 # DESCRIPTION
- 2 # Problem 2 from the Problem section
- 3 # of Astronomy: A Beginner's Guide to the
- 4 # Universe 6th Edition
- 5 # WeBWorK problem written by Joshua Bronston,
- 6 # <jbronston(at)navajotech(dot)edu>
- 7 # ENDDESCRIPTION
- 8
- 9 ## DBsubject('Astronomy')
- 10 ## DBchapter('Chapter 0')
- 11 ## DBsection('Problems')
- 12 ## KEYWORDS('')
- 13 ## TitleText1('')
- 14 ## EditionText1('')
- 15 ## AuthorText1('')
- 16 ## Section1('')
- 17 ## Problem1('')
- 18 ## Author('Joshua Bronston')
- 19 ## Institution('Navajo Technical College')
- 20
- 21 DOCUMENT();
- 22 loadMacros(
- 23 "PGstandard.pl",
- 24 "MathObjects.pl",
- 25 "PGcourse.pl",
- 26 );
- 27
- 28 # make sure we're in the context we want
- 29 Context("Numeric");
- 30
- 31 @distance1 = (57.9,108.2,149.6,227.9,778.4,1427,2871,4498);
- 32 @distance3 = (57.9*(10**6),108.2*(10**6),149.6*(10**6),
- 33 227.9*(10**6),778.4*(10**6),1427*(10**6),2871*(10**6),4498*(10**6));
- 34 @planet1 = ("Mercury","Venus","Earth",
- 35 "Mars","Jupiter","Saturn","Uranus","Neptune");
- 36 @year1 = (.241,.612,1,1.88,11.86,29.42,83.75,163.7);
- 37 $num = random(0,8,1);
- 38
- 39 $distance2 = $distance3[$num];
- 40 $planet2 = $planet1[$num];
- 41 $year2 = $year1[$num];
- 42
- 43 $circum = Compute("pi*2*$distance2");
- 44 $day = $circum / ($year2 * 365);
- 45 $hour = $day/24;
- 46 $second = $hour/3600;
- 47
- 48 Context()->texStrings;
- 49
- 50 TEXT(beginproblem());
- 51 Context()->texStrings;
- 52 BEGIN_TEXT
- 53 Given that the distance from \($planet2\) to the Sun is \($distance1[$num]\)x\(10^6\) km, through
- 54 what distance does \($planet2\) move in a second? An hour? A day? $BR (HINT: Use Table 3A in Appendix 3 in your book. 1 Tropical Year = 1 Earth Year.)
- 55 $PAR
- 56 distance traveled in a second = \{ ans_rule(4) \} km
- 57 $PAR
- 58 distance traveled in an hour = \{ ans_rule(4) \} km
- 59 $PAR
- 60 distance traveled in a day = \{ ans_rule(4) \} km
- 61 END_TEXT
- 62 Context("Numeric");
- 63
- 64 ANS( $second->cmp());
- 65 ANS( $hour->cmp());
- 66 ANS( $day->cmp());
- 67
- 68 Context()->texStrings;
- 69 SOLUTION(EV3(<<'END_SOLUTION'));
- 70 $PAR SOLUTION $PAR
- 71
- 72 END_SOLUTION
- 73 Context()->normalStrings;
- 74
- 75 ENDDOCUMENT();
- -----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement