Analyze the following code and fill in the output.   I got the answers wrong

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

Analyze the following code and fill in the output.  

I got the answers wrong

(name[0]
worked dhours
at dWage(name[0]
making round[dGPO,2]
(name[1]
worked dHours[name[1]]
at dWage[name[1]
making round[dGP1,2]
(name[2]
worked dHours[name[1]]
at dWage[name2]
making round(dGP2,2)
(name[3]
worked dHours[name[3]]
at dWage[name[3]
making round(dGP3,20
Transcribed Image Text:(name[0] worked dhours at dWage(name[0] making round[dGPO,2] (name[1] worked dHours[name[1]] at dWage[name[1] making round[dGP1,2] (name[2] worked dHours[name[1]] at dWage[name2] making round(dGP2,2) (name[3] worked dHours[name[3]] at dWage[name[3] making round(dGP3,20
++ Employee
name = ["Joe", "Janice","Ahmed", "Maria"]
create dictionaries for wages and hours
** Use variable names as keys
dWage = ("Joe":17.55, "Janice":12.35, "Ahmed" :22.95, "Maria":18.75)
dHours = {"Joe":40, "Janice":42, "Ahmed":37, "Maria": 45)
*+ Caluculate gross pay for each employee
if dHours (name [0]]>40:
AGPO = dWage (name [0]]*40 + 1.5 * dWage (name [0]]* dHours (name [0]]-40
List
else:
AGPO = dWage (name [0]]*dHourS (name (0]]
if dHours (name [1]]>40:
AGP1 = dwage (name [1]]*40 + 1.5 • dwage (name (1]]* dHours[name [1]]-40
else:
AGP1 = dwage (name [1]]*dHours (name (1]]
if dHours (name [2]]>40:
dGP2 = dWage (name [2]]*40 + 1.5 * dWage (name [2]]* dHours [name [2]]-40
else:
AGP2 = dWage (name [2]]*dHours (name (2]]
if dHours (name (3]]>40:
AGP3 = dwage (name [3]]*40 + 1.5 • dwage (name [3]]+ dHours [ name [3]1-40
else:
AGP3 = dwage (name [3]]*dHours (name (3]]
*# Display variable and results
print (name [0], "worked', dHours [name[0]], 'at', dlage [name [0]], 'making', round (dGPO, 2))
print (name[1],'worked', dHours [name [1]],'at', dwage [name [1]], 'making', round (dGP1, 2))
print (name [2], 'worked', dHours (name [2]], 'at', dWage (name [2]], 'making', round (dGP2, 2))
print (name [3], 'worked', dHours [name [3]], 'at', dnage [name [3]], 'making', round (dGP3,2))
Transcribed Image Text:++ Employee name = ["Joe", "Janice","Ahmed", "Maria"] create dictionaries for wages and hours ** Use variable names as keys dWage = ("Joe":17.55, "Janice":12.35, "Ahmed" :22.95, "Maria":18.75) dHours = {"Joe":40, "Janice":42, "Ahmed":37, "Maria": 45) *+ Caluculate gross pay for each employee if dHours (name [0]]>40: AGPO = dWage (name [0]]*40 + 1.5 * dWage (name [0]]* dHours (name [0]]-40 List else: AGPO = dWage (name [0]]*dHourS (name (0]] if dHours (name [1]]>40: AGP1 = dwage (name [1]]*40 + 1.5 • dwage (name (1]]* dHours[name [1]]-40 else: AGP1 = dwage (name [1]]*dHours (name (1]] if dHours (name [2]]>40: dGP2 = dWage (name [2]]*40 + 1.5 * dWage (name [2]]* dHours [name [2]]-40 else: AGP2 = dWage (name [2]]*dHours (name (2]] if dHours (name (3]]>40: AGP3 = dwage (name [3]]*40 + 1.5 • dwage (name [3]]+ dHours [ name [3]1-40 else: AGP3 = dwage (name [3]]*dHours (name (3]] *# Display variable and results print (name [0], "worked', dHours [name[0]], 'at', dlage [name [0]], 'making', round (dGPO, 2)) print (name[1],'worked', dHours [name [1]],'at', dwage [name [1]], 'making', round (dGP1, 2)) print (name [2], 'worked', dHours (name [2]], 'at', dWage (name [2]], 'making', round (dGP2, 2)) print (name [3], 'worked', dHours [name [3]], 'at', dnage [name [3]], 'making', round (dGP3,2))
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT