-
Notifications
You must be signed in to change notification settings - Fork 0
/
.main.py.853114246~
41 lines (37 loc) · 1.49 KB
/
.main.py.853114246~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name = input("Hello user, what is your name? ")
print("Nice to meet you " + name + ".")
# Get input for height & width. Convert to integers and store in variables
length1 = int(input("Please enter the length of the rectangle: "))
width1 = int(input("Please enter the width of the rectangle: "))
# Calculate the area & store the result in the area variable
area = length1 * width1
# Output the area variable (converted to string)
print(name, "the area of the rectangle is",str(area)+".")
print(" ", width1)
print("> _________")
print("> | |")
print("> | | " , length1)
print("> |_________|")
print("> Area = " , area)
#1
length2 = int(input("Please enter the length of the rectangle: "))
width2 = int(input("Please enter the width of the rectangle: "))
peri = (length2 + width2)*2
print(name, "the perimeter of the rectangle is",str(peri)+".")
print(" ", width2)
print("> _________")
print("> | |")
print("> | | " , length2)
print("> |_________|")
print("> Perimeter = " , peri)
#2
firstPrice = float(input("Enter to cost of your meal: $"))
tip = (firstPrice * .20)
totalCost = firstPrice + tip
print(name + ", the tip price is $" + str(tip) , "and the total cost is $" + str(totalCost))
#3
length3 = int(input("Please enter the length of the cuboid: "))
width3 = int(input("Please enter the width of the cuboid: "))
height3 = int(input("Please enter the height of the cuboid: "))
volume = (length3 * width3 * height3)
print(name, "the volume of the cubiod is",str(volume)+".")