Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Please guys
#1
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
Reply
#2
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.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  guys please help me , pycharm is not able to identify my xlsx file CrazyGreenYT7 1 2,024 Jun-13-2021, 02:22 PM
Last Post: Larz60+
  hi guys, i'm back to learning python ! astral_travel 6 2,938 Oct-05-2020, 10:02 AM
Last Post: astral_travel
  Hi Guys, please help me to write SAS macro parameter equivalent code in Python Manohar9589 2 2,612 Jun-14-2020, 05:07 PM
Last Post: Larz60+
  Could you guys help with this bug. I would post on StackOverflow but I got tempbanned ryder5227 2 2,398 Sep-26-2019, 08:01 PM
Last Post: metulburr
  Hey guys, help a newbie out with a list problem. sdezigner 2 2,681 Feb-15-2018, 06:06 PM
Last Post: sdezigner
  Hello,Guys!,I met a very strange bug homepoeple 4 3,320 Jan-26-2018, 12:16 PM
Last Post: homepoeple
  Hey guys can you please help me with some basic coding Stabu 9 6,286 Jul-16-2017, 10:11 AM
Last Post: MyImpsNamesAre

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020