100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
WGU D335 TEST |GUARANTEED PASS $16.49   Add to cart

Exam (elaborations)

WGU D335 TEST |GUARANTEED PASS

 5 views  0 purchase
  • Course
  • WGU D335
  • Institution
  • WGU D335

e a solution that accepts three integer inputs representing the number of times an employee travels to a job site. Output the total distance traveled to two decimal places given the following miles per employee commute to the job site. Output the total distance traveled to two decimal places given ...

[Show more]

Preview 2 out of 10  pages

  • October 25, 2024
  • 10
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • wgu d335
  • WGU D335
  • WGU D335
avatar-seller
EXAMLINKS
WGU D335 TEST 2024\2025 |
GUARANTEED PASS

1.create a solution that accepts three integer inputs representing the
number of times an employee travels to a job site. Output the total
distance traveled to two decimal places given the following miles per
employee commute to the job site. Output the total distance traveled to
two decimal places given the following miles per employee commute to
the job site:
employee a: 15.62 miles
employee b: 41.85 miles
employee c: 32.67 miles
Times_traveled a = int(input())
times_traveled b = int(input())
times_traveled c = int(input())
employee a = 15.62 #miles
employee b = 41.85 #miles
employee c = 32.67 #miles
distance_traveled a = times_traveled a * employee a
distance_traveled b = times_traveled b * employee b
distance_traveled c = times_traveled c * employee c
total_miles_traveled = distance_traveleda + distance_traveledb +
distance_traveledc
print('distance: {:.2f} miles'.format(total_miles_traveled))


2.create a solution that accepts an input identifying the name of a text
file, for example, "wordtextfile1.txt". Each text file contains three rows
with one word per row. Using the open() function
and write() and read() methods, interact with the input text file to write a

, new sentence string composed of the three existing words to the end of
the file contents on a new line. Output the new file contents.
File_name = input()
with open(file_name, 'r') as f:
word1 = str(f.readline()).strip()
word2 = str(f.readline()).strip()
word3 = str(f.readline()).strip()

f = open(file_name, 'r')
lines = f.read().splitlines()
lines = ' '.join(lines)
f.close()
print(f'{word1}\n{word2}\n{word3}\n{lines}')
Brainpower
Read more


3.create a solution that accepts an integer input representing any number
of ounces. Output the converted total number of tons, pounds, and
remaining ounces based on the input ounces value. There are 16 ounces
in a pound and 2,000 pounds in a ton.
Ounces_per_pound = 16
pounds_per_ton = 2000
number_ounces = int(input())
tons = number_ounces // (ounces_per_pound * pounds_per_ton)
remaining_ounces = number_ounces % (ounces_per_pound *
pounds_per_ton)
pounds = remaining_ounces // ounces_per_pound
remaining_ounces = remaining_ounces % ounces_per_pound
print('tons: {}'.format(tons))

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller EXAMLINKS. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $16.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79223 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$16.49
  • (0)
  Add to cart