105 Topics

Member Avatar for
Member Avatar for km2011

Dear all sir, i'm a begining of java and i have a problem to write the equation in java code , i want to make it in for loop and i also want to count it by column.how do i do? please me!!! example: f[1][1]=5.4; f[2][1]=5.0; f[3][1]=1.5; k[1][1]=|f[1][1]-f[2][1]|+|f[1][1]-f[3][1]-|; k[2][1]=|f[2][1]-f[1][1]|+|f[2][1]-f[3][1]-|; k[3][1]=|f[3][1]-f[1][1]|+|f[3][1]-f[2][1]-|;

Member Avatar for hiddepolen
0
184
Member Avatar for matharoo

I am trying to store the numbers of a text file into a 2D array.. Here's the text file: 1 2 3 2 3 4 4 5 6 But i get the error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at BankerAlg.main(BankerAlg.java:30) Process completed. Here's the code i made: [CODE] import …

Member Avatar for matharoo
0
2K
Member Avatar for yazz110

Hi, I have a problem and forgive me if this sounds like a stupid question but I'm not really a good programmer. Ok, this is my problem. Say you have a string and you would like to pull out integers from the string what do you do? Example: String question …

Member Avatar for stultuske
0
156
Member Avatar for bennetk2

I am having problem with converting and initializing errors. Any help is appreciated. I am a 2 yr Computer Science major, so be gentle. Here is Code: Sorry its long! [CODE]// Kyle Bennett // CS 318 // Paint Throwing Disturbance #include <iostream> #include <iomanip> // set width and decimal #include …

Member Avatar for raptr_dflo
0
359
Member Avatar for anu07

The output I expected was: [ICODE]alpha beta[/ICODE] I used the following code: [CODE]#include<iostream.h> #include<conio.h> void main() { clrscr(); char choice[2][5]={"alpha","beta"}; cout<<choice[0]<<endl; cout<<choice[1]; getch(); }[/CODE] But this is what comes: [ICODE]alphabeta beta[/ICODE] Can anyone tell me what I did wrong? Thank you. P.S.:I know I am not using standard c++, but …

Member Avatar for anu07
0
174
Member Avatar for by_the_blood

I am trying to write a function that will count test scores that fall in a specific range(90-100, 89-80, 79-70, 69-60 and 60 or below) that are stored in a two dimensional array. Also, I am supposed to write a function that will do the same as above, only this …

Member Avatar for laosland
0
1K
Member Avatar for ba.accounts

Hi, Just wondering if anyone has any example of reading data from a file and storing it into an uneven 2D array. For example: the file contains [a,b,c] [a,b,c,d] [a,b,] etc I am able to do this with a complete "square" or matrix but when the columns aren't even I'm …

Member Avatar for ba.accounts
0
2K
Member Avatar for mattyg1192003

Hey Guys, I am a new student to Java and I am working on an assignment for school. I am not looking for anyone to do my work for me, just some guidance on what I can do to fix the problem. I have done research on this issue on …

Member Avatar for AhmedGhazey
0
3K
Member Avatar for leetari

Hi there, I am working with a 2D array, my c++ program reads input from an external file and stores it into a 2D array. Say, for example, this is my input file: 9 5 6 2 4 1 0 8 6 7 3 5 2 9 5 8 My …

Member Avatar for leetari
0
3K
Member Avatar for gingerfish

hello programmers is it possible to extract some part of 2D array and make a new 1D array? for example from this array String[][] twoDarray= { {"s", "y", "r"}, {"s", "n", "r"}, {"w", "y", "r"}, {"r", "y", "p"}}; take first column of twoDarray[0] and make this `arrayString[] newArray = {"s","s","w","r"};` …

Member Avatar for gingerfish
0
790
Member Avatar for mashar

Hello all, I am currently a student doing an end-of-year software project - and I need some help. I am currently trying to return a 2D array from a function contained in a header file. The function is called from the main() and asks the user to input the location …

Member Avatar for mashar
0
139
Member Avatar for jshoot

Hi everyone, I have a 2d array whith 50000 lines and 14 columns, and I have to sum/multiply each value of a column for a fixes numbers, like this: a[1][14] = 0 a[1][14] + 2 = 2 a[2][14] = 2 a[2][14] + 2 = 4 a[3][14] = 5 a[3][14] + …

Member Avatar for zeeshan soomro
0
693
Member Avatar for gingerfish

i have this 2d array: String[][] testData= { {"s", "y", "r"}, {"s", "n", "r"}, {"w", "y", "r"}, {"s", "n", "r"} }; how can i count the occurrence of a particular element in the column of an array? for example i want to know how many "s" are in first column …

Member Avatar for gingerfish
0
3K
Member Avatar for MasterBerd
Member Avatar for abelLazm
0
81
Member Avatar for Prosper92

So I've been giving a number of assignments to do but I'm stuck on one in particular now. I've to create a 2D array ([5][2]) and then say how many times ou of the 5 rows that the first row was bigger than the second. I imagined I would need …

Member Avatar for Taywin
0
1K
Member Avatar for ana_1234

Hello, I am working on an assignment and I am so stuck and I have no clue how to get out. We are giving a maze and we are to find start and finish of the maze. The code is interpreted as giving the "walls" of the cell by looking …

Member Avatar for ana_1234
0
567
Member Avatar for Splam Bub

Hello DaniWeb! I'm trying to return an array of strings from a function but I'm not sure how to do so. I've done the prerequisite Googling and have found people on this discussion board recommending to return char** which, it is said, can then be converted back into 2d array …

Member Avatar for Splam Bub
0
152
Member Avatar for InfestedLawyer

I've seen this problem a few times and I've tried what they've done. I am still not passing my Array correctly. I'm all templated up because of last files I have used for this program (Not in the code). If that could have something to do with it let me …

Member Avatar for InfestedLawyer
0
161
Member Avatar for Taimoor Rana

Hello Guys, I know how to draw line and shapes but how can i draw a parabol??? ( i need a 2D line) Any suggestion or pointers are appreciated!

Member Avatar for Ezzaral
0
88
Member Avatar for Progr4mmer

when ever i try to compile/run my game in eclipse it says this [QUOTE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at OurGame.Board.checkCollisions(Board.java:78) at OurGame.Board.actionPerformed(Board.java:40) at javax.swing.Timer.fireActionPerformed(Unknown Source) at javax.swing.Timer$DoPostEvent.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at …

Member Avatar for Progr4mmer
0
103
Member Avatar for Gsterminator

The objective of this program is to create images or shapes by using 2day arrays. I've created the the maximum size in my constructor but my error is in the the rectangle method.This is my error: Hw11.java:60: cannot find symbol symbol : constructor Picture(char[][]) location: class Picture return new Picture(result); …

Member Avatar for JamesCherrill
0
115
Member Avatar for Taimoor Rana

Hello guys, I'm currently working on a project that simulates a projectile motion. So far I'm preparing the flowchart of the program. I'm stuck when it comes to designing the path([B]2D Line[/B]) of the projectile Motion. So my question is, what fields,methods my class need in order to draw (in …

0
174
Member Avatar for Progr4mmer

I was watching the java game tutorials by thenewboston on youtube but he stopped making them. Anyone know of any good tutorials for making java 2d or 3d games?

0
73
Member Avatar for JordanHam

I do not know if I should use a 2D or just two seperate arrays to make this easier. I have two arrays. One is just an array like {1,2,3,4...n} and the other has values that correspond to those and make pairs. I want to create an array that stores …

Member Avatar for JordanHam
0
197
Member Avatar for sandwich88

hi everyone this is my first post and yes, im just starting with cpp im using devc++ so i have this homework which i could get done for its due date but still it would really help me to understand more about cpp if i could get it done but …

Member Avatar for sandwich88
0
132
Member Avatar for AaronLLF
Member Avatar for superirale

I want to Develop a 2d rpg game with java,how do i start and what do i need to know? I have been using java for two years.my team consists of two programmers and one graphic artists

0
128
Member Avatar for DaSpirit

I am using Visual C++ Express Edition on Windows, and I am look at the windows task manager and I noticed that every second, in the process tab the memory of my C++ program increases about 8 K when I am not even doing anything. Also, I've noticed that if …

Member Avatar for mike_2000_17
0
558
Member Avatar for dorien

Hi, I want to copy a row from a 2d vector in an existing 1d vector. I found a similar tread, which copies into a newly defined vector as such: [CODE]vector< data_type > copyRow( vec2d[3].begin(), vec2d[3].end());[/CODE] Now I want to change this code, so that copyRow already exists. My idea …

Member Avatar for dorien
0
1K
Member Avatar for tKc

I have an issues with my int array, i have a game where its like a mega version of Tic Tac Toe where you need 5 to win instead of 3 and i have tried to come up with a system of checking for a winner or not (right now …

Member Avatar for StuXYZ
0
212

The End.