WGU E010 Objective Assessment Final Verified Exam
Questions And Answers Practice Questions with
Solutions Newest | Already Graded A+||Newest
Exam!!!
Task:
Create a solution that accepts an integer input
representing water temperature in degrees Fahrenheit.
Output a description of the water state based on the
following scale:
If the temperature is below 33° F, the water is "Frozen".
If the water is between 33° F and 80° F (including 33°), the
water is "Cold".
If the water is between 80° F and 115° F (including 80°),
the water is "Warm".
If the water is between 115° F and 211° F (including 115°) ,
the water is "Hot".
If the water is greater than or equal to 212° F, the water is
"Boiling".
Additionally, output a safety comment only during the
following circumstances:
If the water is exactly 212° F, the safety comment is,
"Caution: Hot!"
,2|Page
If the water temperature is less than 33° F, the safety
comment is, "Watch out for ice!" - Answer-print("Enter the
water temperature:")
temperature = int(input())
if temperature >= 212:
state="Boiling"
elif 115 <= temperature <= 211:
state="Hot"
elif 80 <= temperature < 115:
state="Warm"
elif 33 <= temperature < 80:
state="Cold"
else:
state="Frozen"
print(state)
if temperature >= 212:
print("Caution: Hot!")
elif temperature < 33:
print("Watch out for ice!")
,3|Page
Create a solution that accepts an integer input identifying
how many different shares of stock are purchased from
the Old Town Stock Exchange, followed by an equivalent
number of string inputs representing the stock selections.
The following dictionary, stock, lists available stock
selections as the key and the cost per selection as the
value.
stocks = {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26,
'SOFI': 6.92, 'KIRK': 8.72, 'AURA': 22.12, 'AMZN': 141.28,
'EMBK': 12.29, 'LVLU': 2.33}
Output the total cost of the purchased shares of stock to
two decimal places.
The solution output should be in the format:
Total price: $cost_of_stocks - Answer-stocks = {'TSLA':
912.86, 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92,
'KIRK': 8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK':
12.29, 'LVLU': 2.33}
total = 0
print("Enter a quantity of stocks followed by stock
symbol(s):")
num_items = int(input())
for i in range(num_items):
item = input()
, 4|Page
if item in stocks.keys():
total += stocks[item]
print(f'Total price: ${total:.2f}')
Create a solution that accepts a string input representing a
grocery store item and an integer input identifying the
number of items purchased on a recent visit. The following
dictionary purchase lists available items as the key and
the cost per item as the value.
purchase = {"bananas": 1.85, "steak": 19.99, "cookies":
4.52, "celery": 2.81, "milk": 4.34}
Additionally,
If fewer than 10 items are purchased, the price is the full
cost per item.
If between 10 and 20 items (inclusive) are purchased, the
purchase gets a 5% discount.
If 21 or more items are purchased, the purchase gets a
10% discount.
Output the chosen item and the total purchase cost to two
decimal places.
The solution output should be in the format: