Scenario Instructions
You are an Integrative Animal Biology major who is working in a lab where you have to process all of the materials that we have received.
Decode a UPC code from a large animal sling and print its various parts. A UPC code consists of a 1-digit number, a 5-digit manufacturer’s code, a 5-digit product code, and a single check digit.
Part 1:
Your assignment is to take a UPC code, divide it up into its four parts, then print them out in separate fields on a single line.
Use this UPC code:
(020357122682)
Note: the program has to work for ANY UPC code in this format
Part 2:
Assume that this item costs $275.15. I would like to buy 12 of them. On a single line print out quantity to purchase, unit cost, and total cost (7 digits, 2 digits of precision, with commas separating thousands)
Sample solution
Dante Alighieri played a critical role in the literature world through his poem Divine Comedy that was written in the 14th century. The poem contains Inferno, Purgatorio, and Paradiso. The Inferno is a description of the nine circles of torment that are found on the earth. It depicts the realms of the people that have gone against the spiritual values and who, instead, have chosen bestial appetite, violence, or fraud and malice. The nine circles of hell are limbo, lust, gluttony, greed and wrath. Others are heresy, violence, fraud, and treachery. The purpose of this paper is to examine the Dante’s Inferno in the perspective of its portrayal of God’s image and the justification of hell.
In this epic poem, God is portrayed as a super being guilty of multiple weaknesses including being egotistic, unjust, and hypocritical. Dante, in this poem, depicts God as being more human than divine by challenging God’s omnipotence. Additionally, the manner in which Dante describes Hell is in full contradiction to the morals of God as written in the Bible. When god arranges Hell to flatter Himself, He commits egotism, a sin that is common among human beings (Cheney, 2016). The weakness is depicted in Limbo and on the Gate of Hell where, for instance, God sends those who do not worship Him to Hell. This implies that failure to worship Him is a sin.
God is also depicted as lacking justice in His actions thus removing the godly image. The injustice is portrayed by the manner in which the sodomites and opportunists are treated. The opportunists are subjected to banner chasing in their lives after death followed by being stung by insects and maggots. They are known to having done neither good nor bad during their lifetimes and, therefore, justice could have demanded that they be granted a neutral punishment having lived a neutral life. The sodomites are also punished unfairly by God when Brunetto Lattini is condemned to hell despite being a good leader (Babor, T. F., McGovern, T., & Robaina, K. (2017). While he commited sodomy, God chooses to ignore all the other good deeds that Brunetto did.
Finally, God is also portrayed as being hypocritical in His actions, a sin that further diminishes His godliness and makes Him more human. A case in point is when God condemns the sin of egotism and goes ahead to commit it repeatedly. Proverbs 29:23 states that “arrogance will bring your downfall, but if you are humble, you will be respected.” When Slattery condemns Dante’s human state as being weak, doubtful, and limited, he is proving God’s hypocrisy because He is also human (Verdicchio, 2015). The actions of God in Hell as portrayed by Dante are inconsistent with the Biblical literature. Both Dante and God are prone to making mistakes, something common among human beings thus making God more human.
To wrap it up, Dante portrays God is more human since He commits the same sins that humans commit: egotism, hypocrisy, and injustice. Hell is justified as being a destination for victims of the mistakes committed by God. The Hell is presented as being a totally different place as compared to what is written about it in the Bible. As a result, reading through the text gives an image of God who is prone to the very mistakes common to humans thus ripping Him off His lofty status of divine and, instead, making Him a mere human. Whether or not Dante did it intentionally is subject to debate but one thing is clear in the poem: the misconstrued notion of God is revealed to future generations.
References
Babor, T. F., McGovern, T., & Robaina, K. (2017). Dante’s inferno: Seven deadly sins in scientific publishing and how to avoid them. Addiction Science: A Guide for the Perplexed, 267.
Cheney, L. D. G. (2016). Illustrations for Dante’s Inferno: A Comparative Study of Sandro Botticelli, Giovanni Stradano, and Federico Zuccaro. Cultural and Religious Studies, 4(8), 487.
Verdicchio, M. (2015). Irony and Desire in Dante’s” Inferno” 27. Italica, 285-297.
Sample Answer
Sample Answer
Here’s a Python program that accomplishes both parts of your assignment. The code will take a given UPC code, split it into its components, and then calculate the total cost based on the specified quantity and unit price.
# Part 1: Decode UPC code
def decode_upc(upc_code):
# Split the UPC code into its respective parts
upc_parts = {
‘1-Digit Number’: upc_code[0],
‘Manufacturer Code’: upc_code[1:6],
‘Product Code’: upc_code[6:11],
‘Check Digit’: upc_code[11]
}
return upc_parts
# Part 2: Calculate costs
def calculate_cost(unit_cost, quantity):
total_cost = unit_cost * quantity
return total_cost
# Main program
def main():
upc_code = “020357122682”
# Decode UPC Code
upc_parts = decode_upc(upc_code)
# Print the decoded parts
print(f”1-Digit Number: {upc_parts[‘1-Digit Number’]}”)
print(f”Manufacturer Code: {upc_parts[‘Manufacturer Code’]}”)
print(f”Product Code: {upc_parts[‘Product Code’]}”)
print(f”Check Digit: {upc_parts[‘Check Digit’]}”)
# Cost calculation
unit_cost = 275.15
quantity = 12
total_cost = calculate_cost(unit_cost, quantity)
# Print out the purchase details
print(f”\nQuantity to Purchase: {quantity}, Unit Cost: ${unit_cost:,.2f}, Total Cost: ${total_cost:,.2f}”)
if __name__ == “__main__”:
main()
Explanation:
1. Part 1:
– The function decode_upc takes a UPC code as input, splits it into its respective components (1-digit number, manufacturer code, product code, and check digit), and returns a dictionary containing these parts.
– The main program prints each part of the UPC code.
2. Part 2:
– The function calculate_cost multiplies the unit cost by the quantity to get the total cost.
– The main program calculates the total cost based on a unit cost of $275.15 for 12 units and prints the quantity, unit cost (formatted to two decimal places), and total cost (also formatted with commas and two decimal places).
Output:
When you run this program, it will produce output like this:
1-Digit Number: 0
Manufacturer Code: 20357
Product Code: 12268
Check Digit: 2
Quantity to Purchase: 12, Unit Cost: $275.15, Total Cost: $3,301.80
This output clearly displays the decoded UPC code components and the financial details of the purchase. You can replace the upc_code variable with any valid UPC to test different codes.