• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

Wgu D335 Practice Test 2 With Complete Solutions.

Document preview thumbnail
Preview 2 out of 12 pages

WGU D335 PRACTICE TEST 2 WITH COMPLETE SOLUTIONS.

Content preview

WGU D335 PRACTICETEST 2WITHCOMPLETESOLUTIONS
v v v v v v v




1. CreateBGaBGsolutionBGthatBGacceptsBGthreeBGintegerBGinputsBGrepresentingBGthe
v v v v v v v v v




BGnumber BGof BGtimes BGan BGemployee BGtravels BGto BGa BGjob BGsite. BGOutput BGthe
v v v v v v v v v v v v




BGtotal BGdistance BGtraveled BGto BGtwo BGdecimal BGplacesBGgiven BGtheBGfollowing
v v v v v v v v v v




BGmiles BGper BGemployee BGcommute BGto BGthe BGjob BGsite. BGOutput BGthe BGtotal
v v v v v v v v v v v




BGdistance BGtraveled BGto BGtwo BGdecimal BGplaces BGgiven BGthe BGfollowing
v v v v v v v v v




BGmiles BGper BGemployee BGcommute BGto BGthe BGjob BGsite:
v v v v v v v v




EmployeeBGA:BG15.62 v v




BGmiles BGEmployee BGB:
v v v




BG41.85 BGmiles
v v




Employee BGC:BG32.67 BGmiles:BGtimes_traveledA BG= BGint(input())
v v v v v v




BGtimes_traveledB BG= BGint(input())
v v v




times_traveledCBG=BGint(input()) v v




BGemployeeA BG= BG15.62 BG#miles
v v v v




BGemployeeB BG= BG41.85 BG#miles
v v v v




BGemployeeC BG= BG32.67 BG#miles
v v v v




distance_traveledA BG= BGtimes_traveledA BG* v v v




BGemployeeA
v BGdistance_traveledB BG= v v




BGtimes_traveledB
v BG* BGemployeeB v v




BGdistance_traveledC
v BG= BGtimes_traveledC BG* v v v




BGemployeeC
v




total_miles_traveled BG= BGdistance_traveledA BG+ BGdistance_traveledB BG+ v v v v v




BGdistance_trav- BGeledC
v v




print('Distance:BG{:.2f} BGmiles'.format(total_miles_traveled))
v v




1
BG/
v



BG12
v

, 2. CreateBGaBGsolutionBGthatBGacceptsBGanBGinputBGidentifyingBGtheBGnameBGofBGa
v v v v v v v v v v v




BGtextBGfile,BGfor BGexample,BG"WordTextFile1.txt".BGEachBGtextBGfileBGcontains
v v v v v v v v v




BGthreeBGrowsBGwithBGoneBGword BGper BGrow. BGUsing BGthe BGopen() BGfunction
v v v v v v v v v v v




BGand BGwrite() BGand BGread() BGmethods, BGinteract BGwith BGthe BGinput BGtext BGfile
v v v v v v v v v v v




BGto BGwrite BGa BGnew BGsentence BGstring BGcomposed BGof BGthe BGthree BGexisting
v v v v v v v v v v v




BGwords BGto BGthe BGend BGof BGthe BGfile BGcontents BGon BGa BGnew BGline. BGOutput
v v v v v v v v v v v v v




BGthe BGnew BGfile BGcontents.: BGfile_name BG= BGinput()
v v v v v v v




with BGopen(file_name, BG'r') BGas BGf:
v v v v




word1 BG= v




BGstr(f.readline()).strip()
v




BGword2 v BG= v




BGstr(f.readline()).strip()
v




BGword3 v BG= v




BGstr(f.readline()).strip()
v




f BG= BGopen(file_name, BG'r')
v v v




BGlinesBG=
v v




BGf.read().splitlines() BGlines
v v




BG= BG' BG'.join(lines)
v v v




BGf.close()
v




print(f'{word1}\n{word2}\n{word3}\n{lines}')
3. Create BGa BGsolution BGthat BGaccepts BGan BGinteger BGinput BGrepresenting BGany
v v v v v v v v v




BGnumber BGof BGounces. BGOutput BGthe BGconverted BGtotal BGnumber BGof BGtons,
v v v v v v v v v v




BGpounds, BGand BGremaining BGounces BGbased BGon BGthe BGinput BGounces BGvalue.
v v v v v v v v v v




BGThere BGare BG16 BGounces BGin BGa BGpound BGand BG2,000 BGpounds BGin BGa BGton.:
v v v v v v v v v v v v v




BGounces_per_pound BG= BG16
v v v




2
BG/
v



BG12
v

Document information

Uploaded on
December 23, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Smartscroll
4.3
(6)
Sold
23
Followers
6
Items
3038
Last sold
2 weeks ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions