Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) --- Write a program that uses standard input to displays the following pieces

ID: 3535263 • Letter: 1

Question

1) ---Write a program that uses standard input to displays the following pieces of information about you, each on a separate line: Name, major, a hobby

2) ---An electronics company sells circuit boards at a 40% profit. Write a program that will calculate the selling price of a circuit board that costs $18.50

3) ---Write a program that converts kilometers to miles and meters to feet.

4) ---Running on a particular treadmill allows you to burn 3.9 calories per minute. Write a program that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes

5) ---Write a program that asks for the names of three runners and the time it took each of them to finish a race. Your program should display who came in first, second and third place.

Explanation / Answer


1)
name =raw_input("What is your name? ")
major = raw_input("what is your major? ")
hobby = raw_input("what is your hobby? ")

print name+" "+major+" "+hobby+" "

2)
price = 1.4*18.5
print "price is "+ string(price)

3)

x= raw_input("type 1 for km to miles and 2 from m to ft ")
y=raw_input("starting value is? ")
if x==1:
   output = float(y)*0.621371
   print string(output)+"miles"

if x==2:
   output = float(y)*3.28
   print string(output)+"feet"

4)
for i in range(0,5)
   minutes=10+5*i
   calories = 3.9*minutes
   print string(calories)+" burned in " +minutes+" minutes "

5)
fname = raw_input("First Runner's name? ")
ftime = float(raw_input("First Runner's time? "))


sname = raw_input("Second Runner's name? ")
stime = float(raw_input("Second Runner's time? "))


tname = raw_input("Third Runner's name? ")
ttime = float(raw_input("Third Runner's time? "))

timedict = {ftime:fname, stime:sname, ttime:tname}
times = [ftime, stime, ttime]
min_time = times.pop(min(times))
midtime = times.pop(min(times))
lasttime = times.pop()

print timedict(min_time)+" came in First "

print timedict(midtime)+" came in SEcond "

print timedict(lasttime)+ " came in Last "