Thread: weekly wage calculator

  1. #16
    Registered User
    Join Date
    Dec 2009
    Posts
    14
    thanks, im just not good enough to get it working. thanks for the help anyway

  2. #17
    Registered User
    Join Date
    Dec 2009
    Posts
    14
    hey thanks for the help previous, i got the calculator working fairly well, but now i have another question. After the wages and hours have been put in and calculated to get their pay, i need the programme to display the overall pay for all employees, if i create arrays for each pay how to i add the to get a big total come out, i keep getting weird minus values when i try

  3. #18
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    Honestly, if you can't get this you need to learn an easier language first, you're not going to learn anything by having people spoon feed you everything. As that other guy said, use an array. An array is a series of variables, accessible by their index. Example:
    Code:
    int arr[9]; // You now have 10 variables
    arr[0]=5; //The first variable now = 5
    arr[1] = 20; // The second = 20
    The way this helps you, is that in the example above, 9 can be replaced with a variable. Example:
    Code:
    int index = 9
    int arr[index]; // You now have 10 variables
    arr[0]=5; //The first variable now = 5
    arr[1] = 20; // The second = 20
    How this helps you is that you can now change which variable is being used per repetition of a loop. Example:
    Code:
    int arr[9]
    for (int index = 0; index <= 9; index++)// I prefer while, so idk if this is right
    {
    std::cout << "Enter a number: ";
    std::cin >> arr[index];
    }
    arr[0] now contains the first # you entered and arr[1] the second and so on.

    You REALLY need a good tutorial to learn from, try C++ Language Tutorial. They have everything you need to know and then some.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help modifying my calculator!!
    By Matus in forum C Programming
    Replies: 5
    Last Post: 03-25-2008, 12:03 PM
  2. GUI Calculator - Critique
    By The Brain in forum Windows Programming
    Replies: 1
    Last Post: 02-25-2006, 04:39 AM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 10:48 AM
  5. Replies: 2
    Last Post: 05-10-2002, 04:16 PM