35,618 Topics
![]() | |
help me..how to print a sum and average of grades using Java? | |
Hello I am trying to get a SELECT stament to work i Java. The staement has a parameter, but Eclipse gives me the following error message: You have an error in your SQL syntax, check the manual that corresponds to your MySQL version...... Is it possible to show me how … | |
contentPane.setLayout(null); JPanel panel = new JPanel(layout); panel.setBackground(Color.WHITE); addComponent(contentPane,panel, 0,0,595,375); | |
THis is program in java for First 100 Prime Number as "count<100" . public class PrimeNumber { public static void main(String args[]) { int num=4; int count=0; System.out.println("First 100 Prime Number is: "); System.out.println("1"); System.out.println("2"); System.out.println("3"); while(count<100) { num++; if(num%2!=0) { int dv=3; while((num%dv!=0)&&(dv<=((num-1)/2))) { dv++; } if(num%dv!=0) { count++; … | |
[CODE]import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.AffineTransform; import java.awt.image.*; import javax.imageio.*; import javax.swing.*; class ImageDrawingComponent extends Component { static String descs[] = { "Simple Copy", "Scale Up", "Scale Down", "Scale Up : Bicubic", "Convolve : LowPass", "Convolve : Sharpen", "RescaleOp", "LookupOp", }; int opIndex; private BufferedImage bi; … | |
I want to make a java application which'll get all paypal transaction history and the details of each transaction from paypal server and store them into my database. But I can't find a way to retrieve the transaction history from paypal server. I searched the internet and came to know … | |
Hi, I have a program that uses JButtons (under ActionEvent e) and the user clicks a button and it brings up the appropriate text file associated with that name. I have the files on a flash drive but every time i transfer the files to different computer and want to … | |
Hey for hw i gotta do a program that spits out the perfect squares between 0 and a number entered... well i got it done but it spits out 1 extra number that goes OVER what the person entered... here's my code. [code] public static void main(String[] args) { String … ![]() | |
Hello Friends, I want to synchronize the database from server to mobile application. I googled so much. I got much information on : [LIST] [*]DB2 Everyplace [*]IBM CloudSpace [*]PointBase(Not able to download) [*]Sync4j [*]SyncML [*]Data Sync API(Not able to find) [/LIST] Now I am confused to which one to select? … | |
Is there method in Java to compare the strings first letter and sort the alphabetical or I have to substring and compare them with bubble sort Thanks | |
I'm wondering if there is a more efficient way to take a 10 character (mm/dd/yyyy) date of birth String and calculate the age of the user as of today's date. My code works perfectly fine, but I feel like it could be more efficient. [CODE] package dates; import java.util.*; public … | |
HI ,I am new in Java and i have trablle creating array of objects .This are my files,and I need to create array of objects patients thank you in advance for your help import java.util.*; public class MainPatient { public static void main(String[] args) { int choice=0; Scanner input=new Scanner(System.in); … ![]() | |
Hey guys, I need a little help on PigLatin translator. This is "driver" class I'm given that I cannot change [CODE]import java.util.*; public class PigDriver{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String t = " "; Piglatin p = new Piglatin(); while(t.length() > 0){ t = … | |
I'm trying to write a program where I want the user to enter a positive whole numbers into the input box. I would also like to throw up a warning if they enter a decimal, letter, or negative number. I know how to do this with the negative condition, but … | |
i need help drawing an image in an applet for some reason it doesn't show up but there are no errors [CODE]package Game; import java.applet.*; import java.awt.event.*; import java.awt.*; import javax.swing.ImageIcon; public class AppletOne extends Applet implements Runnable, KeyListener{ int x_pos = 10; int y_pos = 100; int x_speed = … | |
i want to make a 3D game in Java but the tutorials i was watching aren't being made and i don't know which 3D to use because j3d looks pretty bad... and i'm not new to Java just new to 3D. | |
Okay here's what I have... but my test cases when running the program are not allowing me to input negative, decimal, or exponents as temperatures. I know it something small but it's alluding me, I figured if I had F and C as double it would work. Any ideas? Another … | |
hello guys is the following, I have four players on the king, and I need to check if they are bluffing, because in the first round have to assist to the suit, so, I want a method that is used by four players the question is now, so I have … | |
import java.io.*; public class Appliance { public static void main(String args[]) { try { File file=new File("Name.txt"); FileReader f=new FileReader(file); int ch; while((ch=f.read()) { System.out.print((char)ch); } } catch(FileNotFoundException fnfe) { System.out.println("Exception: "+fnfe.toString()); } catch(IOException ioe) { System.out.println("Exception: "+ioe.toString()); } } } | |
Hi, I've got a job interview coming up and was wondering if people would be so kind to help me with some revision for the interview. It's it a programming role(surprisingly) so would be greatful if people would post the questions they have been asked or ask in job interviews. … | |
Hello, I am a student taking APCS and I am getting very frustrated with this program. Usually I can get everything figured out but I can't figure this out. It compiles but when I run it, it seems to give the wrong number for the number of bombs in adjacent … | |
Hello World. Thanks for any help in advance. I am in a basic java class. One of our first assignments is to develop this currency calculator. I have completed the code and it works fine. My only concern is that i could loose points if I have too much code … | |
I need help please, I want to write a program that requests and reads two integers on one line representing a range, the program should output the sun of all even numbers in the range. if anyone can help please do, thank you. | |
Im making an applet that moves a red ball using the WASD keys but it doesnt work for some reason help? [CODE]package Game; import java.applet.*; import java.awt.event.*; import java.awt.*; public class AppletOne extends Applet implements Runnable, KeyListener{ int x_pos = 10; int y_pos = 100; int x_speed = 3; int … | |
Hi. It says that the operator and return statement don't work. Can someone please explain what is wrong, and why it's wrong? I don't get it. [CODE] package hello; private class Person { private string firstName, lastName; private Date birthDate; public Person(String fN, String lN, int month, int day, int … | |
i am currently using Mircosoft Windows XP (32-bit) Version 5.1.2600 Service Pack 3 Intel(R) Pentium(R) 4 CPU 2.53GHz (2532 MHz), 1280 MB RAM (NVIDIA GeForce FX 5500) [U]My Problem[/U] when i run java program the CPU USAGE will run to 100% . i tried to reinstall but doesn't work. i … | |
[CODE]class MOrders { int nooforders; // Data members of the class public int getorder() { nooforders = 500; } public void displayorders() { System.out.println("The number of orders to be delivered: "+ nooforders); } public static void main(String args[]) { MOrders obj = new MOrders (); obj.getorder(); obj.displayorders(); }[/CODE] getting a … | |
I'm trying to make an array-based queue that inserts and removes the elements... The default array is {0,0,0,9,10}. after the 0's are filled up it should say that its Full and will return to the loop. I'm having trouble making 3 particular methods which is dequeue, isEmpty, and isFull.. [CODE]class … | |
i googled on how to create a class dynamicly and i found that code [code] Date today = new Date(); String todayMillis = Long.toString(today.getTime()); String todayClass = "z_" + todayMillis; String todaySource = todayClass + ".java"; public static void main (String args[]){ MakeTodayClass mtc = new MakeTodayClass(); mtc.createIt(); if (mtc.compileIt()) … | |
What is the best way to assign values to variables of various data types from reading a file (while importing as few things as possible and making use of the simplest code)? I need to write a program which can assign values from a .dat file, if that's relevant. If … |
The End.