2,827 Posted Topics

Member Avatar for hrlygrl923

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 …

Member Avatar for VernonDozier
0
164
Member Avatar for VernonDozier

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 …

Member Avatar for VernonDozier
0
505
Member Avatar for jimJohnson

[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 (==). …

Member Avatar for Lerner
0
545
Member Avatar for rickilambert

[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 …

Member Avatar for VernonDozier
0
86
Member Avatar for gallantmon1

[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 …

Member Avatar for WaltP
0
119
Member Avatar for Jennifer84

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 …

Member Avatar for Jennifer84
0
194
Member Avatar for hajjo

[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 …

Member Avatar for VernonDozier
0
114
Member Avatar for aminit

[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 …

Member Avatar for amitahlawat20
0
120
Member Avatar for dreamgirl
Re: Help

[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 …

Member Avatar for Lerner
0
84
Member Avatar for bwjones

[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 …

Member Avatar for WaltP
0
101
Member Avatar for harishankarb

[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 …

Member Avatar for mitrmkar
0
102
Member Avatar for rahul.b123

[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 …

Member Avatar for DangerDev
0
94
Member Avatar for nurulshidanoni

[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++ ) …

Member Avatar for nurulshidanoni
0
87
Member Avatar for SEOT

[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, …

Member Avatar for dougy83
0
129
Member Avatar for amitahlawat20

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 …

Member Avatar for mitrmkar
0
99
Member Avatar for virubudy4u

[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 …

Member Avatar for bugmenot
0
100
Member Avatar for COLLIESA

[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 …

Member Avatar for jephthah
0
154
Member Avatar for ckins

[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; …

Member Avatar for VernonDozier
0
290
Member Avatar for curt1203

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; } …

Member Avatar for curt1203
0
115
Member Avatar for Queen of Dreams

[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 …

Member Avatar for mitrmkar
-1
226
Member Avatar for nelledawg

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?

Member Avatar for WaltP
0
132
Member Avatar for Jennifer84

[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 …

Member Avatar for cbattagler
0
314
Member Avatar for heshangho

[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 …

Member Avatar for VernonDozier
0
50
Member Avatar for digitz101

[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 …

Member Avatar for Joatmon
0
936
Member Avatar for begyu

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" …

Member Avatar for VernonDozier
0
153
Member Avatar for Noliving

[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 …

Member Avatar for Noliving
0
251
Member Avatar for Barbarrosa

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 …

Member Avatar for VernonDozier
0
126
Member Avatar for birdy_28

[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 …

Member Avatar for vijayan121
0
86
Member Avatar for birdy_28

[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. …

Member Avatar for VernonDozier
0
246
Member Avatar for BBallAsh23

[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 …

Member Avatar for BBallAsh23
0
155
Member Avatar for CaffeineCoder

[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 …

Member Avatar for Ezzaral
0
709
Member Avatar for hockeyplayer051

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 …

Member Avatar for vijayan121
0
119
Member Avatar for foya

[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 …

Member Avatar for Nilesh Pagar
0
113
Member Avatar for mazoo

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 …

Member Avatar for VernonDozier
0
119
Member Avatar for hartig

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 …

Member Avatar for hartig
0
184
Member Avatar for incolor

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 + …

Member Avatar for incolor
0
1K
Member Avatar for jeffige

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 …

Member Avatar for Ancient Dragon
0
134
Member Avatar for torbecire

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 …

Member Avatar for torbecire
0
105
Member Avatar for nurulshidanoni

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] …

Member Avatar for nurulshidanoni
0
231
Member Avatar for sneekula

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 …

Member Avatar for bumsfeld
0
265
Member Avatar for jimJohnson

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. …

Member Avatar for VernonDozier
0
87
Member Avatar for curt1203

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" …

Member Avatar for curt1203
0
490
Member Avatar for Helpwithjava

[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.

Member Avatar for Helpwithjava
0
143
Member Avatar for nelledawg

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 …

Member Avatar for mitrmkar
0
161
Member Avatar for ITbull

> 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 …

Member Avatar for VernonDozier
0
104
Member Avatar for nelledawg

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 …

Member Avatar for nelledawg
0
285
Member Avatar for buddha527

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 …

Member Avatar for buddha527
0
436
Member Avatar for Spencicle

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.

Member Avatar for plgriffith
0
92
Member Avatar for nitsmooth

[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?

Member Avatar for nitsmooth
0
305
Member Avatar for iwilcox

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 …

Member Avatar for VernonDozier
0
152

The End.