Thanks a ton guys, everything works as planned. Thanks for the help and helping me understand everything. I greatly appreciate the time spent. Here is my nearly final code.
#include...
Type: Posts; User: DHart07
Thanks a ton guys, everything works as planned. Thanks for the help and helping me understand everything. I greatly appreciate the time spent. Here is my nearly final code.
#include...
Alright, so far that makes sense but I am unsure of the syntax for atoi(). Here is my code for that part.
while(! inStream.eof())
{
getline(inStream, getNumbers);
istringstream...
"Easier still, you can simply load each string containing an entire row (including its commas) into the stringstream, then use getline() using the comma delimiter to read from that stringstream into...
Hello, I'm working on an assignment where we are using file i/o. The goal of the assignment is to read numbers that are seperated by commas in a 2 column x 20 row excel file. I am currently stuck...
Yeah, the layout of everything is a bit of a mess, I appologize. The assignment is in two parts, where the first one is just the basic pizza class and I meant to leave the pizza::takeOrder out, but...
In other words change my function calls to versions of this...
customer[numberOfPizzas].setSize(newSize);
If I do that I get an error at that line saying that the vector subscript is out of...
I'm trying to create a pizza ordering system that consists of 2 classes. The first one contains all the information for a pizza, while the second consists of an order system for multiple pizzas. ...
No, I always like to look at other people's code to see how their logic deciphered it. I added the i > 0 check before I read your post so my above code is more or less my final code with the added...
i = 0; //reset counter for new condition
int j = 0; //counter for corrected tempString
for(i; i < size + 2;)
{
if((userString[i] != ' ') && (userString[i - 1] == ' '))
{
if(j == 0)
...
Thanks again for the help guys. This is what I currently have, and it works, but I still want to clean it up a bit.
i = 1; //reset counter for new condition
int j = 1;
tempString[0] =...
That is what I was trying to do with my i2 variable as this notes how many spaces were skipped, at least that was my intention. I understand the shorter string is my tempString and my longer, and...
Another note, my logic is off when there is more than just 2 spaces as it doesn't know how many are going to be there so it can't just add whatever is next. If there is a group of 3 spaces then I...
Good call on the missing conditions, saw that and felt like a dumb ass. We haven't went over flags yet and our book does a pretty vague job on the whole thing. I don't have a lot of faith in the...
I'm having some trouble with my problem in which I'm supposed to take a character array from the console and manipulate it to read correctly using cstrings and a class. Everything works as intended...
Well on a positive note, what you suggested works. I understand the syntax now that it worked, before I must have typoed something because it didn't work and it left me lost. The homework isn't due...
If I were to use the strcmp what would my syntax be for the input in the constructor? And why are they all == 0? I don't follow the logic.
The assignment is to have an overloaded constructor...
I would love to use a string...but those aren't covered until next chapter :( so that still kind of leaves me in the dark. I was originally trying to take input from the console, but that just...
The whole point of the homework is to test an overloaded constructor. If I manually put an int into the constructor it works and I get the correct result BUT I cannot figure out how to get it to...
Point well taken. Thanks for all the help, its greatly appreciated. My program works correctly, and seemingly to myself effeciently, so I'm calling it finished. Thanks again.
Everything you said makes perfect sense now. I think I'm finally starting to understand. My current program is pretty much everything I listed last time, except that I did switch around my get and...
Thanks for all of the help, I really appreciate it. Here is a copy of my "final" and hopefully properly working code. I get no errors and no warnings and my answers come out correct every time I...
I read through my text and various online sources and understand encapsulation. I guess my fault is in how to construct the mutator and accessor functions. I know I can just take the userRadius...
The thing that I never 100% understood was why the SET and GET functions have to be seperate. I don't understand why you can't just have one function to do both. We're supposed to use corresponding...
So in other words my setRadius and getRadius functions are backwards? It makes sense in the sense that my program runs but when I try to pass my userRadius value into set it gets lost after the...
I'm in my 201 programming class and we have an assignment dealing with a class. I have a decent handle on everything so far, but right now I'm stuck with my code and I'm hung up on my class member...