[Below is the code You Enter the price for 3 magazines and the program will ask for single or bundle subscription.Once you choose type of Subscription.It will ask for which magazine you want the subscription and It will show the models accordingly. but 2 times output and in Case of bundle subscription it will show 4 times output.]
NG=int(input("Please Enter the price of Nat Geo Traveller Magazine:"))
BW=int(input("Price of Business world Magazine:"))
PC=int(input("Enter the price of PC Quest Magazine:"))
d=False
while d==False:
subs=input("Type 's' for single and 'bun' for bundle Magazine subscription:")
if (subs.lower()=='s' or subs.lower()=='bun'):
print("You have choosen", subs)
d=True
else:
print("invalid input")
continue
subs
while subs=='s':
mag=input("Type 'a' for NatGeo, 'b' for BusinessWorld,'c' for PC Quest:")
if (mag.lower()=='a' or mag.lower()=='b' or mag.lower()=='c'):
print("You have choosen",mag.capitalize(), "magazine")
subs='se'
value=mag.lower()
else:
print("invalid choice")
continue
while subs=='bun':
bu=int(input("Type 1 for NG&BW, 2 for BW&PC, 3 for NG&PC and 4 for all :"))
if (bu==1 or bu==2 or bu==3 or bu==4):
print("You have choose model no.:",bu)
subs='se'
else:
print("invalid choice")
continue
for s in subs:
if mag.lower()=='a':
print("The subscription plan for NAT GEO MAGAZINE ")
q=NG*3
M3=q-((q*5)//100)
print("3months Subscription with 5% discount is: Rs",M3)
q=NG*6
M6=q-((q*10)//100)
print("6 months subscription with 10% discount is: Rs", M6)
q=NG*12
M12=q-((q*15)//100)
print("12 months Subscription with 15% discount is: Rs", M12)
elif mag.lower()=='b':
print("The subscription plan for BUSINESS WORLD MAGAZINE ")
q=BW*3
M3=q-((q*5)//100)
print("3months Subscription with 5% discount is: Rs",M3)
q=BW*6
M6=q-((q*10)//100)
print("6 months subscription with 10% discount is: Rs", M6)
q=BW*12
M12=q-((q*15)//100)
print("12 months Subscription with 15% discount is: Rs", M12)
elif mag.lower()=='c':
print("The subscription plan for PC Quest MAGAZINE ")
q=PC*3
M3=q-((q*5)//100)
print("3months Subscription with 5% discount is: Rs",M3)
q=PC*6
M6=q-((q*10)//100)
print("6 months subscription with 10% discount is: Rs", M6)
q=PC*12
M12=q-((q*15)//100)
print("12 months Subscription with 15% discount is: Rs", M12)
else:
print(null)
for bun in subs:
if bu==1:
print("The subscription model for NG and BW")
r=(NG+BW)*3
m3=r-((r*10)//100)
print("3 Months plan with 10% discount: Rs",m3)
r=(NG+BW)*6
m6=r-((r*10)//100)
print("6 Months plan with 10% discount: Rs",m6)
r=(NG+BW)*12
m12=r-((r*10)//100)
print("12 Months plan with 10% discount: Rs",m12)
elif bu==2:
print("The subscription model for BW and PC")
r=(BW+PC)*3
m3=r-((r*10)//100)
print("3 Months plan with 10% discount: Rs",m3)
r=(PC+BW)*6
m6=r-((r*10)//100)
print("6 Months plan with 10% discount: Rs",m6)
r=(PC+BW)*12
m12=r-((r*10)//100)
print("12 Months plan with 10% discount: Rs",m12)
elif bu==3:
print("The subscription model for NG and PC")
r=(NG+PC)*3
m3=r-((r*10)//100)
print("3 Months plan with 10% discount: Rs",m3)
r=(NG+PC)*6
m6=r-((r*10)//100)
print("6 Months plan with 10% discount: Rs",m6)
r=(NG+PC)*12
m12=r-((r*10)//100)
print("12 Months plan with 10% discount: Rs",m12)
elif bu==4:
print("The subscription model for NG, PC and BW")
r=(NG+PC+BW)*3
m3=r-((r*10)//100)
print("3 Months plan with 10% discount: Rs",m3)
r=(NG+PC+BW)*6
m6=r-((r*10)//100)
print("6 Months plan with 10% discount: Rs",m6)
r=(NG+PC+BW)*12
m12=r-((r*10)//100)
print("12 Months plan with 10% discount: Rs",m12)
else:
print(null)
Aucun commentaire:
Enregistrer un commentaire