I have to create two classes CPU and Computer. The CPU.h and Computer.h needs to be different files than the CPU.cpp and Computer.cpp. I believe I created my files correctly however in my Computer...
Type: Posts; User: matt_570
I have to create two classes CPU and Computer. The CPU.h and Computer.h needs to be different files than the CPU.cpp and Computer.cpp. I believe I created my files correctly however in my Computer...
I think I understand what you're implying, however after working on the function again today for hours I'm still having the same problem. I ended up with three different functions and none of them...
Ok thanks, I shoud have overlooked it. I have my option menu working fine, but it seems like my insertAtIndex function is not working properly. I can add one new element fine but when I try to add...
I need to create a linked list of customer data. One functions needs to insert a new customer data at the location indicated by the parameter "index". If index is 0 then it should be inserted as the...
I have to write functions that manipulates an array containing numbers (doubles).
I have to use pointers for all arrays to do this.
One function prints the array, the next one triples each...
I had to define a simple macro for class in the professor's code
Heres the code -
#include <stdio.h> //this is to call printf() function to put output
#include <time.h> //this is to call...
Thanks for the quick reply. I started messing with "outFile.put(out_file_name);" but that didnt work. Out professor told us only to read the first two chapters on "I/O File Streams and Data Files"....
I'm now trying to write my stats to a text file, but its only writing two of the stats, and those stats come from the same function.
Heres the code -
#include <iostream>
#include...
Thanks a lot, that helps a lot. I'm on my last stat, I have to find the most commonly occuring word(s). Heres my function-
void commonWord(double count[], int array_length, words array[])
{...
Ok, heres my revised code-
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
You would be better off not ever writing a duplicate word to your array. You can do this by reading a line and then searching your array of words for the just-read word. If found, bump the word...
I need to compare words in a text file. In the text file there is only 1 word per line. I need to store the words, count the unique words, and do some other stats. I just realized that my strcmp will...
Thanks you that worked. I'm now trying to use strncmp to find out the number of unique words (or lines) in the text file. I tried to use-
for( j=0; j<101; j++)
{
n = strcmp(...
Sorry about the first post I wasnt clear with my question. I'm still having trouble on the storing part.
I want to store a text file line by line, where theres one word per line. I tried to store...
Hey I have to write a program that reads a text file that contains a list of words, 1 word per line. I have to store the unique words and count the occurrences of each unique word. When the file is...
OK I got it, thanks for the help. However this assignment just keeps on getting harder and harder. I have 3 more functions to complete.
Function1:
I have to print the positions of the three...
Ok I have this-
void printArray( int array[], int number)
{
for (int j=0; j<number; j++){
for (int i = 0; i<10; i++){
cout<< array[j]<< ", ";
Thanks for the help. However I have a new problem. I thought this part was going to be easy but its hard.
I've been trying all day to come up with a for loop to do it. I have a bunch of...
Hey I have to build a random number array, heres the exact problem-
I'm on the first part. My code is this-
#include <cstdlib>
#include <ctime>
#include <iostream>
Hey I'm trying to compile my program, but I cannot figure out this compile error, I've spent almost 2 hours now trying to figure it out.
Heres the code :
# include <iostream>
using...
That's what I thought at first, but D was basically B + C together meaning it always had (input * 2) - 1 for the number of lines. For example if the input was 5 the number of lines would be...
Thanks for the help, I was able to get shapes A-D, but now I'm having trouble on E.
Heres the code so far-
#include <iostream>
using namespace std;
int main ()
{
Ok I accidentally used "i" for both variables.
Right now I tired to code a couple different solutions and non seemed to work. ( I tried to write algorithms yesterday and came across thinking they...
wouldn't it be
for (i=0; i < 5; i= i +2)
I think the main part I'm having trouble with is the "endl;"
for(i=0; i<5; i = i+2)
cout << "+";
Hey I enrolled in an online beginners C++ this semester. I think I made my first mistake by taking my first programming class online.
Anyways we've had assignments in sequence and selection...