Rounding - c++

This is a discussion on Rounding - c++ ; This is the part of the problem that I want to solve ..........The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount ...

+ Reply to Thread
Results 1 to 4 of 4

Rounding

  1. Default Rounding

    This is the part of the problem that I want to solve


    ..........The rounding rules for
    sales tax are that for a tax rate of n%, a shelf price of p contains
    (np/100 rounded up to the nearest 0.05) amount of sales
    tax................


    How to round up the sales tax?


  2. Default Re: Rounding

    * Amol:
    > This is the part of the problem that I want to solve
    >
    >
    > .........The rounding rules for
    > sales tax are that for a tax rate of n%, a shelf price of p contains
    > (np/100 rounded up to the nearest 0.05) amount of sales
    > tax................
    >
    >
    > How to round up the sales tax?


    Since the problem statement calls for rounding up, use the ceil() function.

    Read the documentation about this function, and try it out on some
    simpler problems, whatever comes naturally.

    Then figure out how to round up to nearest 0.01. Try that. Then figure
    out how to round up to nearest 0.01. Try that.

    Test thoroughly.

    And pray fervently that some vacuum-head doesn't try to impress us with
    the purity of his head's vacuum by posting code for your homework.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?

  3. Default Re: Rounding


    Alf P. Steinbach <alfps@start.no> wrote in message...

    > And pray fervently that some vacuum-head doesn't try to impress us with
    > the purity of his head's vacuum by posting code for your homework.


    Hey, I've been called worse and still survived!! <G>

    Hi Alf.
    --
    Bob R
    POVrookie



  4. Default Re: Rounding

    "Amol" <amolj.1306> wrote in message
    news:1185265051.024782.208070@m37g2000prh.googlegroups.com...
    > This is the part of the problem that I want to solve
    >
    >
    > .........The rounding rules for
    > sales tax are that for a tax rate of n%, a shelf price of p contains
    > (np/100 rounded up to the nearest 0.05) amount of sales
    > tax................
    >
    >
    > How to round up the sales tax?


    rounded up to the nearest 0.05 is kinda weird. But think how you do it
    manually and do it in code.



+ Reply to Thread

Similar Threads

  1. rounding
    By Application Development in forum cobol
    Replies: 14
    Last Post: 10-04-2007, 12:04 PM
  2. Rounding down to .00 .25 .50 .75
    By Application Development in forum ADO DAO RDO RDS
    Replies: 1
    Last Post: 09-20-2007, 08:27 AM
  3. Rounding up to the next .5
    By Application Development in forum Perl
    Replies: 5
    Last Post: 04-29-2007, 10:39 AM
  4. Rounding currency - I don't want rounding.
    By Application Development in forum basic.visual
    Replies: 5
    Last Post: 12-08-2003, 05:40 PM