Search:

Type: Posts; User: theCanuck

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    3,997

    Well that's how I figured you would do it but how...

    Well that's how I figured you would do it but how do you start at the end of the array since the user gets the enter the number of the array.

    Like if I knew the array was a size ten I could do

    ...
  2. Replies
    5
    Views
    3,997

    Possible to reverse numbers in an array?

    I know it's possible to reverse numbers of a list, but is it possible to do it when using an array?

    For an example here is a simple program that asks the user to enter the amount of numbers in the...
  3. Replies
    2
    Views
    1,072

    Beginning functions

    Hello, so I am getting into the basics of functions and having a little trouble with my program.






    #include <iostream>
    using namespace std;
  4. Replies
    6
    Views
    961

    oh wow thanks. I was using num because I thought...

    oh wow thanks. I was using num because I thought it would need to keep track of how many months the user picks. Didn't realize you didn't need to do that.

    Appreciate your help a lot.

    EDIT:...
  5. Replies
    6
    Views
    961

    Well I think my code is wrong then because when I...

    Well I think my code is wrong then because when I do
    totalPay += amount * num; and say I enter 3 months and $5, $10, and $15 dollar for months, I end up with a value of $70 when it should be $30.
  6. Replies
    6
    Views
    961

    Well I already have totalPay = num * amount in...

    Well I already have totalPay = num * amount in the loop, and when I assign totalpay to 0 it still gives me the same result. :/
  7. Replies
    6
    Views
    961

    Need help with short program

    Hello. In this short program I am calculating the amount of money a person spent paying a product off over x months.


    #include<iostream>
    using namespace std;

    int main()

    {
    double...
  8. Replies
    10
    Views
    10,346

    I know how to do it using a while loop, but I...

    I know how to do it using a while loop, but I must use a do-while loop.
  9. Replies
    10
    Views
    10,346

    Ok thanks. That almost fixes it. It prints out...

    Ok thanks. That almost fixes it. It prints out that 0 in even and then ends the program. How do I make it so that it just ends it without printing that 0 is even first?
  10. Replies
    10
    Views
    10,346

    It says even if the number is 0 for the first...

    It says even if the number is 0 for the first entry, it should still exit.
  11. Replies
    10
    Views
    10,346

    Ok, so since it has to execute at least once...

    Ok, so since it has to execute at least once there is no way make it end on the first time? Because in the exercise directions it says "even if 0 is entered the first time".
  12. Replies
    10
    Views
    10,346

    sentinel controlled do-while loop

    In my code I need to have a sentinel controlled do-while loop for the number 0. I can get it to work when I use a while loop, but cant get it to work when I use a do-while.


    #include <iostream>...
  13. Replies
    8
    Views
    1,307

    Well for the the even/odd program I assume I must...

    Well for the the even/odd program I assume I must need a loop this is like:

    something = 0;
    while (something < 3)
    {
    something++;
    }
    So that it runs, then adds one, runs adds one, then stops for...
  14. Replies
    8
    Views
    1,307

    My problem is I don't even know where to begin....

    My problem is I don't even know where to begin. In class we have learned how to use a loop but we never actually looked at one in a program like this

    The instructor used simple simple programs to...
  15. Replies
    8
    Views
    1,307

    Learning loops

    Hello. In my C++ class we are now in the chapter of loops and I have began to start getting lost. I have been doing fine until now, and now starting to get worried.

    Last chapter we had to write a...
  16. Replies
    2
    Views
    1,889

    Right aligning.

    Hello I am trying to right align a program so that the input is 20spaces over on the console. So for an example:


    #include<iostream>
    #include<iomanip>
    #include<string>

    using namespace std;
    ...
  17. Replies
    12
    Views
    14,401

    I think I'm getting myself more confused. How do...

    I think I'm getting myself more confused. How do I take those numbers and actually make it work?

    I've been on this all night and haven't gotten anywhere.

    Here is the code I have and the problem...
  18. Replies
    12
    Views
    14,401

    Well my program has to let the user enter...

    Well my program has to let the user enter whatever 4 digit binary number he wants. So how do I calculate the binary number the user chocies, and convert it to decimal?
  19. Replies
    12
    Views
    14,401

    I just need to know how to change what the user...

    I just need to know how to change what the user puts as binary to decimal. I know how to calculate binary to decimal but I only know that when I know what the binary number is, and the user can put...
  20. Replies
    12
    Views
    14,401

    Binary Number to Decimal

    Hello all.

    I am new to programming and taking my first programming course which is basic C++ programming. However I am stuck on a exercise and not sure what to do.

    The exercise is: Write a...
Results 1 to 20 of 20