So should i set j=0
Type: Posts; User: walkonwater
So should i set j=0
This is what is wrong:
How many values are you going to enter (5-25)30
To many values; try again
How many values are you going to enter (5-25)2
To Few values; try again
How many values are...
Anyways since you corrected the "indention" why is my sum not working right?
Is this better?
numEntered = 0;
cout << "How many values are you going to enter (5-25)";
cin >> numEntered;
while (numEntered < 5 || numEntered > 25 ) {
This is my new code but for some reason it gives me an outrageous number for sum
numEntered = 0;
cout << "How many values are you going to enter (5-25)";
cin >> numEntered;
while...
but now I am trying to find the average and sum and also the average of numbers over 100.
Ok guys I did it,I just changed j =1
numEntered = 0;
cout << "How many values are you going to enter (5-25)";
cin >> numEntered;
while (numEntered < 5 || numEntered > 25 ) {
if (numEntered < 5) {
cout << "To Few values; try...
Ok I fixed the brace but still not luck
Please help
I have this code and I am trying to make it look like this:
How many values are you going to enter (5-25)? 30
Too many values; try again.
How many values are you going to enter (5-25)? 2
Too...
Ok I am trying to make it look like this but with functions and I am not sure I have this right.
This is my code that I have and not sure if right. Could y'all help?
#include <iostream>
...
So would this be my final product? Does this look like it answers the question?
#include <iostream>
int main() {
string str;
string j;
cin >> str;
So would this be the answer?
string str = "This is the string";
string j;
j = str.substr(0,5);
cout << j;
So could I make the str = to anything I wanted it to be? For example, could it be
string str = "This is the string";
I would think it would be something like this but not sure.
string str;
string pos;
pos = str.substr[5];
Okay, I have a test tomorrow basically over strings. I am very new and in the process of learning. So our teacher gave us a pre-test and gave us all the answers if we asked for them. But I didn't and...
right under main (){
put:
char test;
I am trying to make an easy program but I have it done except it prints off extra data.
while (cin) {
cout << "Enter an even number: ";
cin >> num;
if (num % 2 == 0 && num >=...
can you seriously just put how it should look so I can learn by visuals. I am completely lost.
I can't do this. I have been working on it for about 7-9 hours.
#include <iostream>
int main () {
double value, total;
value = -2.3;
while (value <= 2.9) {
cout << value << " ";
value = value + .4;
if (0 < value)
total = value
So do I need to create a double or float? Can you tell me what I have wrong in my code.
Well I know, after. I don't know the correct space
while (value <= 2.9) {
cout << value << " ";
value = value + .4;
if (0 < value)
total = value
cout << "Sum of negative...
I want it to look like this:
-2.3 -1.9 -1.5 -1.1 -0.7 -0.3 0.1 0.5 0.9 1.3 1.7 2.1 2.5 2.9
Sum of negative values: __
Sum of positive values: __