1,608 Posted Topics

Member Avatar for lewashby

Command line arguments are used when you run a program from the command line, typically when you see a C:\ and enter something like HeloWorld hello world to get C:\HelloWorld hello world That would mean you wat run a program called HelloWorld which is located on the C drive and …

Member Avatar for Lerner
0
128
Member Avatar for brock.holman.7

It takes more than that to provide any shock value. Nice try though. Hope you had fun.

Member Avatar for Lerner
0
113
Member Avatar for rebellion346

you don't have to use complex numbers if you don't want to. Define the equation using variables of type double and check if 4*a*c is less than b*b before running solving the full equation. If that relationship doesn't hold, then notify user that the equation can not be solved using …

Member Avatar for vencen
0
2K
Member Avatar for new_developer

add a default constructor to class childB that initializes balance to -99 and see what line 51 shows. Place a line in the class bal default constructor like cout << "default constructor class bal called;" to see if it is called by line 48. Experiment to see what happens.

Member Avatar for Lerner
0
294
Member Avatar for Memo143

alright, type this in your code and see what happens: int charEquivalent = 'a'; cout << charEquivalent; Bottom line, you don't need an array of pointers to type int. You just need an array of ints. To get the output you want you can use an index int: for(int index …

Member Avatar for Schol-R-LEA
0
127
Member Avatar for highonbikes

1) stack<double> valStack; declares valStack to be a stack that holds objects of type double, so why do you need a offset? 2) Numerical offsets can be cute/convenient to convert an individual digit to an int value but, unless you are working with indivual single digit numbers with values 0-9, …

Member Avatar for Lerner
0
838
Member Avatar for pepsi123

There is no one way to create lists. Some are implemnted using arrays, and they will have the underlying attributes of arrays. Many lists are created using user defined types generically called structs/classes, which by your post, you know at least something about. These types are frequently called nodes. A …

Member Avatar for Lerner
0
157
Member Avatar for Sasquadge

Your declaration and function call for add() are wrong. To make add a method of class fraction define it something like this: fraction add(fraction rhs); and call it something like this: total = fraction1.add(fraction2); I suspect that this: total = add(fraction1, fraction2, total); ignores everything to the right of = …

Member Avatar for Despairy
0
235
Member Avatar for mozala

To answer your specific question, as a start, it would be helpful to indicate what the warnings are and what code you think the warning refers to. In a more general sense, I think you need to think about the relationship between what you refer to as phonebook, record, and …

Member Avatar for Ajexa
0
569
Member Avatar for superchica08

Say you have two lists with nodes at addresses a, b, c, d with a pointing to b and c pointing to d: a->b and c->d. To addend c->d to a->b point b to c using b->next == c and d comes along for free. To add the values in …

Member Avatar for Lerner
0
1K
Member Avatar for RonKevin

>>-when i add a space or if i put my second name it immediately goes to last name Provide sample input, expected output, actual output. You may need to use a different input method, say getline() instead of >>.

Member Avatar for RonKevin
0
360
Member Avatar for tensity

The third argument for getline() is the termination character, that is a variable of type char. Variables of type char can be indicated by using single quotes, ''. Double quotes indicate a variable of type string. The default termination char is the newline char, '\n', so you don't need to …

Member Avatar for tensity
0
217
Member Avatar for eggsandbacon

In general assignement should not be done if you are trying to assign something to itself. If you aren't then you want copy data from the rhs to the lhs in the same order in rhs. One way to do that is to copy the data in the rhs list …

Member Avatar for aranayd
1
1K
Member Avatar for poloblue

while(low <= high)/2; This line has multiple errors. Redo it and recompile.

Member Avatar for NathanOliver
0
280
Member Avatar for Transcendent

Here's one I'm trying out: http://introcs.cs.princeton.edu/java/home/ Seems well thought out, a ton of information on both beginning Java and computer science in general. There's lots of pre written code to look at/copy to your software and plenty of exercises to do. There's a companion Algorhithms option when you get done …

Member Avatar for Lerner
0
97
Member Avatar for dakoris73

getData() needs to collect 4 pieces of data, two for each Point in the line, m_Left.m_Xcoord, m_Left.M_Ycoord and similarly for m_Right. In order to do this: cout << aLine.m_Left; you need to overload the << operator for the Pointer class.

