reset password
Author Message
Doggy213
Posts: 11
Posted 22:38 Mar 12, 2019 |

I need help m8s :(!

otovar
Posts: 14
Posted 22:39 Mar 12, 2019 |

with number 4? lol

Doggy213
Posts: 11
Posted 22:40 Mar 12, 2019 |

yessssss number 4

otovar
Posts: 14
Posted 22:41 Mar 12, 2019 |

I'm stuck too... lol

DouglasA.
Posts: 11
Posted 22:42 Mar 12, 2019 |

I used a lot of if's, and strings for the fourth exercise

otovar
Posts: 14
Posted 22:43 Mar 12, 2019 |

I asked just in case if you needed help with 1,2 or 3. But I'm stuck on 4 too. :(

Doggy213
Posts: 11
Posted 22:43 Mar 12, 2019 |

i mean i am stuck on 3 too lol 

Doggy213
Posts: 11
Posted 22:44 Mar 12, 2019 |

a = ('Toy Story 3') 
b = ('Star Wars')
c = ('Black Panther')
d = ('Mad Max: Fury Road')
x= float(input())
if(x <= 100):
  print (a , b , c , d ,)
elif(x >= 17):
  print(c , b , a)
 

 

 

I have this for 3 but its a bit iffy its not coming out correctly. 

rnorton
Posts: 2
Posted 22:45 Mar 12, 2019 |

Hey!!!!

That's how I did it! I'm not sure if I should be sharing but since it is a forum and we should be helping each other xD

Try to tweak it a little bit, there is a bunch of ways to code using logic.

# CURRENCY

print("THIS PRICE IS IN US DOLLARS ONLY!", end="")

# COST

print("\n\nEnter the cost of the meal - ", end="")
cost = float(input())
print(cost)


# TYPE

print("Enter type of restaurant (R=regular, G=good, F=fancy) - ", end="")
type = input()
print(type)


# NUMBER OF PEOPLE

print("Enter the number of people in your party - ", end="")
numb = int(input())
print(numb)


# SERVICE

print("Enter type of service (P=poor, G=good, E=exellent) - ", end="")
service = input()
print(service)


# TIP

tip = 0
 
if (type == "R"):
  tip = cost * 0.12

if (type == "G"):
  tip = cost * 0.15

if (type == "F"):
  tip = cost * 0.20


# NUMBER OF PEOPLE FEES

additions = 0

if (numb >= 1):
  if (numb <= 5):
    additions = cost * 0

if (numb >= 6):
  if (numb <= 10):
    additions = cost * 0.03

if (numb > 10):
    additions = cost * 0.05

# QUALITY OF SERVICE FEES

servicefee = 0

if (service == "P"):
  servicefee = cost * -0.02

if (service == "G"):
  servicefee = cost * 0

if (service == "E"):
  servicefee = cost * 0.02


# TOTAL PRICE AND FEES

print("\nYou owe %d as a tip!" % tip)
print("Your additional fees are: %d" % additions)
print("Your service fees are: %d" % servicefee)

total = cost + tip + additions + servicefee

print("The total price is $%d USD" % total)

otovar
Posts: 14
Posted 22:52 Mar 12, 2019 |
rnorton wrote:

Hey!!!!

That's how I did it! I'm not sure if I should be sharing but since it is a forum and we should be helping each other xD

Try to tweak it a little bit, there is a bunch of ways to code using logic.

# CURRENCY

print("THIS PRICE IS IN US DOLLARS ONLY!", end="")

# COST

print("\n\nEnter the cost of the meal - ", end="")
cost = float(input())
print(cost)


# TYPE

print("Enter type of restaurant (R=regular, G=good, F=fancy) - ", end="")
type = input()
print(type)


# NUMBER OF PEOPLE

print("Enter the number of people in your party - ", end="")
numb = int(input())
print(numb)


# SERVICE

print("Enter type of service (P=poor, G=good, E=exellent) - ", end="")
service = input()
print(service)


# TIP

tip = 0
 
if (type == "R"):
  tip = cost * 0.12

if (type == "G"):
  tip = cost * 0.15

if (type == "F"):
  tip = cost * 0.20


# NUMBER OF PEOPLE FEES

additions = 0

if (numb >= 1):
  if (numb <= 5):
    additions = cost * 0

if (numb >= 6):
  if (numb <= 10):
    additions = cost * 0.03

if (numb > 10):
    additions = cost * 0.05

# QUALITY OF SERVICE FEES

servicefee = 0

if (service == "P"):
  servicefee = cost * -0.02

if (service == "G"):
  servicefee = cost * 0

if (service == "E"):
  servicefee = cost * 0.02


# TOTAL PRICE AND FEES

print("\nYou owe %d as a tip!" % tip)
print("Your additional fees are: %d" % additions)
print("Your service fees are: %d" % servicefee)

total = cost + tip + additions + servicefee

print("The total price is $%d USD" % total)

danggggg 

otovar
Posts: 14
Posted 22:53 Mar 12, 2019 |

 

this is mines lmfao 

 

print("Please input your age")
age = int(input())
print ( age)
if (age <= 10):
 print ( " only rated the G movies " )
if (age >= 11 and age <= 13):
 print (" only G and PG-13 selections")
if (age >= 14 and age <= 16):
 print ("only PG and under movies")
if (age >= 17):
 print ("all of the movies")

otovar
Posts: 14
Posted 22:55 Mar 12, 2019 |

ohhh thats number 4... I posted number 3 . nice code on number 4 btw.

DouglasA.
Posts: 11
Posted 22:58 Mar 12, 2019 |

since someone else posted their example i also will give mine,

 

#part 2 [---PRICE---]
print("Enter the cost of the meal - $", end="")
cost = float(input())
print(cost)
#part 3 [---PEOPLE---]
print("Enter the number of people in your party - ", end="")
numb = int(input())
print(numb)
#part 4 [---TYPE OF RESTAURANT---]
print("Enter type of restaurant (R=regular, G1=good, F=fancy) - ", end="")
type = input()
print(type)
if (type=="R"):
 t = 0.12
if (type=="G1"):
 t = 0.15
if (type=="F"):
 t = 0.20
#part 5 [---SERVICE---]
print("Enter how good was the service (P=poor, G2=good, E=excellent) - ", end="")
service = input()
print(service)
if (service=="P"):
 s = -0.02
if (service=="G2"):
 s = 0
if (service=="E"):
 s = 0.02
#part 6 [---Tip and TOTAL---]
if (numb>=10):
 tip = 0.05 + t + s
if (6<= numb <10):
 tip = 0.03 + t + s
if (1<= numb <6):
 tip = t + s
tip = cost * tip
print("Tip - $", end="")
print(tip)
print("total - $", end="")
print(tip+cost)

DouglasA.
Posts: 11
Posted 23:01 Mar 12, 2019 |
rnorton wrote:

Hey!!!!

That's how I did it! I'm not sure if I should be sharing but since it is a forum and we should be helping each other xD

Try to tweak it a little bit, there is a bunch of ways to code using logic.

# CURRENCY

print("THIS PRICE IS IN US DOLLARS ONLY!", end="")

# COST

print("\n\nEnter the cost of the meal - ", end="")
cost = float(input())
print(cost)


# TYPE

print("Enter type of restaurant (R=regular, G=good, F=fancy) - ", end="")
type = input()
print(type)


# NUMBER OF PEOPLE

print("Enter the number of people in your party - ", end="")
numb = int(input())
print(numb)


# SERVICE

print("Enter type of service (P=poor, G=good, E=exellent) - ", end="")
service = input()
print(service)


# TIP

tip = 0
 
if (type == "R"):
  tip = cost * 0.12

if (type == "G"):
  tip = cost * 0.15

if (type == "F"):
  tip = cost * 0.20


# NUMBER OF PEOPLE FEES

additions = 0

if (numb >= 1):
  if (numb <= 5):
    additions = cost * 0

if (numb >= 6):
  if (numb <= 10):
    additions = cost * 0.03

if (numb > 10):
    additions = cost * 0.05

# QUALITY OF SERVICE FEES

servicefee = 0

if (service == "P"):
  servicefee = cost * -0.02

if (service == "G"):
  servicefee = cost * 0

if (service == "E"):
  servicefee = cost * 0.02


# TOTAL PRICE AND FEES

print("\nYou owe %d as a tip!" % tip)
print("Your additional fees are: %d" % additions)
print("Your service fees are: %d" % servicefee)

total = cost + tip + additions + servicefee

print("The total price is $%d USD" % total)

I compared my work with yours and it seems that both works the same.   : )