32,199 Topics

Member Avatar for
Member Avatar for kei01040

[CODE]import static java.lang.System.*; public class ShipTester { public static void main (String []args) { Ship s1 = new Ship(); s1.setX(3); s1.setY(10); s1.setSPeed(22); out.println(s1.getX()); out.println(s1.getY()); out.println(s1.getSpeed()); out.println(s1);//calls the ToString method Ship s2 = new Ship (3,10, 22); ship s3 = new Ship(5,7 ); s3.setSpeed(19); out.println(s1.equals(s2));//s2 becomes rhs out.println(s1.equals(s3));//s3 becomes rhs } …

Member Avatar for Zaad
0
104
Member Avatar for philipghu

Hi, it is kind of a beginner's question... I'm trying to read user's input from keyboard. The user types in: a1 a2 a3 b1 b2 b3 c1 c2 c3 ... in which each line has three integers separated by a space. Every three integers are on the same line. [CODE]Scanner …

Member Avatar for turt2live
0
115
Member Avatar for tran21

it's my homework and i have no clue what i'm doing. i pay attention in class but i still don't know what's going on! it's a 2 part project, with a cointoss class and histogram class. this is my cointoss class [CODE]import java.util.Scanner; public class CoinToss { private static final …

Member Avatar for tran21
0
643
Member Avatar for moonL!ght

hellow, i wondering will be able to draw a pi chart with diffrent scetions colored diffrently with out using Graphics2d class....in addition that i want to make it rotating 360 degree.:icon_neutral:

Member Avatar for hfx642
0
180
Member Avatar for Kevingon

Hi all, I have a serious problem, I made a program in java that prints reports, I made and tested the reports with one printer, but when I used the program in another printer (and another pc) all the fields are printed around 5mm down of the normal position. I …

0
85
Member Avatar for ITHope

so we have a big project and i already did the cartesianproduct portion now i'm stuck on creating a venn diagram application that should ask for the user to enter specifications like labels dancing singing , etc. and then how many for each 23 students like dancing, 10 like singing …

Member Avatar for ITHope
0
535
Member Avatar for knjava2011

I am a very new java student.I need to write a program ask the users to enter the series numbers separated by commas, with the valid input is : 23,45,90,4,5 The program should calculate and display the sume of all the numbers. I had written the code. I knew it …

Member Avatar for Taywin
0
332
Member Avatar for gahhon

[CODE] Film[] callFilms = new Film[100]; static int numberFilm = 0; [/CODE] [CODE] //Search Film Method public static void searchFilm(Film[] callFilms){ Scanner scan = new Scanner(System.in); int condition = JOptionPane.YES_OPTION; boolean check = true; do{ System.out.println(); System.out.println("Search Films"); System.out.println("============"); System.out.print("Please Key-in Item Code: "); String code = scan.nextLine(); for(int i …

Member Avatar for gahhon
0
86
Member Avatar for Labdabeta
Member Avatar for JamesCherrill
0
316
Member Avatar for DaniwebOS

Hello all, I'm using the version 6 of Eclipse JAVA development. The code below is very basic, but I'm getting warnings which is probably preventing me from running the application. Any ideas? Basically what I'm designing is a program which would input the radius and therefore it would display the …

Member Avatar for StephNicolaou
0
208
Member Avatar for StephNicolaou

Dear all, When printing a grid, for example a chess board, I was hoping it wouldn't have the same output as the console. When I want the position to be grid[x][y] = 5, 5, it will place the counter in the bottom right corner in a 5x5 grid, (5,1) instead …

Member Avatar for StephNicolaou
0
148
Member Avatar for Labdabeta
Member Avatar for Labdabeta
0
406
Member Avatar for David321

I was writing a code for class as follows: [CODE]import java.util.Scanner; public class Salary2 { public static void main(String[] args) { Scanner input=new Scanner(System.in); String name; float salary; float hours; System.out.print("What is the employees name?"); name=input.nextLine(); while (!name.equals("stop")) { System.out.printf("What is %ss salary per hour?", name); salary=input.nextFloat(); System.out.printf("How many hours …

Member Avatar for StephNicolaou
0
190
Member Avatar for anand01

Hi all, I am having confusion on polymorphism 1)Is Method Overloading considered as polymorphism? 2)Is there two types of polymorphism(run time and compile time ) available? thanks in advance

Member Avatar for anand01
0
158
Member Avatar for drjay1627

Hi, I have this requirement that I have been trying to solve for a couple of days now. I have this source DB. The objective is to extract data from this source DB and insert into a oracle table. The meta data for both tables are the same (1-1 mapping). …

Member Avatar for masijade
0
184
Member Avatar for t1suka

Hello, I've been trying to code a TrueSkill calculator using Java that fetches scores and updates them in a MySQL database. I finished coding it however it appears to have a problem while executing. This is an example of what I want the output to be like: [QUOTE]connecting to database …

Member Avatar for t1suka
0
351
Member Avatar for gahhon

film class [CODE] import java.util.Scanner; // Creating Class Members public class film { private String itemCode; private String title; private String description; private String language; private String runningTime; private String productionCompany; private String status; //eg, pending, premiering, running, written-off // No-argument Constructor: Without Parameters public film() { itemCode = ""; …

Member Avatar for gahhon
0
343
Member Avatar for vjames

Hi, I'm making a snake game and I got a timer to check everything and repaint the component. How can I achieve a 60 fps without affecting the movement of the snake. I need help to come up with an equation for the speed of the snake. Need to change …

0
246
Member Avatar for marvolo1300

Hi there, I have to create a card game as an assignment, and i am having trouble with a part of the assignment. Basically, there is an array, 'playerHand', which holds a set of integers. What i want to do is to add the elements of the array and then …

Member Avatar for marvolo1300
0
165
Member Avatar for caswimmer2011

Hey, I am now programming in a MacBook Pro and for the KeyCodes in the Robot Class, there is no set key for Command. Can I set a KeyCode to do the actions of the Command key? Thanks

Member Avatar for caswimmer2011
0
204
Member Avatar for mike2828

Hi i am new to java gui, i have trouble using color constructor. please tell me what the problem . thank you . [CODE]import java.applet.*; import java.awt.*; public class AnAppletSubclass1c extends Applet { Color c = new Color(5,25,205); public void Color(int r,int g,int b); public void init() { System.err.println("Hello from …

Member Avatar for Ezzaral
0
214
Member Avatar for cgen

I need help understanding this algorithm Design a variation of algorithm TreeSearch for performing the operation findAl(k) in an ordered dictionary implemented with a binary search tree T, and show that it runs in time O(h + s), where h is the height of T and s is the size …

Member Avatar for cgen
0
421
Member Avatar for glamourhits

Your task is to implement Stack and Queue classes for Objects. Both Stack and Queue should extend Collection, which is an abstract class that will be given to you. You will need to download and modify the NetBeans project that goes along with this assignment. Stack should have the following …

Member Avatar for Taywin
0
577
Member Avatar for needhelpinjav

Write a java project (applet) that has two classes. The driver class (has the init() method) should allow the user to enter into an Input Dialog Box, the mail type ("P" for Priority or "F" for First Class), a blank space, and the weight in ounces of the piece of …

Member Avatar for mKorbel
0
246
Member Avatar for Joey_Brown

First of all, hello Im Joey and Ive recently started messing around with the Java language. Ill do my best not to bother you alot with my newbie questions :) So I need to create a method that returns some variables I have encapsulated, as String but without the last …

Member Avatar for Joey_Brown
0
158
Member Avatar for theadjectivenou

I need help trying to figure out what I am doing wrong. my teachers wants two different sentences to read as "Wow, (insert word 1) and (Insert word 2) are funny" and on the second line he wants them reversed to read "Wow, (insert Word 2) and (Insert Word 1) …

Member Avatar for Taywin
0
112
Member Avatar for ravsau

I have written a solution to the following assignment but I wont get any output. I used System.out.println randomly to see where my program stops and I figured out it is righ after the while (inputFile.hasNext()) method. Any suggestion will be great. Thanks! my assignment: build a program that uses …

Member Avatar for stevanity
0
3K
Member Avatar for gahhon

[CODE] //Member Login public static boolean memberLogin(){ int memberPassword = 123; boolean password = false; int confirm = JOptionPane.showConfirmDialog(null, "Are You A Member? ", "Member Confirmation", JOptionPane.YES_NO_OPTION); do{ while(confirm == JOptionPane.YES_OPTION && password == false){ String tempCurrentPassword = JOptionPane.showInputDialog(null, "Please Enter Your Password", "Default Password = 123"); int currentPassword = …

Member Avatar for stevanity
0
202
Member Avatar for paulsoncall

Hi - I'm having a hard time figured out how to print the triangle shape below using loops. I did the two previous triangles with no issue but have no idea how to get the spaces in there. I'm really confused and would appreciate any help. [CODE] * ** *** …

Member Avatar for paulsoncall
0
259
Member Avatar for persianprez

So this is my assignment: Represent the concept of a Number. For this example a Number is a thing that can be added subtracted, multiplied and divided. Each of these operations is binary and produces a Number as a result. Encode the the Notion of of an Int (an integer …

Member Avatar for persianprez
0
144

The End.