identififiers question

This is a discussion on identififiers question within the C Programming forums, part of the General Programming Boards category; I am trying to write my first program to calculate a 6% sale tax on a purchase. i need help ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    4

    identififiers question

    I am trying to write my first program to calculate a 6% sale tax on a purchase. i need help setting up the variable and calculation

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Show us what you've done so far, so that we can guide you.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,703
    You need a variable with a cost in it.
    You need to multiply that by 0.06 and then add to said variable.
    Questions?
    Code:
    bool flip(bool value)
    {
        return std::pow(std::exp(1), std::complex<float>(0, 1) 
        * std::complex<float>(std::atan(1)*(1 << (value + 2))))
        .real() < 0;
    }

  4. #4
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511
    Now you have the idea. Post some code. You have to try to do this yourself!!!

    Mr. C.

  5. #5
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Psuedo code
    Code:
    #include <stdio.h>
    
    int main ( void )
    {
    	Setup a variable for price of purchase
    	Setup a variable for purchase total
    
    	Ask for input; the price of the purchase, and store it in the variable
    	Multiply the purchase variable * .06, and store the answer in the variable total
    	Print the variable total
    
    	return 0;
    }
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  2. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. Question about linked lists.
    By cheeisme123 in forum C++ Programming
    Replies: 6
    Last Post: 02-25-2003, 12:36 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21