139 Posted Topics
Re: Look at the motherboard for capacitors that are round on top. There are web sites that advertise they will replace capacitors (the names elude me currently) but it's expensive, and you're better off buying a new motherboard if that is the case. | |
Re: What are you using to rip the DVD? | |
Re: >>1. the number of strictly positive values read (those greater than zero) >>2. the number of strictly negative values read (those less than zero) Your code is correct for the above. >> 3. the total number and arithmetic mean (average) of values read Use two variables. The fist will be … | |
| |
Re: Why are you trying to execute those commands in a class definition and not in a function, or in main itself? You also did not declare an object of PasswordSystem. What is [code] PasswordSystem.Shazam(); [/code] ??? You have no static function called Shazam to execute. | |
Re: Look at the motherboard, check the capacitors. If the tops of them are bubbled up or there's something leaking from them, the motherboard is bad. Also, try removing your video card, and running with on board video. Also, current PC's may need 350 watt powersupply. Check the model of your … | |
Re: I'm assuming you are looking for an algorithm? Are the word insertions and deletions prompted for and controlled by the user? If the editing is controlled by the user, it's pretty easy. You just need to read the string in from the cin, seperate the word being inserted/deleted from the … | |
Re: for your insertion and bubble sort, you are returning the comparison value, but you are not assinging it to anything when that value is returned. In your main [code] insertionSort(copy_integers_1); [/code] Change that to: [code] int compInsertion = 0; ... compInsertion = insertionSort(copy_integers_1); [/code] and do the same with your … | |
Re: is degree declared elsewhere? Also, you aren't assinging the static cast anywhere. x is still int, and degree is still whatever it is wherever you declared it. You would need [code] double value = static_cast<double>(x); double deg = static_cast<double>(degree); [/code] | |
Re: [code] class Car { private: int yearModel; string make; int mpg; public: Car(int, string,int); //constructor #1 Car(int, int, string); //another constructor #2 Car(string, int, int); //another constructor #3 Car(); // def constructor prototype #4 }; [/code] ALL constructors take on the name of the class. You can have 20 constructors … | |
Re: It looks like you want each node to point to the two below it, and the one above it. In your code, you have [code] f = new formula; f->id = 1; f->op = 0; f->oe = 0; [/code] This is a syntax error. You need to declare f as … | |
Re: If it doesn't compile, my suggestion is to use the same compiler that your teacher is going to use. If your teacher uses turbo c++, then you are better off using that. It's possible to write a program that will compile on your PC, then have your teacher try to … | |
Re: Make an attempt, and we'll trouble shoot your code. We aren't going to write it for you. | |
Re: You don't need one, it auto initializes everything. Your functions are messed up though. In your class you have [code] double getRadius(); double CalculateArea(); double CalculateCircumference(); [/code] You need a return statement in each one of those. Also, you need to assign what is returned to a variable. I think … | |
Re: [code] #include <iostream> #include <string> using namespace std; string myfunc(string s){ { if (s.compare("banana") == 0) { return "Good String"; } return "Bad String"; } int main (int argc, char* argv[]){ string s = "oranges" string a = "" a = myfunc(s); cout << a; } [/code] The compare returns … | |
Re: Sounds kind of random. Are you on electric power or battery power? Make sure your coord didn't come unplugged, and the battery was low. I've done that in the past numerous times, especially if you use a surge protector connected through your power coord. The only time I've seen a … | |
Re: In your struct Doctor, you have a declaration [code] sting Do; [/code] I'm pretty sure you can't do that. Do is a reserved word. As for your add_student function, I'm assuming you want to add the students onto your doctors, and each doctor will be the start of a linked … | |
Re: *deleted* Sorry, must have hit submit before completing actualy post which is below. | |
Re: Put your code in code tags .... [code] for ( int e = 0; input[e] > avg; e++) count++; [/code] Like that ... it's easier to read. Also, that for loop is your problem. Assume your input is 2 numbers: 0, 100 ... your average will be 50.00 input[0] = … | |
Re: Hey, First thing I noticed is that sum isn't initialized. It's possible to go through your nested for loops and for it to find no comparison. It will then cout an uninitialized variable on line 43. For that mater, I don't think you initialized k either. Set k = 0 … | |
Re: 65 - (61 + 0) = 4 66 - (61 + 2) = 3 67 - (61 + 4) = 2 68 - (61 + 6) = 1 | |
Re: Hi, Put your code in code tags, it helps when reading. The answer is staring you in the face. [code] fullWord = oneWord + ", " + twoWord + ", " + threeWord + ", " + fourWord + ", " + fiveWord; [/code] Change the order of that to … | |
Re: Are you attempting to do this from a command line or running the program and then picking apart the input from there? Running from a command line is easy. Picking a string apart inputed after the program is ran is also easy, but a bit more involved I think. | |
Re: [code] ifstream in; // Create an input file stream. in.open("data.txt"); [/code] that will open data.txt as read only. If you want to protect the file from being written over, I suggest you modify the properties of the file, or (if using windows) go to a command prompt, go to the … | |
Re: You need to include the switch statement in your do while loop otherwise, you will never exit the do while loop. Also, with your switch statement, everything in your default will never run. [code] //None of this code will ever run. If you enter a number to break your do … | |
Re: Going through how to optimize code would take months to explain. Linear code is linear code. Both statements take x amount of time. Avoid many nested loops. If you have code, it would be easier to explain where your coding might be inefficient. Edit: If you just want to know … | |
Re: You have a logical error in your sort. In your main, you leave name[0] unused but in your second for loop, you don't take that into account on your variable num. [code] void sortnames(string name[], int num){ int i,a, min; string strName; for (i = 1; i <= num; i++) … | |
Hi there! My name is Ken, and I'm an old (not age) C++ programmer. I went to school for it, and it's been about 7 years since I've actually programmed anything hard, so I figured a forum would be a great place to relearn alot of it by teaching what … | |
Re: Edited because I was wrong: You can call someFunction by s1.someFunction(s2) and have it return whichever value you want, but you will still need to make it a void function if you want both values returned. It would be easier to make a seperate function to access s1's b vaule. … | |
Re: Create a structure to hold all the information and a linked list to contain the structures of each individual. You may need to create 5 special functions in the class that returns the number of people under 20 (1), 20-29 (2), 30-39 (3), 40-49 (4), 50 and older (5). Step … | |
Re: A few things here .... First, wrap your code in code tags. It makes it easier to read. Secondly, what kind of error are you getting? Thirdly, I noticed that your while loop runs until temp != Null but two lines down from that you try to reference temp->next->word. If … | |
Re: [QUOTE=Fbody;1331701]Your intent is a little confusing, it sounds like you want to add multiple items to the same element of an array. Which is not directly possible. [/QUOTE] Actually, I think if you create a structure, and then create an array of that structure, you can do what the op … | |
Re: If [code] cout << songname << endl; [/code] works as intended and prints the song names on each individual line, then the send function is missing the endl. Is send in a library or a function you created? I'm not familiar with it if it's from a library. | |
Re: The value is returned to the location where the function call came from [code] total(num1,num2); [/code] However, you didn't assign it to a variable. The return statement returns the value sum to the function call. You can do it two ways, either set the returned value to a variable declared … | |
Re: Alt + F3? [url]http://msdn.microsoft.com/en-us/library/0zz35x06(VS.80).aspx[/url] Or maybe Ctrl+K, Ctrl+L? [url]http://www.codeproject.com/KB/tips/VSnetIDETipsAndTricks.aspx[/url] That's all I could find. | |
Re: Can't you just get rid of all the if statements, and use [code] cin >> sp[index - 1].name >> endl; //etc ... [/code] And then the same concept for the viewSpeaker? | |
Re: Ok, I'm a bit out of practice, so if I'm incorrect in my information, it would be helpful if someone corrected me here. It looks like you need to add a new node onto the linked list with the student name, the university, and the id. That is what you … | |
Re: [QUOTE=lilfish08;1304204]I am fairly new to c++ and have been working on this problem and asked the professor for help, but he has really been non-compliant. I am lost on this and keep gettin error messages that I do not understand how to fix. Any help that could be given would … | |
Re: [QUOTE=miskeen;1304154]Guys, I got an error with the following code: [CODE] struct myStruct { int myVar1; }; class A { //definition of A ... }; [/CODE] [CODE] struct myStruct { int myVar1; }; class B { //definition of B ... }; [/CODE] [CODE] struct myStruct { int myVar1; }; class C … |
The End.