2,045 Posted Topics

Member Avatar for PDB1982

[QUOTE=PDB1982;1038539]This is going to sound bad, but can you use the terms from my code please.....I'm not sure what you mean otherwise....I'm not clear on function(double & value).....how would I code it cor the radius portion? [/QUOTE] In this case, since your functions are returning values (radius returns a double …

Member Avatar for jonsca
0
82
Member Avatar for Phil++

[code] void Person:: setPay(float thePay) { pay = thePayRate; } void Person::setHours(int theHours) { hours = theHoursWorked; } [/code] Have a problem here with those variable names. Also, does your compiler warn you about iostream.h? Should just be [icode] #include <iostream> [/icode]

Member Avatar for pecet
0
59
Member Avatar for trzypak

Do your liters to gallons conversion _after_ you've read in the liters. As of now you're doing that calculation on the 6th line with whatever garbage is in memory. (so in other words convert the value down in your function)

Member Avatar for trzypak
0
115
Member Avatar for simplyscottif

I think you need to include more headers... no only kidding. First remove that stray [icode] #endif [/icode]. Then put a semicolon after your class declaration. Get rid off all of the header includes except iostream (substitute [icode] cin.getc(); [/icode] for your conio function). If you are using VC++ you …

Member Avatar for jonsca
0
171
Member Avatar for the great

There's another inconsistency when you are trying to dereference your struct members to write to them with cin. First, for multiple accounts you are not using the i value anywhere in your loop. So you need x[i] to dereference your array pointer and then you can just use the dot …

Member Avatar for jonsca
0
87
Member Avatar for Mclovin1234

you need to call [icode] calculateTotal(heads,tails); [/icode] from main. As it is you don't do anything with it.

Member Avatar for jonsca
0
94
Member Avatar for meme 9

Have a look at this thread: [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for abhi_elementx
-3
140
Member Avatar for restrictment
Member Avatar for restrictment
0
374
Member Avatar for skarocks47

Are you using Visual C++? If so, did you try to run a debug build on the other machine? If so, you need the release build.

Member Avatar for jonsca
0
194
Member Avatar for asxoliastos

I found this... Honestly I'm not sure I understand it completely. [url]http://gcc.gnu.org/ml/gcc-help/2008-01/msg00137.html[/url]

Member Avatar for asxoliastos
0
134
Member Avatar for gtrippleb

Scratch... sorry. I think he's right with the while, except use your count variable. You were getting stuck since your for loop wasn't incrementing [icode] itemsOrdered [/icode] but even doing that your count would be off. Go for the while or do{} while(). (when writing this I had missed that …

Member Avatar for gtrippleb
0
116
Member Avatar for UKmason

Return angtorad into a variable, so say [icode] double angrad = angtorad(angle,pi); [/icode] You never actually change angle when you run your function. Use your new value in place of angle in your other functions.

Member Avatar for Fbody
0
270
Member Avatar for samsons17

There's no such thing as subint to my knowledge. Take in the ID as a string, do a substr(0,2), convert that truncated string to an integer (using atoi). There's a slight flaw in your ID scheme though since if the digits are 00-09 the person could be 100 or just …

Member Avatar for jonsca
0
108
Member Avatar for fadia

[QUOTE=fadia;1034721]Hello guys.. I have this tutorial that i keep getting errors on no matter what i've tried.. Would someone kindly check it out for me?! Here is the question: [CODE]# include <iostream> # include <string> void read_student_class(struct student_class[], int class_size) { for(int i=0; i<20; i++) { cin>>csclass[i].studentFname >>csclass[i].studentLname >>csclass[i].testscore; relevant_grade(student_class[i].grade); …

Member Avatar for jonsca
0
108
Member Avatar for manoj.pg

I think he might mean a situation where you could take in a class name from the user and instantiate a class, so in your example above: [code] string classname; std::cin >> classname; (it's invalid but...) classname * cn = new classname(); [/code] I think for a finite number of …

Member Avatar for mrnutty
0
683
Member Avatar for jessicamelillo

Put a counter in with the (appropriate) if statements you've already defined (when a match happens, register one more on the counter). In the end, output the counter.

Member Avatar for jonsca
0
104
Member Avatar for mcap61

You should just be able to substitute your ofstream object for the cout directly. See [url]http://www.bgsu.edu/departments/compsci/docs/write.html[/url]

Member Avatar for jonsca
0
94
Member Avatar for samsons17

Just change ph to an [icode] int[/icode] (it doesn't work because 10-14 aren't chars, they are strings) And you're missing a semicolon after cin.get() and you need to close your switch statement with a brace

Member Avatar for samsons17
0
86
Member Avatar for ured

You're program is trying to get 20 sets of data after 20 different decimal points. I don't think that's what you want. You could move k into your inner while loop to keep track of the total number of digits.

Member Avatar for jonsca
0
108
Member Avatar for axed

This is the best self-contained list I could find: [url]http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier[/url] They seem to cover the ones I remember.

Member Avatar for axed
0
212
Member Avatar for UKmason

With no braces,{}, your while loop is only getting the statement directly underneath it. Start there. You don't want to return a true or false from main as your return type for main is an integer but also doing so will halt your program. Instead, after your if statement, set …

Member Avatar for jonsca
0
137
Member Avatar for samsons17

[icode] cout << setiosflags(ios::fixed) << setprecision(2); [/icode] Sets the display to fixed precision and then fixes the number of digits after the decimal to 2. Any calls to cout after that will have those properties. Use resetiosflags ([url]http://www.cplusplus.com/reference/iostream/manipulators/resetiosflags/ [/url]) to restore the default settings (it might not reset the 2 …

Member Avatar for necrolin
0
194
Member Avatar for samsons17

Explain your confusion a little more. Wouldn't you just add up all of the [icode] product[index].sale [/icode] values then prompt the user for a payment amount?

Member Avatar for samsons17
0
89
Member Avatar for alizee67

Circumference and area are both out of scope in the main() function, and you need to pass in radius to the function. They should probably return floats

Member Avatar for jonsca
0
147
Member Avatar for efecto

Firstly, you should be creating it as a Win32 console project. Secondly, [icode] #include <iostream> [/icode], as iostream.h is non-standard. Start with those and it should give you two warnings and an error. The warnings are about using your two time functions with an _s at the end, which makes …

Member Avatar for jonsca
0
159
Member Avatar for Stefano Mtangoo

[QUOTE=evstevemd;1025684]Hi all, can anyone point me to an offline MINGW installer? [/QUOTE] I've never attempted to install it this way, but check out (scroll down to Manual Installation) [URL="http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite"]http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite[/URL]

Member Avatar for Stefano Mtangoo
0
4K
Member Avatar for cole davidson

Well, your [icode] int n; [/icode] is local to that block so it's going to disappear shortly thereafter. A lot of this depends on the specification of your problem. Can you use arrays? You don't have to, and it's more effective without them, but if that helps you understand then …

Member Avatar for cole davidson
0
614
Member Avatar for BenJammin89

Have your constructor for Gradebook take two parameters, one for the student's name and one for the professors. As you have it, you are setting both the student and professor name to be the name passed in: [code] GradeBook::GradeBook( string name ) { setCourseName(name), setProfessorName(name), displayMessage(); } [/code] should be …

Member Avatar for BenJammin89
0
81
Member Avatar for Lukezzz

Instead of simply counting the periods (dots) in the first if statement, why don't you store the location of the second one and remove it after the for loop exits? Your TextChanged() event will be firing each time you type anyway...

Member Avatar for jonsca
0
101
Member Avatar for racumin

I tried a bunch of things but none worked out.... the compiler seems to want a [icode] Node* (*)[MAP_HEIGHT] [/icode] but putting that in explicitly didn't do it

Member Avatar for Sky Diploma
0
156
Member Avatar for LSUchemist

Get a secure FTP program (e.g., [url]http://www.coreftp.com/[/url] but there are many others, or if your school doesn't use SSH you could use the insecure one in windows,ftp.exe ) and you should be able to log into your shell account and transfer files.

Member Avatar for jonsca
0
96
Member Avatar for aksn315
Member Avatar for aksn315
-1
143
Member Avatar for bpt0004

Based on how you've set it up, your vector<int> for each sample will have two members, say V1(0) = 1, and V1(1) = 2, and another would have V2(0) = 2, V2(1) = 3. So you are correct that you would have to calculate a third vector V3(0) = V1(0) …

Member Avatar for bpt0004
0
2K
Member Avatar for power_computer

It costs and I've never used it but just to throw it out there: [url]http://www.comeaucomputing.com/[/url]

Member Avatar for power_computer
0
159
Member Avatar for Poopster01

Please use code tags [code] [/code] around your code. [code] double hours; rate; [/code] separate on the same line by a comma: [icode] double hours, rate; [/icode] or if you want do [icode] double hours; double rate;[/icode] [code] rate = calculatecharges(double hours); [/code] don't need to give the variable type …

Member Avatar for Poopster01
0
152
Member Avatar for dylank

You don't need ; after your #includes You need a return type for your function definition (and you can omit the return) >= and <= are the only valid ways of writing those operators you need to give an array size for xData and yData just follow the errors that …

Member Avatar for jonsca
1
153
Member Avatar for mcap61

you are assigning your temps TO the record.totalpoints when the temps haven't been assigned any value. also, your temp1,temp2,temp3 are not in scope with the class_avg function. pass them in as arguments. you should only need one while loop, if there is just a set number of records, use a …

Member Avatar for rdrast
0
116
Member Avatar for zemly

#include <iostream> not iostream.h (and using namespace std; or preferably using std::cout; using std::cin; ) main should always return an int As it is you are trying to cram your movietype string into a char... pay close attention to your error message, what is it saying your type needs to …

Member Avatar for mikiurban
-4
450
Member Avatar for pauloselhombre

iQuickAnswer should be a char. it can technically be an int, but that might mess up your comparisons. also, if you are testing for 'y' you should probably test for 'Y' also (iQuickAnswer == 'y' || iQuickAnswer == 'Y'). the same for 'n' and 'N'. your syntax is laid out …

Member Avatar for pauloselhombre
0
133
Member Avatar for lyshao

[code] cout << "The selling price of the dress is " << ch << percentage << endl; //Step 6 sellingPrice = price + (1 * percentage); [/code] you should be calculating selling price before you display it (as of now you are saying it sells at the percentage you entered) …

Member Avatar for jonsca
0
315
Member Avatar for ragnarok511

A great place to start (particularly if you're looking for implementation details) is [URL="http://www.x.org/wiki/"]http://www.x.org/wiki/[/URL] There are loads of other sites that can give you specific info on XLib in C++

Member Avatar for jonsca
0
144
Member Avatar for Phil++
Member Avatar for jack c++

Should be either [CODE]int x = 153; [/CODE] or [CODE]int x; x = 153;[/CODE] if you wanted to declare two different variables on one line you could put: [CODE]int x,y;[/CODE]

Member Avatar for jonsca
0
137
Member Avatar for pocku

I'm not sure which thread library you are using, but even without it you are missing an #endif at the end of your header. I'm not sure if that's the main issue. Are there other errors besides the ones you pasted in?

Member Avatar for pocku
0
164
Member Avatar for jonsca

I'm having a hard time geting access to properties in the var output of the query (I know I can use foreach on the result that I've got but I'm not sure which elements values I'm accessing). I think my query is just plain wrong, so I'd appreciate some help. …

Member Avatar for jonsca
0
219

The End.