32,204 Topics
| |
can somebody help me to produce a java midlet that randomly generates arithmetic problems for the user and records the time that it takes to answer ten correctly using single digit numbers and operands +,- or *, when a problem is answered correctly or incorrectly, a new problem is produced | |
[CODE]int a = 4, b = 3; String code = "a*b+a+2*b"; int result = unknown_function(code); System.out.println(result);//expecting 22[/CODE]Any ideas how to do that please? | |
Hello, I have to change this code (c++) on Java, can you help me. [CODE] QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly)) return new QStringListModel(completer); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); #endif QStringList words; while (!file.atEnd()) { QByteArray line = file.readLine(); if (!line.isEmpty()) words << line.trimmed(); } #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif … | |
Hello We runing rmi client and server from one computer the code files in the same directory [CODE]javac *java rmic FileImpl start rmiregistry java -Djava.security.policy=policy.txt FileServer[/CODE] after that we start a client [CODE]java FileClient kuku.txt 127.0.0.1[/CODE] Does we intiate several JVMs by starting client and server if not how to … | |
Hello, I've a program that asks a user for four different integer values, and then draws a rectangle on a graph based on those values. I have done everything except now I need to set limits within the program so a user can only use valid values and I'm lost! … | |
I'm trying to pass "this" as an argument of a constructor. Is there any way can determine what the type of Object "this" is? Thanks.... | |
[CODE]import java.util.*; class multiplicationquiz { public static void main(String[] args) { Scanner a = new Scanner(System.in); int b,right,totalscore; right = 1337; //boredom totalscore = 0; b = 0; do { double numb = Math.round((Math.pow(10, 2) * Math.random())); double numb1 = Math.round((Math.pow(10, 2) * Math.random())); double valueFirst; double valueSecond; valueFirst = … | |
Hey everyone, I'm new at this.. so please bear with me. Anyway, I'm really confused. I'm supposed to convert the first character of the String firstName to upper case. Problem is... I have no idea how to :-/ I've done so much research and reading and still nothing. Please help … | |
Here's my problem. I'm reading in a string of numbers from the user using the scanner class in the main method. I assign that to a variable "s". I pass "s" to a method that converts the String (let's say its a string of 10 numbers) and trying to convert … | |
ive got most of this figured out. the problem is then when i run, instead of my methods iterating through my array list, they simply reuse the same data set over and over, giving the same results. if anyone can help, it is appreciated. [CODE] /** * Write a description … | |
please help me to write a program polynomial codes in java(multiply.add &.....between polynomial)????ok? every one can write this program please help me... thanks alot:icon_smile: | |
I have an arraylist As such :- products.add( new CarsSubProduct( "FordMustang",1,12,10000 ) ); products.add( new CarsSubProduct( "JEEP",2,10,10000 ) ); I am trying to Edit just the value 12 without altering the value of the other objects but no success.When i use the set method it automatically modifies all the four … | |
This my problem>>>>if any one can solve it>>> Write a java program that calculates and prints out bills of the city water company. The water rates vary, depending on whether the bill is for home use, commercial use, or industrial use. A code of 1 means home use, a code … | |
OK... so I am pretty new to Java and need some help. I'll try to explain as best I can... I am trying to create a frame that will be a "menu frame" and then based on which option the user picks (JButton) it will then run the version of … | |
How do I run an applet in the BlueJ terminal window? Please provide a code for the solution or an alternate method to do this as soon as possible. [code=Java] package applets; import java.awt.event.*; import java.awt.Graphics; import java.awt.Font; import java.applet.Applet; public class NervousText extends Applet implements Runnable, MouseListener { String … | |
Hello Guys. I need a help here. I am doing a system using Java with GUI. SO im curious how to add a value that i have extracted from a JTextField and display it as a List in the Jlist. Here is my coding [CODE] //function for collecting data from … | |
hey guys, i have a problem when am deploying a spring application i tomcat... i have got exception like this. [CODE]Nov 15, 2009 3:43:53 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'dispatcher' Nov 15, 2009 3:43:53 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable java.lang.NoSuchFieldError: ruleMemo at org.springframework.expression.spel.generated.SpringExpressionsParser.<init>(SpringExpressionsParser.java:94) at org.springframework.expression.spel.antlr.SpringExpressionsParserExtender.<init>(SpringExpressionsParserExtender.java:37) at org.springframework.expression.spel.antlr.SpelAntlrExpressionParser.<init>(SpelAntlrExpressionParser.java:51) at … | |
I have created the output for a program that allows a user to input their employee name and number and then their hourly wage and their total number of regular hours and overtime hours. This is my first time working with this type of program in java and I'm having … | |
I need to change the font size after I click. How can I do that - Thanks! here is the code [code=java]import java.applet.*; import java.awt.*; import java .awt.event.*; import javax.swing.*; import java.util.*; public class JChangeFont extends JApplet implements ActionListener { JLabel question = new JLabel("Who's number one?"); JButton click = … | |
[B]Hi everyone,[/B] I’m working on a public transport card system which records the no. of stops of the journey and then calculates the costs. I’m a bit lost with this program and I hope you can help me... Features; the fare for up to 3 stops is charged £4, after … | |
The question ask: Write a program that asks the user to enter one of the following state abbreviations: NC, SC, GA, FL, or AL. The program should then display the name of the state that corresponds with the abbreviation entered (North Carolina, South Carolina, Georgia, Florida, or Alabama). This is … | |
Hello there, I am curious as to whether there's any 'easy' way of creating 3D models (e.g. animals, Humans etc) via a Java applet? I know in a full-blown application one could use Java 3D (with the Java 3D libraries being installed with the application), but is there an 'easy' … | |
Hi. I am trying to write a mergeSort method, but I keep getting the wrong sorted array. [CODE]public static void mergeSort(int[] num, int left, int leftEnd, int right, int rightEnd) { int [] temp = new int[num.length]; int position = left; int number = (rightEnd + leftEnd) - 1; while( … | |
I need help converting this code that is using Linear Probing to Quadratic Probing. I am not sue how to accomplish that. Can someone help me? Thanks so much... import java.util.*; // A HashMap class which uses linear probing public class HashMap383<K, V> { // array-based; this is the array's … | |
Hi, I have built a web browser using JEditorPane . But instead of using setPage method, I have used setText method The code sample looks like this: displayEditorPane.setPage(pageUrl); // Get URL of new page being displayed. URL newUrl = displayEditorPane.getPage(); When setPage is used, correct URL value is stored in … | |
HI i am using this syntax to store arraylist to inventory.dat file.When i store, it give a scattered output on the .dat file like this..... ¬í sr Carsguimainexecution.SaleinfoÕE£ñWfö L productsalest Ljava/util/ArrayList;xpsr java.util.ArrayListxÒ™Ça I sizexp w sr Carsguimainexecution.SalesubZã¾ÓÅ xr Carsguimainexecution.SaleProductøié>‘2q I CarnumberD pricesoldI productNumberD stockD unitsoldL Carbuyert Ljava/lang/String;L Carnameq ~ xp … | |
Hj, Why does't appear at editor ? [CODE] public void date() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); java.util.Date date = new java.util.Date(); String datetime = dateFormat.format(date); this.editor.insertPlainText(datetime); }[/CODE] | |
Hi im trying to use an equals method to check if two bargraphs are equal, but when I run the method, it always says that they are not equal. Could you please tell me how to fix this? Thanks My code for the method [CODE] // equals method public boolean … | |
Can u suggest any better link for datastructure that explains with diagrams?It would be good,if any basic level explanation with algorithms. | |
I have an arraylist As such :- products.add( new CarsSubProduct( "FordMustang",1,1000,10000 ) ); FordMustang is Car name 1 is Car number 1000 is total number of cars in stock 10000 is price per car I will like to Store it to access database or excel.Please how can these be done. |
The End.