2,827 Posted Topics
Re: These are some pretty long files. Don't have time to look at them right now, but will have time later today. Consider copying and pasting them (preferably an abridged version) into a post. To use code tags, do this: [noparse] [code=JAVA] // paste your code here [/code] [/noparse] This will … | |
This is my first shot at running an executable program from a web page. The program is going to get a lot bigger, as will the web site. I have xampp installed and I am using that. I have two simple files: C:\xampp\htdocs\execlink.html [code=html] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 … | |
Re: [code] cin >> height; cin >> x; while (x = 1) { height = Get_Number(); } [/code] You have an infinite loop here. Once you enter the while loop, you will never leave it. One, I believe you are mixing up the assignment (=) operator and the equality operator (==). … | |
Re: [QUOTE=rickilambert;560043]Hi, my question is, if i have a text area with a set of printed code, for example spurs vs chelsea man unt vs arsenal liverpool vs everton and then underneath i have two text boxes hame and away, how do i send the valeus for the home team to … | |
Re: [QUOTE=gallantmon1;559628]I just want to ask if is smart or even possible to use a switch case statement in a program where the user will not be required to input anything, but instead the program gets the input from a *.txt file. This is a suggestion by my friend, I just … | |
Re: If you have 9 as the number of elements you are interested in for the average, I would set up a sum variable, initialize it to 0, then set up a loop that repeats 9 times. Each trip through the loop would access a different element of the vector (design … | |
Re: [QUOTE=hajjo;555595]Hey guys below a program that I have as my homework.I am not askign for the code, but on how the calculatio is being done.I am asking about the mathematics part.I dont understand how it is being caluclated. someone told me i need this formulas. P = (rho * g … | |
Re: [QUOTE=aminit;557301]Hello : Thanks for your answer, but why *(q+i)=*(q+(i-4)); what's (4) mean??? Thanks a lot[/QUOTE] amitahlawat20 is using pointers. q points to the memory address where a character is being stored and is using that memory address to figure out where other characters are stored and manipulate the contents of … | |
Re: [QUOTE=dreamgirl;558155]but the prob is that the program is stored in a files so how can i call it in a void function?? am really confused[/QUOTE] All programs are stored in files. Where is the data stored? In a file? Is it typed in by the user? Is there more than … | |
Re: [QUOTE=bwjones;557385]ahh i c. So [B]rem-=50 is rem = rem-50? [/B]and [B]rem+=50 = rem=rem+50?[/B] I'm a complete noob to programming and with an instructor who assumes the class is on his level when 3/4 isn't learning all this from scratch is a bit intense so I might show up with stupid … | |
Re: [QUOTE=harishankarb;557633]what do u mean by that mr dragon[/QUOTE] He means click on the link, go to that manual page explaining how to use that function, read how it works, check out the example that link provides, experiment with it to see if you can make it work for your particular … | |
Re: [QUOTE=rahul.b123;554613]I'll not be using it for destructive purpose but want to learn about them please reply where should I learn from and which book if any???[/QUOTE] What exactly is your non-destructive purpose? Most people don't try to enrich their C programming skills after taking a basic course in C by … | |
Re: [QUOTE=nurulshidanoni;554362]How to count how many (3, 10 appears in data? I have done a little bit programming but abnormal program. [code=C++] int mycount; int k; int myints[] = {students.at (i).examcode.at(0),students.at(i).examcode.at(k)}; mycount = (int) count (myints, myints+12, 1); for ( int i = 0 ; i < students.size (); i++ ) … | |
Re: [QUOTE=SEOT;554272]Please.....Please.....Please.....I really need help with this. I can not find anything in all my C++ books about this, and there is hardly anything on the internet on it. I believe it can be done. Anybody.....somebody....helppppp - SEOT[/QUOTE] Posts like this decrease your likelihood of being helped. Explain your situation better, … | |
Re: Please use code tags. [code=cplusplus] class matrix { int **p; int d1,d2; public: matrix(int x,int y); //constructor allocates block of specified size /*I am not specifying contructor code*/ void get_element(int i,int j,int value) { p[i][j]=value; } int put_element(int i,int j) { return p[i][j]; } // return statement encountering access violation … | |
Re: [QUOTE=virubudy4u;553605]Where length is declared in java and how it works?[/QUOTE] You can't possibly be expecting a helpful answer to a question like that. We need more detail. What is length? A user variable? Put some effort into asking the question if you want others to put effort into answering the … | |
Re: [QUOTE=COLLIESA;554813]I have been given a problem in which i have to write a program to find the letter frequency and the average word length of a piece of text. i've written the code to promt for and read in the text file. i'm finding it difficult however to make the … | |
Re: [code=cplusplus] #include <iostream> //put additional include lines here as needed //include <packageName> using namespace std; int cardNums(int array[5][5]) char bingoGrid(char bingoCard[5]) { char bingoCard[5] {'B', 'I', 'N','G', 'O' } { int array[6][5]; for(int i = 0 ;i < 15 ; i++) array[i] = 0; srand((unsigned)time(0)); int random_integer; int lowest=1, highest=15; … | |
Re: I think you are on the right track here: [code=C++] validData = true; len = strlen(myStr); i = 0; while ((i < len) && (validData == true)) { if (i == 0) { if (((myStr[i] < '0') || (myStr[i] > '9')) && (myStr[i] != '-')) { validData = false; } … | |
Re: [QUOTE=Queen of Dreams;555661]I am a beginner in C++, Being this is the first given question asking me to write a prgram, I don't know how to answer it.. please answer any question you know...[/QUOTE] This is your first C++ program? I've never heard of a teacher or an employer assigning … | |
Re: Look at line 179. I am guessing it is crashing here. [code] for (z = 1; z < x; t++) [/code] Do you want to increment t or z? | |
Re: [QUOTE=Jennifer84;554692]When you are writing a whilestatment like this you have ',' as a delimiter. What I wonder is if it is possible to have more than only one delimiter as I also want at the same time use " " and ")". [I](a blank space and a ")" )[/I] Is … | |
Re: [QUOTE=heshangho;554671]hey guys How do you write and statment to input the values for the elements of array(x[i][j]) from the terminal? Do we have to use a for loop?[/QUOTE] You may well decide to use a for loop, but we have no way of guiding you in a way of doing … | |
Re: [QUOTE=digitz101;554626]HOW CAN I MAKE A SCORING PROGRAM WHERE IN WHEN A GAME IS PLAYED THERE IS A PART WHERE THE TOP 3 PLAYERS WILL BE DISPLAYED, FOR EXAMPLE WHEN A PROGRAM IS RUNNING 3 PLAYERS WILL PLAY ONE AFTER ANOTHER, SO THE SCORES WILL BE STORED IN AN ARRAY OR … | |
Re: I think you are going to have to define "rotate around an axis" and what exactly you are trying to accomplish with that. x, y, and z are coordinates? The word "vector" threw me until I noticed that it is a struct and that you are using the word "vector" … | |
Re: [QUOTE=Noliving;554245]Here is the error message I'm getting OrderedList.java:71: class, interface, or enum expected } ^ 1 error Ignore line 72 its just a space.[/QUOTE] Just stuck your program in NetBeans. When you take out the bracket in line 72, the error message goes away, so it's not something to ignore … | |
Re: To add numbers to your lines, simply do this: [noparse] [code=C++] // paste your code here [/code] [/noparse] The results: [code=C++] #include <cstdlib> #include <iostream> #include <string> #include <fstream> #define iteration_max 10000000 using std::cin; using std::cout; using std::string; using std::endl; int cards[4][14]; int player_cards[2][2]; int shuffled_deck [51]; int board_cards[4]; int … | |
Re: [QUOTE=birdy_28;553448]Hi Guys/ girls. I have written a small program for uni, and it involves the user inputting a message that is saved into a string. The only problem is that whenever i use a space within the message the whole program crashes. Can anyone help, i have given the code … | |
Re: [code=C++] cout << "Message " << i+1 << ": "; cin >> text; // problem line array[i].message = text; cout << endl; cout << "Enter current time in Hours, Minutes & Seconds : " ; cin >> hrs >> mins >> secs; [/code] Your problem is in line 2 above. … | |
Re: [QUOTE=BBallAsh23;553241]My first issue was getting it to open and read the text file contents... Woot it does that. Compiles fine, no errors. However... When it gets to the CalcRate, GrossPay, Display... it goes down hill and display mem locations. Any advice... And I still have another program to code... I … | |
Re: [QUOTE=CaffeineCoder;544461] [code] for(int i = 0; i < burst.length; i ++) { for(int t = 0; t < 100; t ++) { g2d.drawImage((BufferedImage)burst[i], 150, 150, null); } } [/code][/QUOTE] It looks to me like you are drawing all of the images at the same coordinates (150, 150), so wouldn't they … | |
Re: Try to break the program into smaller, more manageable segments. I'd have an ifstream that opens the file and reads from the file one string at a time, and an ofstream for the output of e-mail addresses. For each string read in, decide whether the '@' character is present. If … | |
Re: [QUOTE=foya;552127]Hi guys :) Well I have this project in which we have to build an application that tack the instructors names, the sections, the rooms, and the classes times to generate a schedule for the next semester. But am really new in this field and I have been searching for … | |
Re: It could also be a PATH issue. gcc.exe may exist somewhere but Windows can't find it. Do a file search through the computer (probably in "Program Files" somewhere) for the file gcc.exe and see if it's in some directory somewhere. It could be somewhere on your computer, but in the … | |
Re: So you are thinking along these lines (interest = 10% or 0.10)? Year 0 - 1.0 Year 1 - 1.10 Year 2 - 1.21 Year 3 - 1.331 Year 4 - 1.4641 Year 5 - 1.61051 etc. But you don't know the formulas? Is this a loan where there are … | |
Re: You are going to have a problem in this line: [code] term += 1/(x*(x+1)); [/code] You have declared x as an integer. x * (x + 1) is going to be greater than 1. Let's say x is 2. [code] (x * (x + 1)) = (2 * (2 + … | |
Re: The window will close when the program is done. It's possible that the program is running correctly and displaying what you want, but is simply closing faster than your eye can register. Check out this link on how to hold the execution window open using both C and C++. There … | |
Re: I think this is an error. Maybe not, but it's still a bad idea and is confusing. In this code: [code=JAVA] // INTIALIZES THE PRIVATE VARIABLES. public Fraction( int whole ,int numerator, int denominator) { this.whole = whole; this.numerator = numerator; this.denominator = denominator; } [/code] You are naming the … | |
Re: Let me guess. If this was the data: [code] 1, 3, 5, 6, 11, 12, 14 4, 5, 8, 12, 13, 15 2, 3, 4, 6 1, 3, 7, 10, 12, 13 2, 3, 4, 6, 11, 56 1, 4, 10, 11, 15 2, 3, 4, 10, 11, 12 [/code] … | |
Re: Depends on my mood, which depends on what computer language I'm working with. If I'm working with C++, I can normally figure it out and I stick with juice and soft drinks. When I work with JSP, I start with beer, then when I inevitably can't get even my Hello … | |
Re: You are passing an integer to function Get_Number in lines 29 and 31, [code] height = Get_Number(1); // line 29 width = Get_Number(2); // line 31 [/code] but your function specification takes no parameters in line 5: [code] int Get_Number(); [/code] The function calls need to match the function specification. … | |
Re: He is saying that these lines won't compile: [code] int max = temp[0][COLOR="Red"],[/COLOR] int maxtempnum = 0; int min = temp[0][COLOR="Red"],[/COLOR] int mintempnum = 0; [/code] Notice that he put the commas in red. They either need to be changed into semicolons or you need to remove the word "int" … | |
Re: [QUOTE=Helpwithjava;549128]I would like to know how to create a high score system for a java game using an array List. Thankyou[/QUOTE] You are going to have to get a lot more specific to get help. | |
Re: See my earlier post in the C++ section: [url]http://www.daniweb.com/forums/post549484-2.html[/url] It applies to the C language as well and it looks like you still have a lot of the same code that will give you the errors. Try to rename some variables so there is less confusion. Also, your "heading" function … | |
Re: > I'm stuck trying to implement a sorting algorith...and i also would like to know. is the swap function necessary since i have a sorting function? > > Thank you in Advance > int median (int numbers[], int length) { int i=0; printf("Please enter up to 10 integers.\n"); printf("Enter any … | |
Re: A few things. One, you are in the C++ forum. This is a C program so you should probably repost over there. Two, you don't want to name your variables the same name as your functions. It's too easy for the compiler (and people) to get confused by which you … | |
Re: I don't think you'd have to change much at all to change this into a vector. In fact you may only have to change one line. Change this: [code] int sum[13] = {}; [/code] to this: [code] vector <int> sum (13, 0); [/code] This creates a vector of 13 integers … | |
Re: I'd do something like this: [code] do { cin >> deposit; } while (deposit < 0); [/code] You may want to put some error message in there explaining what the user did wrong. But this method will keep prompting the user until he/she gives legal input. | |
Re: [QUOTE=nitsmooth;548157]I made this program to create a binary search tree but it is not working properly ......could smbdy tell me whts the prob [/QUOTE] Can you be more specific? What in particular is not working? | |
Re: You are setting your matrix to be 0 rows by 0 columns in this declaration: [code] int arow(0),acol(0), brow(0),bcol(0); int matrix_a[arow][acol]; int matrix_b[brow][bcol]; [/code] You are then asking for the number of rows and columns in the matrix and assigning values to that matrix based on the number of rows … |
The End.