Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
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 PRACTICE TEST 2 WITH COMPLETE SOLUTIONS




1.Create BGa BGsolution BGthat BGaccepts BGthree BGinteger BGinputs BGrepresenting
BGthe BGnumber BGof BGtimes BGan BGemployee BGtravels BGto BGa BGjob BGsite. BGOutput

BGthe BGtotal BGdistance BGtraveled BGto BGtwo BGdecimal BGplaces BGgiven BGthe

BGfollowing BGmiles BGper BGemployee BGcommute BGto BGthe BGjob BGsite. BGOutput

BGthe BGtotal BGdistance BGtraveled BGto BGtwo BGdecimal BGplaces BGgiven BGthe

BGfollowing BGmiles BGper BGemployee BGcommute BGto BGthe BGjob BGsite:

Employee BGA: BG15.62
BGmiles BGEmployee BGB:

BG41.85 BGmiles

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

times_traveledC BG= BGint(input())
BGemployeeA BG= BG15.62 BG#miles

BGemployeeB BG= BG41.85 BG#miles

BGemployeeC BG= BG32.67 BG#miles

distance_traveledA BG= BGtimes_traveledA BG*
BGemployeeA BGdistance_traveledB BG=

BGtimes_traveledB BG* BGemployeeB

BGdistance_traveledC BG= BGtimes_traveledC BG*

BGemployeeC

total_miles_traveled BG= BGdistance_traveledA BG+ BGdistance_traveledB
BG+ BGdistance_trav- BGeledC

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

, 2.Create BGa BGsolution BGthat BGaccepts BGan BGinput BGidentifying BGthe BGname BGof
BGa BGtext BGfile, BGfor BGexample, BG"WordTextFile1.txt". BGEach BGtext BGfile BGcontains

BGthree BGrows BGwith BGone BGword BGper BGrow. BGUsing BGthe BGopen() BGfunction

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

BGto BGwrite BGa BGnew BGsentence BGstring BGcomposed BGof BGthe BGthree BGexisting

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

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

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

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

BGword2 BG=

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

BGword3 BG=

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



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

BGf.read().splitlines()

BGlines BG= BG'

BG'.join(lines) BGf.close()

print(f'{word1}\n{word2}\n{word3}\n{lines}')
3.Create BGa BGsolution BGthat BGaccepts BGan BGinteger BGinput BGrepresenting
BGany BGnumber BGof BGounces. BGOutput BGthe BGconverted BGtotal BGnumber BGof

BGtons, BGpounds, BGand BGremaining BGounces BGbased BGon BGthe BGinput BGounces

BGvalue. BGThere BGare BG16 BGounces BGin BGa BGpound BGand BG2,000 BGpounds BGin BGa

BGton.: BGounces_per_pound BG= BG16




2
BG/

Document information

Uploaded on
March 27, 2025
Number of pages
12
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$12.49

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.
Edufiles
4.9
(214)
Sold
137
Followers
10
Items
7540
Last sold
4 weeks ago


Reviews from verified buyers



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