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
...
Type: Posts; User: theCanuck
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
...
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...
Hello, so I am getting into the basics of functions and having a little trouble with my program.
#include <iostream>
using namespace std;
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:...
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.
Well I already have totalPay = num * amount in the loop, and when I assign totalpay to 0 it still gives me the same result. :/
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...
I know how to do it using a while loop, but I must use a do-while loop.
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?
It says even if the number is 0 for the first entry, it should still exit.
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".
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>...
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...
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...
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...
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;
...
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...
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?
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...
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...