- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 5
- Posts with Downvotes
- 4
- Downvoting Members
- 5
76 Posted Topics
Hey im trying to run background music when the user clicks the button. below is my coding. when i run the program, it says file cannot be found. any help would be appreciated [CODE]import javax.swing.*; import sun.audio.*; import java.awt.event.*; import java.io.*; public class Sound { public static void main(String[] args) … | |
Re: [QUOTE=SpS;155919]Can anyone explain me in simple language and better if with an example [B]why constructor don't have return types :!: [/B][/QUOTE] constructors are meant to initialize your data members in your classes. They dont return any type because that was how they were built and programmed to work. Constructors dont … | |
Re: where have you seen that the precedence of && is greater than ||? | |
Re: if you need to do a select on a specific time, i would keep them separate as it would be easier to do a search for some specific time rather than having to parse out the a string containing both the date and time | |
| |
Re: yea it looks like you are missing some brackets for the first if statment. If you have a single if statment like this: if(condition) statement 0 statement 1 statement 2 statement 0 will be executed only if the if statement is true, however statemen 1 and 2 will always be … | |
Re: think about how a loop could be used to perform factorial of a number n. also if you post some code i'll be glad to help further! | |
Re: "MY PROGRAM DOSEN'T END, IT DOSENT ASK THE USER IF THEY WANT TO PLAY IT AGAIN" you have a while loop based upon the condition of the "done" variable, more specifcally you hvae while(!done), think about when this case evaluates to false and causes your program to exit the loop … | |
Hi. I am trying to write a function that when given a class, will tell you the number of methods that class has. I am getting the java.lang.noclassfoundexception message. I read something about adding to the PATH but was unsure. I also tried using HelloWorld.class, but that did not work … | |
when i execute this code and lets say i enter "hello", then "world", and then "dude", when i traverse through the list, it only prints out: dude dude dude and not this: dude world hello Any help would be much appreciated! #include <stdio.h> #include <stdlib.h> struct Node { void *data; … | |
Re: also make sure "width" variable has some assigned value or it may default to zero or some garbage value | |
Re: i had a lab similar to this once. post some code and ill be glas to help out | |
Re: line 36: this.sendMessage(new String(john").getBytes()); shouldn't it be in full quotations: "john"? | |
Re: just out of curiosity, why is your switch statement set up the way it is with 9 first then 10, 8, ... and so on? | |
Re: write up some code first and then let us know what problems you are having | |
Re: the easiest way to fix this problem is create a Node class. A Node is like a block of data in the list which contains a link to the node before and after it. This Node can pretty much contain anything you want really assuming you have enough memory and … | |
Re: you can also have get methods that just return the value of those variables, one method for each variable, and call those functions to get the value | |
Re: if the volume output part works fine and the # of matches doesn't and te only thing different is division by v2 then check to see where you are using the variable. see if you properly intialized it or not and print out it's value to check | |
Re: please post your driver program as well if you can. from a quick glance it doesn't seem to be looking at the second 10 because you are comparing with greater than or less than and should be using <= or >= so it can detect the second 10, but you … | |
Re: yes do what NormR1 saud. for any class you have, for example your Node class, you can acess the data members by placing a "." without quotations after your object or you could always use a get method to return the data depending if your data is private, protected, or … | |
im trying to overload the operator+= and use that to implement operator+ in my string class. i keep getting a segmentation fault when i try to evaluate something like s1 += s2 where MyString s1("");and MyString s2("hello"); any suggestions as to why this is happening? this is my operator+= function … | |
is this a valid statement in in c: &main, where main is int main()? If so why? | |
i have this code for adding a node after the previous node, but valgrind is saying that there is a memory leak of 16 bytes, can someone please help me identify where the leak is? i think i didnt assign a null pointer somewhere but im not sure exactly where … | |
Hey I am making a game and i can make the character jump, but i am trying to make the character land on an object. I am trying to do this with object collision but im not sure how. My code for jumping for an image with a certain height … | |
Hey people. I recently downloaded Visual Studio 2010 Express and the XNA Game Studio 4.0 to try to make a game. Whenever I hit new project and create one I keep getting the error message. Any help would be amazing. | |
hey i am making a game and i wanted to see it as an exe file so i took the java code, creater a jar file, and then created a exe file. When the program runs on my computer it works fine, all the images load since they are on … | |
Here are my questionsand my answers. Could you guys/gals tell me if i am right or wrong? Which array-based operations are O(1)? inserting item or deleting item in unsorted array Which linked-list operations are O(1)? inserting and deleteing item in unsorted lsit Which array-based operations are O(n)? traversing through the … | |
Hey guys/gals for some reason in my main function my first while loop will not take in more than two values. any reasons why that wont happen? and just to be on the safe side, did I implement my remove function properly? [CODE]#ifndef SORTEDLIST_H #define SORTEDLIST_H #include<iostream> using namespace std; … | |
Hi guys. For some reason I cannot get the linked list to print. I want to copy it(which works) but I cannot get the list to print after copying it. Any suggestions? [CODE]#include <iostream> using namespace std; struct node { int info; node* next; }; int main() { node* list; … | |
can someone help me with these compiler errors? im not sure how to fix them. intset.cpp:16: error: prototype for âIntegerSet::IntegerSet(int*)â does not matc intset.h:6: error: candidates are: IntegerSet::IntegerSet(const IntegerSet&) intset.h:9: error: IntegerSet::IntegerSet(int) intset.cpp:7: error: IntegerSet::IntegerSet() main.cpp: In function âint main()â: main.cpp:36: error: invalid conversion from âint*â to âintâ main.cpp:36: error: … | |
Re: this code can be reduced greatly. i made my own tic tac toe game that is much simpler than this using classes | |
Re: its you choice:string or char arrays....but using string is mostly better unless you are checking to make sure the person entered only a specific number of characters like only 2 chars rather than 3....but just go with strings and you should be fine | |
Re: how about you try yourself first and the post what you have. I do all my work myself and you should too....lazy. Nothing gets handed to you unless you pay money. | |
Re: Would you ever be interested in a c++ programmer. I'm halfway through college and searching for an internship. Just wondering if you would ever need one. | |
Re: dont matter. same thing its like sayin a*b versus a * b....its the same thing except for where the space is. the compiler wont care for a space in that situation | |
Re: strings unless you want a limit to how much people can enter, then i would use char arrays | |
Re: prevents u from rewriting code multiple times, helps code maintenance, use can declare header files in any of yours files, without them you really coudnt use cin, cout, etc unless you made your own header files | |
hey guys/gals. how do i save to a file the data that is printed by this program i wrote. I have the code to do this in the createFile function but i am unsure in how to output what was printed. Any suggestions? [CODE]//class member functions #include "experiment.h" Experiment::Experiment() { … | |
hey guys/gals. i get a segmentation fault whenever the for loop in the print function is executed. any suggestions? im not sure what i did wrong. [CODE]//class member functions #include "experiment.h" #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> using namespace std; int Experiment::numberOfTests = 0; Experiment::Experiment(){} void Experiment::setExpName() { … | |
In my experiment.cpp i have Test *tests[maxTests]; as private data. How do i access this in my runExperiment function to call functions from the test class or its derived classes? | |
hey guys/gals im havin a problem in my test.cpp file in line 65 where i have cout << date.print(); the compiler says: test.cpp: In member function âvoid Test::print() constâ: test.cpp:67: error: no match for âoperator<<â in âstd::cout << ((const Test*)this)->Test::date.Date::print()â where am i making a mistake because i have <iostream> … | |
Hey guys/gals i need some help with finding the T(n) complexity of the following for nested loops [CODE] sum = 0 for i = 0 to n-1 do [INDENT]for j = 0 to (i^2) - 1 do[/INDENT] [INDENT][INDENT]for k = 0 to j - 1[/INDENT][/INDENT] [INDENT][INDENT][INDENT]sum = sum + 1[/INDENT][/INDENT][/INDENT] … | |
Re: > start quote: if (ServiceType == 'r' || 'R') { cout << "Enter number of minutes used for Regular Service: "; cin >> RegServiceMinutes; } else { cout << "Enter number of day minutes used for Premium Service: "; cin >> PremDayMinutes; cout << endl; cout << "Enter number of … | |
Re: > I need 5 T or F questions with the option to input the answer and then add the correction to answer if right or wrong. > i just need random questions! > > I am thinking of going to school for computer programming and my FIL is a programmer. … | |
Re: [QUOTE=Salem;1193353]So where exactly are you stuck? Can you - read a number from the user? - read several numbers from the user? - allocate memory - yada yada You can't just say "here's my homework - I'm stuck" without actually posting where you are stuck.[/QUOTE] u should use a sorting … | |
Re: in ur .h file u need to do something like this: [CODE]class Complex { friend ostream &operator<<( ostream &, const Complex & ); friend istream &operator>>( istream &, Complex & ); public: //ur stuff private: //ur stuff };[/CODE] u should declare the input and ouput operators as friends of the … | |
Re: yes use the sed width functions within the #include<iomanip>....google it to find out more | |
Re: you could just make a header file and include that into you program if your using classes and stuff....of course that was a very general explanation. If u want send me your code and ill look at it |
The End.