Member Avatar for subith86
0
131
Member Avatar for lxXTaCoXxl

Parsing strings is a powerful tool. Using strtok() is one option to help, but often isn't the best option. When you don't know the number of inputs ahead of time you can use an array that is big enough you never expect to fill it to capacity or you can …

Member Avatar for lxXTaCoXxl
0
301
Member Avatar for ashboi

Since you want to use Student objects in Course, you need to tell Course about them by including the header file for the Student class in the Course class. It's similare to what you did for the vector class.

Member Avatar for Lerner
0
185
Member Avatar for henri18

for each card with index zero to 4 //control card A for each card starting at the above index + 1 going to index 6 //control card B if card A equals card B increment counter after the inner loop is finished if counter equals 3 you have 3 of …

Member Avatar for Lerner
0
484
Member Avatar for suhasgh

Why the call to erase()? Everything else looks okay to me on first run through.

Member Avatar for DeanMSands3
0
237
Member Avatar for phorce

add another variable (or two or three or however many it takes) to keep track of the lowest value of corr and the values of i and j that were used to calculate that value of cor. Use a control statement to help yourself out. if current corr less the …

Member Avatar for Lerner
0
160
Member Avatar for adeel381

Do you want to know the mechanics of how to use a recursive function or under what conditions is it useful to use recursive functions?

Member Avatar for TrustyTony
0
144
Member Avatar for Griff0527

To edit files you either have to write the file to memory, edit, and rewrite the whole file back to HD or, if the file contents are entirely predictable and the information replacing the original consumes exactly the same amount of information as the original, then you can access the …

Member Avatar for Lerner
0
2K
Member Avatar for james6754

BB = A + B; + is overloaded as a member method instead of a friend method. + returns a Matrix called temp. > Once temp returns...it calls the copy constructor...passing temp as 'rhs' and 'this' would refer to 'BB'? (Am I right in thinking this?) To my thinking, in …

Member Avatar for Lerner
0
262
Member Avatar for dariaveltman

declare temp as a char array of size 30, just like each name[i]. You can't use <,>, or = on C style strings (you can on STL string objects). Use strcmp() and strcpy() as needed. They should be in the cstring header file, if I remember correctly.

Member Avatar for Lerner
0
248
Member Avatar for pclovechristian

I'd take vector<int> list out of the Sphere class. I'd declare a vector of Spheres in main() instead and then I'd maker variable a stand alone function and use the loop to the user enter as many radius as they want and use each entry to create aother Sphere that …

Member Avatar for Lerner
0
135
Member Avatar for Kulasangar

An abstract class is a concept, not a real thing. It's a verhicle or art, or beauty. The technical definition you should look up, 'cause this sounds like a homework question.

Member Avatar for mrnutty
0
140
Member Avatar for samiam5976
Member Avatar for samiam5976
0
113
Member Avatar for caltech

IIf you are going to use sort() then you need to overload the less than operator for the Records class or create some other function to compare two Record objects----say compareNames() or something. If you are going to do some othe sort routine, say a bubble sort or whatever, to …

Member Avatar for Lerner
0
613
Member Avatar for anonymous1987

Remove zero from One and make One[0] "" Put "ten" in Teen[0] instead of in Tens; Declare an array of three ints called digits to hold the digits in result (will work for value of result 0-999 Declare a string to hold the string version of result If result is …

Member Avatar for Lerner
0
175
Member Avatar for pendo826

Start commenting out functions and/or declarations until you find it. When writing code compile at least every time you write a new function (if not more often).

Member Avatar for TrustyTony
0
400
Member Avatar for noorah

I'd use another set of variables to keep track of the total value of the ints in both stacks and use those result to determine where to push the next input.

Member Avatar for Lerner
0
232
Member Avatar for benclifford

the compiler will call the destructor when appropriate. You (almost) never have to do it. The compiler will provide a default constructor for a user defined type. However, if you declare a destructor for the user defined type, as you do on line 14 of smurfvillage.h, then you should define …

Member Avatar for Lerner
0
363
Member Avatar for isaacjun16

Beware when you mix input methods. >> doesn't remove the terminating newline char from the input buffer leaving them around for gets() or fgets() or getline() to see. gets() terminates input into the desired variable when a newline char or EOF is found. That means if >> is called before …

Member Avatar for isaacjun16
0
269
Member Avatar for KrossFaith

Create a container (probably a large array, to hold the largest number of marks that you could reasonably expect to read in) to hold all the marks as they are read in so you can search the data as desired, or create variables to hold each of the desired and …

Member Avatar for Lerner
0
370
Member Avatar for dkXIII
Member Avatar for Tommeh
0
271
Member Avatar for qwerty__

i dont know how to loop it so the user will be asked to choose from the selection menu above after completing each selection task the answer(s) is/are here: • Loop your program so that the user will be asked to choose from the selection menu above after completing each …

Member Avatar for WaltP
0
524
Member Avatar for Slavrix

fMat indexes equals cMat indexes each line gMat indexes increment by one 4 times a line gMat indexes remain same for 4 lines, then increase by 4 for the next four lines fMat is incremented by the product cMat * gMat 4 times each line for(int i = 0; i …

Member Avatar for raptr_dflo
0
996
Member Avatar for won212

When I look up 102 syntax error it relates to improper syntax after last legal syntax in command line arguments. If you are using the command line to open the program instead of the IDE then post the exact syntax you use on the command line. Please post the exact …

Member Avatar for Lerner
0
117
Member Avatar for c3r3alki113r

Welcome to Daniweb. Many of the routine people who respond won't download code from the web so it's best to post it here. Use your debugger or toss in output statements to keep track of variable values as you go through the program to try to track down where the …

Member Avatar for c3r3alki113r
0
207
Member Avatar for Sibuns

So, other than row 4 (aa) it looks as though you exchange columns based on the results of sorting the first row. Is that the effect you're after? If so, then the swap during the sort needs to be for each row all at the same time. swapColumns(matrix, c1, c2) …

Member Avatar for Sibuns
0
143
Member Avatar for phummon

Another option would be to create a location class which has an identifier, and maybe other useful information, as well as a vector of employees as member variables. Then use a container of locations, search the location by some identifier and use just a single accessor function.

Member Avatar for phummon
0
212
Member Avatar for pjh-10

Here's another "experimental" approach, in pseuocode: declare an array of type bool, size 1000---say boolArray. declare an int called numSelectiions 1) set boolArray to all false 2) set numSelections to 0 3) pick a random number, i, between 0 and 999 4) increment numSelections by one 5) if boolArray[i] is …

Member Avatar for pjh-10
0
443
Member Avatar for Runnaz

Double posts are discouraged,particularly when done intentionally. What don't you understand about part 7?

Member Avatar for Lerner
0
223
Member Avatar for Nathaniel10

Avoid use of global variables whenever possible. start() is declared/defined with return type int, but the return value in main() is ignored.

Member Avatar for Nathaniel10
0
87
Member Avatar for BryantFury

Aside from the obvious disconnect between the stated goal of having a students name and grades as member variables for the class rather than name, model, price as member variables, the answer is classes default member variables and methods to private access whereas structs default member variables and methods to …

Member Avatar for BryantFury
0
145
Member Avatar for Runnaz

welcome to daniweb. We try not to give full solutions to homework problems. So post what you've tried or indicate what specific concept/task you don't understand and any error message you may be getting and someone will probably step in to help.

Member Avatar for Lerner
0
106
Member Avatar for phorce

Please explain your goal more precisely. I understand it as follows: STEP 1: 00 1 Assignment of numerical identifiers for each 2 x 1 matrix to be combined 11 2 into a 4 x 4 matrix. Note this could also be an 8 x 2 matrix. 01 3 01 4 …

Member Avatar for histrungalot
0
105
Member Avatar for dark_sider_1

I've never used GLSL but a simple search using Google came up with the 3 websites I use when using plain old OpenGL. Seems as good a place as any.

Member Avatar for dark_sider_1
0
282
Member Avatar for bathtubbuddy

I agree with both of the other responder and would add, if this isn't a homework assignment, ask yourself if an array is the best container for you to use.

Member Avatar for Lerner
0
213

The End.