Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could someone please look at my code and help me to figure out why it is not pri

ID: 3702783 • Letter: C

Question

Could someone please look at my code and help me to figure out why it is not printing?

<title>JSON Payroll</title>
</head>
<body>
<h1>Payroll Data</h1>
<div id="JPayroll">Here is where you will find the information for each employee!</div>
<script>
var empInfo={"employees":[
            {
           "name": "Deanna Medeiros",
           "pay": "50.00ph",
           "job": "Programmer",
           "medical": "United HealthCare",
           "deducmed": "200.00",
           "deduc401k": "300.00",
           "deducstock": "400.00",
           "personalEmail": "deannamedeiros72@.com",
           "workEmail": "dmedeiros@aaanortheast.com"
           },
           {
           "name": "Ron Rogers",
           "pay": "$35.00ph",
            "job": "HVAC",
            "medical": "Blue cross & Blue Shield",
           "deduc1med": "150.00",
           "deduc401k": "200.00",
           "deducstock": "50.00",
           "personalEmail": "rrogers@.com",
           "workEmail": "rrogers@rge.com"
           }
          
]}
document.getElementById("JPayroll").innerHTML=empInfo.employees[0].name + " currently makes " + empInfo.employees[0].pay + " as a " +
empInfo.employees[0].job + " Current medical is " + empInfo.employees[0].medical + " The first deduction is " + empInfo.employees[0].deducmed +
" second deductions is " + empInfo.employees[0].deduc401k + " third deduction is " + empInfo.employees[0].deducstock. + " Personal email is:" + empInfo.employees[0].personalEmail
+ " Work email is: " + empInfo.employees[0].workEmail + " and " empInfo.employees[1].name + " currently makes " + empInfo.employees[1].pay + " as a " +
empInfo.employees[1].job + " Current medical is " + empInfo.employees[1].medical + " The first deduction is " + empInfo.employees[1].deducmed +
" second deductions is " + empInfo.employees[1].deduc401k + " third deduction is " + empInfo.employees[1].deducstock. + " Personal email is:" + empInfo.employees[1].personalEmail
+ " Work email is: " + empInfo.employees[1].workEmail;

</script>
</body>
</html>

Explanation / Answer

Hi

I have fixed the issues and highlighted the changes below.

<title>JSON Payroll</title>
</head>
<body>
<h1>Payroll Data</h1>
<div id="JPayroll">Here is where you will find the information for each employee!</div>
<script>
var empInfo={"employees":[
{
"name": "Deanna Medeiros",
"pay": "50.00ph",
"job": "Programmer",
"medical": "United HealthCare",
"deducmed": "200.00",
"deduc401k": "300.00",
"deducstock": "400.00",
"personalEmail": "deannamedeiros72@.com",
"workEmail": "dmedeiros@aaanortheast.com"
},
{
"name": "Ron Rogers",
"pay": "$35.00ph",
"job": "HVAC",
"medical": "Blue cross & Blue Shield",
"deduc1med": "150.00",
"deduc401k": "200.00",
"deducstock": "50.00",
"personalEmail": "rrogers@.com",
"workEmail": "rrogers@rge.com"
}
  
]}
document.getElementById("JPayroll").innerHTML=empInfo.employees[0].name + " currently makes " + empInfo.employees[0].pay + " as a " +
empInfo.employees[0].job + " Current medical is " + empInfo.employees[0].medical + " The first deduction is " + empInfo.employees[0].deducmed +
" second deductions is " + empInfo.employees[0].deduc401k + " third deduction is " + empInfo.employees[0].deducstock + " Personal email is:" + empInfo.employees[0].personalEmail
+ " Work email is: " + empInfo.employees[0].workEmail + " and "+ empInfo.employees[1].name + " currently makes " + empInfo.employees[1].pay + " as a " +
empInfo.employees[1].job + " Current medical is " + empInfo.employees[1].medical + " The first deduction is " + empInfo.employees[1].deducmed +
" second deductions is " + empInfo.employees[1].deduc401k + " third deduction is " + empInfo.employees[1].deducstock + " Personal email is:" + empInfo.employees[1].personalEmail
+ " Work email is: " + empInfo.employees[1].workEmail;

</script>
</body>
</html>

Output:

Payroll Data

Deanna Medeiros currently makes 50.00ph as a Programmer Current medical is United HealthCare The first deduction is 200.00 second deductions is 300.00 third deduction is 400.00 Personal email is:deannamedeiros72@.com Work email is: dmedeiros@aaanortheast.com and Ron Rogers currently makes $35.00ph as a HVAC Current medical is Blue cross & Blue Shield The first deduction is undefined second deductions is 200.00 third deduction is 50.00 Personal email is:rrogers@.com Work email is: rrogers@rge.com

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote