Python Forum
Help Please guys - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Help Please guys (/thread-16085.html)



Help Please guys - AbuSiraj - Feb-13-2019

Help Please Guys Im to Programming .Problem scenario !!! to create a program for an online shop deal where if a customer buys five items they get the cheapest free.The program should take in the five products and their cost and display them by price(highest to lowest) .It should then calculate a total cost discounting the cheapest item and display the total owed. Top level algorithm 1-Input five products and prices 2- Sort products by price
3-Calculate total (applying discount 4- Display results


RE: Help Please guys - ichabod801 - Feb-13-2019

What have you tried? We're not big on writing code for people here, but we would be happy to help you fix your code when you run into problems. When you do run into problems, please post your code in Python tags, and clearly explain the problem you are having, including the full text of any errors.


RE: Help Please guys - AbuSiraj - Feb-14-2019

As I posted Yesterday the whole scenario without post my trying . To see if I did it write or need a fix .Please Help .Thank you in advance.
#intialize sum = 0 and count =0 (prices)
Enter n  (i/o)
# find sum + n and assign it to sum then increment count by 1 (prices)
#is count > 5 (decision) 
   if count > 5: #go step 2
   else print sum (i/o)
    print sum (i/o)
    input ("n1+n2+n3+n4+n5")
#if number 1 is greater than 2 
    print " number 2 is greater
    input =x
    x = int 
#set total (n1+n2+n3+n4+n5)/5

 #Calculate the total of the five numbers.) 
 #"please enter n1,n2,n3,n4,n5"
 #("The total is"Set total to (n1+n2+n3+n4+n5)=0
 # Read x
   set sum to 0
   while (x>=0
 set sum to x +sum
 # if (N1>N2)
 # set total to N2
 # else total to N1 
 # if N3 < total
 # if (N4< total)
 # if (N5< total)
 # x Set sum to 0; While(x >= 0) Set sum to x + sum x int x, sum; sum = 0; cin>>x; while(x >= 0) { sum = sum + x cin>>x;
 #quit=input