Question
In a seperate javascript file
This step in brewing beer is to extract sugars from grains by soaking the grains in hot wate a different wor 3. JavaSeript/DO
These screenshots show various states of the program being used: Mash-It! Mash-It Mash-It! Mash-It! Mat bitl Ibs Grain 8.5 Am
This step in brewing beer is to extract sugars from grains by soaking the grains in hot wate a different wor 3. JavaSeript/DOM Background: The first amount of sugar (the grain's yield) to the wort. Calculating the final amount of sugar in the wort is an imp ing a beer recipe, since the sugars will later ferment into alcohol. To measure the amount of sugar in designi step is called mashing, and the resulting sugar-water is called wort. Each variety of grain contributes we use specific gravity (SG), a decimal number (e.g., 1.054) which represents the ratio of the sugar-waters denso that of pure water (1.000 SG). Specific gravity measurements during the brewing process about 1.010 and 1.100. are typically between estimates the specific gravity of Your job is to write the JavaScript code to add behavior to the following page, which a list of user-entered grains: HTML: Mash-It! Mash-It! Male bill crieldset> clegendMalt billie/legend PPG Tbs Grain 8.5 American 2-Row Pale 38 32 5 Cara-Pils/Dextrene cbutton id-"add gzain" >Add another qrainc/button> Estimated Specific Gravit span id-specific qrvity your、calculated SG. goes hero--> /spanxbr/> Cspan class-"note"> (assumes a 5.5 gallon batch) The page consists of a table in which the user can enter grains. Every time the Add another grain button is clicked, a new row should be added at the bottom of the table. Each row consists of three text-entry fields, each in its own table cell, for entering the following values: an amount (in pounds), a name, and a sugar yield (in "PPG"). These entry fields should have the classes amount, name, and yield respectively. When the Calculate SG button is pressed, your code should estimate the specific gravity of the user-entered grains by performing the following calculation SG round(las + aya 5.5)/1000 +1 (Where a and yi represent the amount and yield of the first grain, and so on.) In other words, for each grain in the list, multiply its amount (the number in the "lbs" column) by its yield (the number in the "PPG" column), and take the sum of these products. Then divide that by 5.5 (which represents the volume of water it's dissolved in, in gallons). Round the result to the nearest integer, then to express it as a number 1 followed by 3 decimal places (e.g., 1.054), divide by 1000 and add 1 For example, using the values in the above screenshot, your calculation would be as follows: .5.34]/ 5.5) /1000+1-1.068 SGan round(8.5.38 +5.32 + .5.34 You should assume all input to text boxes is valid; that is, reasonable values will always be entered in the fields for amount and yield. You may assume the Prototype JavaScript library is loaded prior to your script being loaded. When injecting content into the page, you may use the innerHTML property for injecting plain text only; you may not use it to inject any HTML code
These screenshots show various states of the program being used: Mash-It! Mash-It Mash-It! Mash-It! Mat bitl Ibs Grain 8.5 American 2-Row Pale 5 Cara-Pils/Dextrine 38 8.5 American 2-Row Pale 8.5 American 2-Row Pale 32 Add another grain Cakculate SG Add another grain Calculace S Add another grain Calculate s Calculate SG Add another grain Estimated Spectc Cravity Estemaied Specihic Cravity Estimated Specihc Grawity 1062 Estimeed Specific Cravity After another grain has been entered, and Calculate SG has beer clicked Initial state After Add another grain has been clicked After the first grain has been entered Write your solution below)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

HTML File chtml> chead> title> Mash-It!</title> </head <script> var GrainCount=1; function add_Graino GrainCount++; var Row dcol1.appendChildfield1); col2 appendChildfield2) col3.appendChildfield3); Row.appendChild col1) Row.appendChild col2) Row.app<table id-malt_bll str eth lbsc/th cth>Grain</th xth>PPG</th></tr> strs <tdxinput id amount_1 type text class-amount/OutPut Initial State: Mash-It Malt bill lbs Grain PPG Add another grain Calulate SG Estimated Specific Gravity assumes a 5.5After Add another grain has been clicked Mash-It Malt bill Grain lbs PPG 85 American 2-Row Pale 38 Add another grain Calulate

Add a comment
Know the answer?
Add Answer to:
In a seperate javascript file This step in brewing beer is to extract sugars from grains by soaking the grains in hot wate a different wor 3. JavaSeript/DOM Background: The first amount of sugar...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT