100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

WGU D335 Introduction to Programming in Python

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
05-07-2025
Written in
2024/2025

WGU D335 Introduction to Programming in Python Questions With Verified AnswersWGU D335 Introduction to Programming in Python Questions With Verified AnswersWGU D335 Introduction to Programming in Python Questions With Verified AnswersWGU D335 Introduction to Programming in Python Questions With Verified AnswersWGU D335 Introduction to Programming in Python Questions With Verified Answers

Show more Read less
Institution
WGU D335
Course
WGU D335









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
WGU D335
Course
WGU D335

Document information

Uploaded on
July 5, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

WGU D335 Introduction to Programming
in Python Questions With Verified
Answers


CreateBaBsolutionBthatBacceptsBthreeBintegerBinputsBrepresentingBtheBnumberBofBtimesBanBemployee
BtravelsBtoBaBjobBsite.BOutputB theBtotalBdistanceB traveledBtoBtwoBdecimalBplacesBgivenBtheBfollowing
BmilesBperBemployeeBcommuteBtoBtheBjobBsite.BOutputBtheBtotalBdistanceBtraveledBtoBtwoBdecimalBp
lacesBgivenBtheBfollowingBmilesBperBemployeeBcommuteBtoBtheBjobBsite:

EmployeeBA:B15.62Bmiles

EmployeeBB:B41.85Bmiles

EmployeeBC:B32.67Bmiles

TheBsolutionBoutputBshouldBbeBinBtheBformat

Distance:Btotal_miles_traveledBmilesB-BAnswerB-BtravelsB=B{

"A":Bint(input()),

"B":Bint(input()),

"C":Bint(input())

}

miles_per_employeeB=B{"A":B15.62,B"B":41.85,B"C":B32.67}

total_miles_traveledB=Bsum(travels[employee]B*Bmiles_per_employee[employee]BforBemployeeBinBtra
vels)

print(f"Distance:B{total_miles_traveled:.2f}Bmiles")



CreateBaBsolutionBthatBacceptsBanBintegerBinputBrepresentingBanyBnumberBofBounces.BOutputBtheBco
nvertedBtotalBnumberBofBtons,Bpounds,BandBremainingBouncesBbasedBonBtheBinputBouncesBvalue.BTh
ereBareB16BouncesBinBaBpoundBandB2,000BpoundsBinBaBton.

TheBsolutionBoutputBshouldBbeBinBtheBformat

Tons:Bvalue_1BPounds:Bvalue_2BOunces:Bvalue_3B-BAnswerB-BouncesB=Bint(input())

value_1B=BouncesB//B(16B*B2000)

, value_2B=B(ouncesB%B(16B*B2000))B//B16

value_3B=BouncesB%B16

print(f"Tons:B{value_1}")

print(f"Pounds:B{value_2}")

print(f"Ounces:B{value_3}")



CreateBaBsolutionBthatBacceptsBanBintegerBinputBrepresentingBtheBindexBvalueBforBanyBanyBofBtheBfiv
eBelementsBinBtheBfollowingBlist:

various_data_typesB=B[516,B112.49,BTrue,B"meow",B("Western",B"Governors",B"University"),B{"apple":B
1,B"pear":B5}]

UsingBtheBbuilt-
inBfunctionBtype()BandBgettingBitsBnameBbyBusingBtheB.nameBattribute,BoutputBdataBtypeB(e.g.,Bint",B"
float",B"bool",B"str")BbasedBonBtheBinputBindexBvalueBofBtheBlistBelement.

TheBsolutionBoutputBshouldBbeBinBtheBformat

ElementBindex_value:Bdata_typeB-BAnswerB-Bindex_valueB=Bint(input())

data_typeB=Btype(various_data_types[index_value]).__name__

print(f"ElementB{index_value}:B{data_type}")



CreateBaBsolutionBthatBacceptsBanyBthreeBintegerBinputsBrepresentingBtheBbaseB(b1,Bb2)BandBheightB(
h)BmeasurementsBofBaBtrapezoidBinBmeters.BOutputBtheBexactBareaBofBtheBtrapezoidBinBsquareBmete
rsBasBaBfloatBvalue.BTheBexactBareaBofBaBtrapezoidBcanBbeBcalculatedBbyBfindingBtheBaverageBofBtheBt
woBbaseBmeasurements,BthenBmultiplyingBbyBtheBheightBmeasurement.

TrapezoidBAreaBFormula:AB=B[(b1B+Bb2)B/B2]B*Bh

TheBsolutionBoutputBshouldBbeBinBtheBformat

TrapezoidBarea:Barea_valueBsquareBmetersB-BAnswerB-Bb1B=Bint(input())

b2B=Bint(input())

hB=Bint(input())

area_valueB=Bfloat((b1B+Bb2)B/2)B*Bh

print(f"TrapezoidBarea:B{area_value}BsquareBmeters")



CreateBaBsolutionBthatBacceptsBfiveBintegerBinputs.BOutputBtheBsumBofBtheBfiveBinputsBthreeBtimes,Bc
onvertingBtheBinputsBtoBtheBrequestedBdataBtypeBpriorBtoBfindingBtheBsum.
$12.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
SolutionA

Get to know the seller

Seller avatar
SolutionA Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
7
Member since
8 months
Number of followers
0
Documents
1339
Last sold
3 weeks ago
SOLUTION A STUDY GUIDES

Many students don\'t have the time to work on their academic papers due to balancing with other responsibilities, for example, part-time work. I can relate. kindly don\'t hesitate to contact me, my study guides, notes and exams or test banks, are 100% graded SUCCESS IN YOUR STUDIES.......WELCOME ALL....

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions