Jun-22-2022, 10:32 AM
My assignment is to get company name from the user, get the number of fiberoptic cable needed from the user, evaluate whether that number is greater than 100,250, and 500; then based on that feedback, multiply the numbers by .80, .70, and .50 respectively.
Then display the result, with the company name at the end of the program. The problem I'm having is when I execute the program for the numbers greater than250, and 500 that I am multiplying by .7, and .5, I am getting wrong answers. Which makes me wonder if the program is also multiplying the numbers by .8 for the number greater than 100. I'm sorry I am not great at explaining things
The numbers I am getting are for 251*0.70 I am getting 200.8, and my calculator is giving me 175.70
And for 501*0.50 I am getting 400.80, and my calculator is giving me 250.50.
Then display the result, with the company name at the end of the program. The problem I'm having is when I execute the program for the numbers greater than250, and 500 that I am multiplying by .7, and .5, I am getting wrong answers. Which makes me wonder if the program is also multiplying the numbers by .8 for the number greater than 100. I'm sorry I am not great at explaining things
print("Hello! Thank you for choos-oh...it seems that we do not have a company name. Can you help us choose one?") company_name=input("Please input a name for your company: ") message="Thank you for choosing" print(message,company_name.title(),'Please continue on to the selection process below') amount_of_cable=int(input("Amount of cable needed(in feet): ")) if amount_of_cable>100: bulk_discount=(round(float(amount_of_cable)*0.80,2)) print(bulk_discount) input("prompt") exit() if (amount_of_cable>250): big_bulk_discount=(round(float(amount_of_cable)*0.70,2)) print(big_bulk_discount) input("prompt") exit() if amount_of_cable>500: ultimate_bulk_discount=(round(float(amount_of_cable)*0.50,2)) print(ultimate_bulk_discount) input("prompt") exit() val_2=0.87 result=(float(amount_of_cable)*(val_2)) print("The toal cost is:",result) message_1=("Thank you for using this program, designed by ElRoberto") print(message_1) input("Press any key to close this window")I have tried doing utilizing the "and" function with no effect.
The numbers I am getting are for 251*0.70 I am getting 200.8, and my calculator is giving me 175.70
And for 501*0.50 I am getting 400.80, and my calculator is giving me 250.50.