Heres how i would do it. Use this as an example but this makes the most sense for me. You can probably do it a few other ways too.
#include <cstdlib>
#include <fstream>
#include <iostream>...
Type: Posts; User: kordric
Heres how i would do it. Use this as an example but this makes the most sense for me. You can probably do it a few other ways too.
#include <cstdlib>
#include <fstream>
#include <iostream>...
Okay so here is what i have. It is suppose to search both male names and female names. But if it finds one it displays that one and not the other (Some names work for boys and girls). What should i...
How would i make it continue i can only seem to get it to go all the way through and used the last one it found.
Okay i need some help, with my original code using arrays i got this:
Enter the first name, to see popularity:
Justice
Justice is ranked 406 in popularity among boys.
Justice is ranked 497...
My goal here is to convert this into a linked list, I really am trying to understand all the different aspects, and this is what im trying to learn right now. This is why i was asking specifically...
So im trying to convert this program, to use pointers and linked list. I really have not done anything with them so im here to ask for help!
Here to read and pop the array.
// Read names...
Thanks for all you help vart, i got it all finished, using ideas you gave me on how to structure it. I didnt use vectors though. I thank you for your time and patience
Can you explain that line by line, im realyl having trouble understanding what is going on with what you are posting.
Well basically i have a list with rank boy name and girl name.
example line would be like
1 Jacob Emily
i want the user to enter a name, and it would display like
name is rank 1 in boys...
Is there a way to not use a vector and use an array? Im way to new to programming and i really dont understand vectors.
okay, so then after that i would need to have my
std::ifstream names_txt( "babynames2004.txt" );
right?
So would i use a loop to go through the vector or is there a different way since...
Honestly i never used a vector for anything, i have no clue how to use them.
How would i fill the std::vector<Record>?
Okay good, so far i have that right. Now i need to build around this a way for a user to input data so maybe something like
cin >> boy, girl;
This so if they enter a name it will look at both...
Okay, and that would store the entire name no matter what length? so for example lets look at the first line
1 Jacob Emily
it would see from
names_txt >> rank; the first number 1.
then...
int number;
char boy[20], girl[20];
ifstream names_txt;
names_txt.open ( "babynames2004.txt" );
names_txt >> number;
names_txt >> boy;
names_txt >> girl;
Thanks...
Yeah im not using that method at all, it doesnt make sense to me, i edited my other post.
Now that i think about this it wont work cause i need people to search for names and have it display the name and its rank. For example heres is 1 -10 rank names
1 Jacob Emily
2 Michael Emma
3...
Thank you for the reply s im going to start working on this in sections, typically its chaotic because i write it all, it half works and then i debug it.
the txt file contains a list of...
Hello, im trying to write a program that takes the names of people, on a ranked external list, from there if a user types in a name if its on the list it displays it, with its rank. I think using an...
What would got in between the for's ()? I having trouble with this part as well.
Thanks, this helps a lot. The avgs just adds the score to the previous amout then right?
Hello, Thank you for looking at this with me.
Im currently writing a basic basic program to sort of take a couple grade for test, quizzes etc, display the results for each student entered, Ive got...
For some reason everytime i run my program the answer is always B. Im not sure why this is, please help!
//Figure out letter grade
if (the_student.percentTotal>= 90)
{
...
Is there a way to have it auto grab how many entries have been added, for each student?
for the size it will vary each use, so i was trying to make it unlimited.
What should i use instead of malloc ?