Martyr2's Profile User Rating: *****

Reputation: 4307 Guru
Group:
Mentors
Active Posts:
12,155 (4.58 per day)
Joined:
18-April 07
Profile Views:
198,671
Last Active:
User is online 28 minutes ago
Currently:
Viewing Topic: Mark up Calculator

Previous Fields

Country:
CA
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
AMD
Favorite Gaming Platform:
Playstation
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

Latest Visitors

Icon   Martyr2 sings "I'm waking up, I feel it in my bones. Code enough to make my systems 0wN. Welcome to the new age, to the new age."

Posts I've Made

  1. In Topic: Mark up Calculator

    Posted 23 Jul 2014

    Why did you name both functions the same name? Where is dispTotal? plus why are you using .14 when your own equation says to use 1.14? You are also not doing your if statements correctly. Notice in the code below that I include the variable name again, not if/elif when testing values. Here is merging your two functions together and correcting some of the problems...

    def calculator():
            cost = input('Enter supplier cost: ')
            quantity = input('Quantity: ')
    
            # 1.14, not .14
            GandA = 1.14
    
            # Be sure to make sure cost and quantity are correct types
            suppliertotal = float(cost) * GandA * int(quantity)
            if suppliertotal >= 0 and suppliertotal <= 3000:
                    print(suppliertotal + 400)
    
            elif suppliertotal >= 3000.01 and suppliertotal <= 75000:
                    print(suppliertotal * .15)
            
    
    # Call the function
    calculator()
    
    


    If you run this with the cost of 10 and quantity of 10 and you will get your 514. Enjoy! :)
  2. In Topic: Marketer/Lawyer Programmer Wannabe!

    Posted 23 Jul 2014

    Welcome to Dream.In.Code Saboi! We have many resource threads posted to the top of their respective forums. That can be your first stop for content that will help you with your learning. If you go to the Java forum you will see threads about Best beginners books and data structures resource thread. There are more in other forums.

    Enjoy and thanks for signing up! :)
  3. In Topic: Need help with part of a function.

    Posted 23 Jul 2014

    new Date("lastvisit")???? I think you wanted to set a variable to the value returned by getCookie and then use that variable in the Date constructor.... but that is not what you are doing. You are just passing a string to the date object.

    Also you are using newDate("August 13, 2013 13:00:00");. I think you need a space between "new" and "Date". You are wanting to create a new Date object right? Or is that some custom defined function you created?
  4. In Topic: Android SQL Query Where Clause Issue

    Posted 22 Jul 2014

    Well what is the actual error? No error? Maybe the query just doesn't return any rows? Is the id variable what you expect? Usually if there is no errors and you are not getting anything it is because your query is correct, you are just asking for wrong data or data that just doesn't exist. I mean if you have 3 rows with ids 1 through 3 and you ask for id 5, it won't error, it will just return 0 rows.

    :)
  5. In Topic: Can not get thank you page to load

    Posted 22 Jul 2014

    The hidden field with the redirect will not cause it to redirect. This would only work if you controlled the script you submitted the form to and then could read that field and do the redirect. But my guess here is that you don't control that script you are submitting to. Let me know if I am wrong about that.

    If you don't control that script, then you are left with a few options for submitting this form. You could try a javascript submit and then do the redirect or perhaps you could see if there is a way that the person who controls the server side script can take a redirect parameter for you.

    As for other things of note, what is with all the non breaking spaces (&nbsp characters)? Remember you have CSS for styling things including padding and alignment.

    :)

My Information

Member Title:
Programming Theoretician
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Location:
Vancouver, Canada
Interests:
I love programming and science (almost became a chemist). My favorite languages are C#, Java, Python and PHP. While I am not programming I enjoy movies that feature something medieval (Gladiator, Braveheart etc) or high tech (like Hackers or Swordfish).

I have a diploma in computer science and another in arts and science. My favorite sciences are astronomy, chemistry and geology.

If you have any questions regarding programming, you will find I live and breathe the stuff and should prove an invaluable asset.

Winner of 25 2008-2013 DIC Community Awards including Blog of the Year, Mentor of the Year, DIC Head of the Year, Most helpful Programming Category, Most Helpful in Web Development Category and overall Nicest Member of the year.

You can now catch me on Twitter! Follow me as I talk about technology and specifically programming and answer questions like the best book to learn from or how to organize your code.

http://twitter.com/martyrscry :)
Years Programming:
16
Programming Languages:
C/C++/VC++/C#, VB6/VB.NET, Java, JavaScript, Ruby, HTML/CSS, PHP, ASP/.NET, Python, mIRC Scripting

Contact Information

E-mail:
Private
Website URL:
Website URL  http://www.coderslexicon.com
Facebook:
http://www.facebook.com/coderslexicon
Twitter:
martyrscry

Comments

  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  1. Photo

    Dogstopper Icon

    05 Dec 2013 - 14:39
    Have a 6-year badge good sir!
  2. Photo

    mostyfriedman Icon

    12 Oct 2013 - 21:07
    I am good, busy as well.
  3. Photo

    Martyr2 Icon

    07 Oct 2013 - 12:16
    Good mosty, you? Been busy lately.
  4. Photo

    mostyfriedman Icon

    07 Oct 2013 - 11:26
    Martyr2 my man, how's it going??
  5. Photo

    ishkabible Icon

    22 Aug 2013 - 15:58
    O ah, didn't even realize it. No prob. much deserved!
  6. Photo

    balloon1 Icon

    18 May 2013 - 14:57
    Hi can you help me with one of my questions!
  7. Photo

    groovmuffn Icon

    24 Apr 2013 - 10:10
    Greetings! Newish coder here. I came across your php histogram equalization code the other day and figured I'd try and draft something similar up in javascript. I feel like my code is sound, though something has to be wrong as the output of the image is black with some faint greens. I'm wondering if I am missing something from your original code. Consider perusing a jsFiddle?
  8. Photo

    Martyr2 Icon

    31 Dec 2012 - 12:48
    Thanks lucky3! Winning these types of things always energizes me to continue my work to help everyone I can here. I am a firm believer that we should always provide more than just a quick answer, but teach as well. :)
  9. Photo

    lucky3 Icon

    31 Dec 2012 - 02:23
    Congratulations for the "Mentor of the Year" 1st place, "Nicest Member of the Year" 1st place, "Most Helpful- Web Development" 1st place, and "DIC Blog of the Year" award 3rd place awards! Really impressive, and well deserved.
  10. Photo

    xwordgrl Icon

    27 Dec 2012 - 14:26
    Martyr2, I’m a reporter for the Wall Street Journal and would like to ask you a question about your post on Code Academy. Please email me at sarah.needleman@wsj.com. Thanks!
  11. Photo

    MsParnel Icon

    16 Sep 2012 - 23:17
    Thank you very much for the project list :).
  12. Photo

    ishkabible Icon

    19 Feb 2012 - 20:19
    "This is Chris's basement!!!"
  13. Photo

    Martyr2 Icon

    19 Feb 2012 - 12:47
    Very very true. echo "THIS IS SPARTA!!!";
  14. Photo

    no2pencil Icon

    19 Feb 2012 - 11:51
    It's like the movie 300. 10 times.
  15. Photo

    Martyr2 Icon

    31 Jan 2012 - 16:48
    Thanks macosxnerd! I am glad someone noticed. :)
  • (8 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »