889 Posted Topics

Member Avatar for cat8882

I think what you probably need to do is sum all of the students' scores and then divide by the number of students. The average should be either a float or a double. Since all the scores are presumably int's and the number of students is an int. In Java …

Member Avatar for Ezzaral
0
167
Member Avatar for wonderland

A couple of comments for you to consider: [LIST] [*]You will need a variable of type float or double to store and print the average [*]You can use modulo arithmetic to get the digits of a number (%) [/LIST] These two hints should point you in the right direction. Let …

Member Avatar for zandiago
0
94
Member Avatar for darkagn

Hi all, I have done some development in OpenGL in the C++ platform and was thinking about trying my hand at DirectX which I have heard is a bit more challenging than OpenGL. From what I have read, DirectX seems to be the more popular format so I was wanting …

Member Avatar for jbennet
0
203
Member Avatar for sean25hun

I'm sure there's a more elegant solution but you could create an array where each element is the result of an OR result of the other two arrays. [code=c++] for (int i=0; i<10; i++) { array[i] = a[i] || b[i]; } [/code]

Member Avatar for Lerner
0
95
Member Avatar for clm

What language(s) are your programs written in? In order to get your source code you can copy your files to your home computer by SSH'ing to the college server and using an scp comand. scp [source] [destination]

Member Avatar for Ezzaral
0
97
Member Avatar for nurulshidanoni

Sorry, I don't understand your question. Do you mean How do you select the same element from a series of arrays and add them together?

Member Avatar for darkagn
0
117
Member Avatar for rouge

Hi tomthehun, Welcome to daniweb. I don't mean to be rude, but this thread was last used over 4 years ago, so I am not sure that you will get an answer to your question. Please check the date of forums before posting in them. Cheers darkagn

Member Avatar for jwenting
0
273
Member Avatar for ceyesuma

When debugging I often find it helpful to add some println statements to see exactly what is happening. In your case I would insert a println statement immediately after [code=java]transval=Console.in.readDouble();[/code] Something like [code=java]System.out.println("### transaval = "+transval+"###");[/code] will help find out what is happening to your variable. Obviously this is the …

Member Avatar for sb7000
0
97
Member Avatar for danieldear

Hi danieldear and welcome to daniweb! The main rule here at daniweb is that people won't answer questions without a little effort being demonstrated. Perhaps you could post what you think a delegate is and the differences between java and c++ are and we can correct you or give some …

Member Avatar for darkagn
0
42
Member Avatar for amylaney

Before you start thinking in terms of code, maybe try understanding the steps involved in english. Write out some dot points on a piece of paper to get a better idea of what is going on. I'll give you step one: Display text: "Please enter employee's name." Get input and …

Member Avatar for ukankissthis
0
112
Member Avatar for countrygirl1970
Member Avatar for vicky_dev

In your command line prompt type [B]java myProgram[/B] to run a compiled version of a java program called myProgram. You may need to set an environment variable for the path where your java vm is installed. Let us know if you need to know how to do this... :)

Member Avatar for vicky_dev
0
2K
Member Avatar for KimJack

Take a look at the Java API, in particular the javax.xml packages. There are some handy tutorials on the sun website too. You will probably need to use a DOM model to parse the xml.

Member Avatar for iamthwee
0
92
Member Avatar for dynarial

Hi dynarial, I'm just curious as to your line of thought here. Why is it that you are [QUOTE=dynarial;445505] not interested in undergraduate degrees from universities. [/QUOTE] ?

Member Avatar for darkagn
0
109
Member Avatar for tapannigam

You have assigned the variable [B]a[/B] as an object of type A. A's process() method throws an exception. You need to wrap the line [code=java]a.process();[/code] in a try/catch block. Let me know if this hasn't helped. Also, [code=java]new ExtendTest().process();[/code]doesn't make sense. I think what you want is[code=java] ExtendTest et = …

Member Avatar for darkagn
0
82
Member Avatar for JavaNewbie07

What is tak and tz? Also, can you post the code for your add and delete tokens?

Member Avatar for orko
0
128
Member Avatar for blanklogo

What is the exact error that you are getting? Do you get it when you try to compile or when you run it?

Member Avatar for johnsene
0
154
Member Avatar for ginwah

Hi Ginwah, Sorry but you have to do a little better than that. Do you know what CPI is?

Member Avatar for ginwah
0
94
Member Avatar for pulkitmalhotra

[code=java] public static int firstMethod() { int foo = x; // do something with foo return foo; } /* second method takes parameter of same type as first method returns */ public static int secondMethod(int bar) { int out = bar; // do something with out return out; } public …

Member Avatar for orko
0
128
Member Avatar for ceyesuma

Hi ceyesuma, The super method is used to call a parent class's constructor method in the child class's constructor method. As an example... [code=java] public class Shape { int height; int width; public Shape() { height = 1; width = 2; } } public class Triangle extends Shape { double …

Member Avatar for no1zson
0
116
Member Avatar for vn_utami

[QUOTE=vn_utami;439116]So help me to change goto with while or do while,,because I'm not really know about using while or do while,,and please give some information about the different between while and do-while..[/QUOTE] The main difference between the while and do-while loops is that the condition in a while loop is …

Member Avatar for Killer_Typo
0
137
Member Avatar for riya100

In [URL="http://www.daniweb.com/forums/thread89711.html"]this thread[/URL] I explain a similar question by example. It sounds like you need to describe the time complexity of this code in terms of k but I'll leave you to figure that out.

Member Avatar for riya100
0
109
Member Avatar for annagraphicart

[QUOTE=annagraphicart;439584]Can ya'll take a look at this? [code] string names[3] = {"John","Anne","Mary"}; int score[i]; [/code] It's saying the "i" in scores[i] is undeclared? What do I do?[/QUOTE] You have not declared your i before this line. An array needs its size set - you have done this correctly in your …

Member Avatar for Ancient Dragon
0
80
Member Avatar for rjc
Member Avatar for WaltP
0
96
Member Avatar for xraaz

Hi xraaz, What are your thoughts on how to proceed? Please show that you have at least thought about the solution and maybe we can see where you are headed and help you along the way...

Member Avatar for darkagn
0
89
Member Avatar for alsoumhi

[URL="http://java.sun.com/javase/6/docs/api/"]This link[/URL] is the java API. You will need it many times in your programming studies / career. For what you are talking about take a look at the classes starting with File, in particular FileReader and FileWriter. Hope this has given you a starting point, darkagn EDIT: peter_budo gives …

Member Avatar for darkagn
0
144
Member Avatar for xraaz

a -> 1 step For i = 1 to n -> takes n steps -> n+1 steps so far -> the 1 is negligible as n gets big so approx n steps so far For j = 1 to i -> takes i steps for each n -> i*n so …

Member Avatar for Rashakil Fol
0
232
Member Avatar for KimJack

The PrintWriter(String s) constructor does not contain automatic flushing to the writer. You need to use println statements to do this rather than print statements. Or immediately after your while loop call out.flush(). Also, I think maybe you need or statements in your while loop as opposed to and statements, …

Member Avatar for peter_budo
0
190
Member Avatar for darkagn

What is actually meant by the term "web-based development/solutions/applications"? In particular in relation to java? I hear this terminology all the time but I don't really understand what it means... :$

Member Avatar for jwenting
0
93
Member Avatar for bigbluesky

Wow, that's a lot of code to wade through. Perhaps you could repost with the section that contains the buttons and icon that don't work so it is easier to find?

Member Avatar for plasmafire
0
134
Member Avatar for patrick210

First, you need to loop until the input = "E". The prompts would work like this: [code=c++]int lineNumber = 1; cout << lineNumber << "> "; cin >> temp;[/code] This will prompt with the current line number. You will need if statements to keep track of the line number according …

Member Avatar for Bench
0
135
Member Avatar for Ghost

Try using Util.Random class for your random generator. Something like: [code=java]java.util.Random randomGen = new java.util.Random(System.currentTimeMillis()); int rand = randomGen.nextInt(4);[/code] will create a new seeded random generator every time. I think this should be more stable than using Math.random() but let us know if that's not the problem.

Member Avatar for bryantpurdin
0
1K
Member Avatar for NewToJava
Member Avatar for hoceandress

The statement [code]e=e%2;[/code] will result in e being equal to the remainder of the division of e by 2. In other words, if e is even, e will become 0, if e is odd, e will become 1, and e will not change after that no matter how many times …

Member Avatar for darkagn
0
117
Member Avatar for laseredd

Hi Laseredd, That short program looks good! I think you have shown understanding of some very important C++ principles here, classes, methods, I/O. :) As an extension, how do you think you would go about accepting either integers or floats rather than just integers? Can you think of how your …

Member Avatar for SpS
1
127
Member Avatar for mattyd

My experience with NetBeans is that the generated code when building GUIs in particular is extremely difficult to read and subsequently maintain. For a beginner I would recommend something like jEdit. While technically not an IDE it has several downloadable plugins through its sophisticated plugin manager that add functionality to …

Member Avatar for jwenting
0
581
Member Avatar for revenge2

[QUOTE]and just an advice if i were u i would combine the two fuctions from my perspective it would make things much easier for me.[/QUOTE] Don't do that. It is much better programming practice to separate functions where possible. Imagine if you had to call [code]int Add (int x, int …

Member Avatar for darkagn
0
145
Member Avatar for michael.ngobeni

Hi michael.ngobeni, Have a read of the javax.xml classes in the [URL="http://java.sun.com/javase/6/docs/api/"]Java API[/URL]. You should look in particular at the parsers package. Another step might be the java xml tutorials on [URL="http://java.sun.com/webservices/jaxp/learning/tutorial/index.html"]sun.com[/URL]. Anyway I hope this has given you a starting point. Post back if you need more help. Cheers …

Member Avatar for orko
0
214
Member Avatar for shaqnolysis

Hi Shaqnolysis, I think you have a good place to start with the BufferedReader class, but it might pay to have a good read of the [URL="http://java.sun.com/j2se/1.5.0/docs/api/"]Java API[/URL] for that class. It's probably a good idea to bookmark this link as I can assure you it will be very valuable …

Member Avatar for masijade
0
97

The End.