No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
9 Posted Topics
If a user inputs a int number, say 150, how would I be able to read each individual number? i.e., I want to read the 1, do some things with it, then read the 5, and the next number...etc. Thanks | |
I need help figuring out if two numbers are co-prime. So far I have this (prime() is a bool function) [CODE]void GetE(int& e, int& result) { int random = rand(); do{ while(prime(random)) { if(random < result) e = random; else random = rand(); } while(!prime(random)) { random = rand(); } … | |
I have a struct as follows: [CODE]struct Database { int accountNum; double balance; int months; };[/CODE] I want to make a vector of this struct, because I want the size to vary. How do I do that? Thanks in advance | |
I have a question: Say I have a text file with a bunch of words on it, say the following: hello baby crap hate ground soul fart hot render Now, if I make a program that requires the user to input a word, how would I go about searching the … | |
Re: To read the name part from one line, do this. ifstream inFile; getline(inFile, studentName); Replace "studentName" with whatever your variable for that is called. This will get the whole string line. | |
So I have this assignment in which I need to use Selection and Projection operators on n-ary relations. The book really doesn't cover it in a way I understand and doesn't explain it in terms of c++, so could someone help me out. Could someone give me a "c++ code … | |
Hi, I have to do a recursive merge sort here. I got the merge sort done (thanks internet...because my book was useless), but I have to print the sublists as output. Here's the instructions: [COLOR="Green"]"The program must first display the list to be sorted. Then it must display the sublists … ![]() | |
I'm having issues doing this assignment. I'm not really sure what's wrong, so hopefully someone can help HERE'S THE CODE[CODE] #include<iostream> using namespace std; class Vehicle { private: int Age; protected: float Price; public: Vehicle(); ~Vehicle(); void setAge(int i) { Age = i; }; void setPrice(float i) { Price = … | |
Hi. I have this assignment and have absolutely hit a wall here. I will give the assignment details, then say what the issue is: Consider a collection of songs in an MP3 library where each song is characterized by artistName, songTitle, album, playTime (in seconds), musicCategory, and albumProducer – hence, … |
The End.