Advertisement
Guest User

WebworkProblemNTC

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