32,199 Topics

Member Avatar for
Member Avatar for shahreza

i got a question about random number.. this is my sample data : jenny jason jerry peter chriss wayne ralf andre alexis alex garcia lorris ronny lyn armand i wanna pick name above to put in free slot like below.. 1.. 2.. 3.. 4.. 5.. 6.. 7.. - - - …

Member Avatar for NormR1
0
109
Member Avatar for kezkez

Question is below for the TestSlotMachine. SlotMachine class... [CODE] import java.util.Random; import java.text.NumberFormat; public class SlotMachine { enum CoinSlot { penny, nickel, dime, quarter; } //private String typeOfMachine; public double balance; SlotMachine() { // typeOfMachine = machineType; balance = 0.0; } public double deposit(double amount) { balance = balance + …

Member Avatar for kezkez
0
161
Member Avatar for DeadSoul

i have made this code which displays all the values in JTable can any one help me out how to get report of those data.this code is just the module of my library project .Now i want to generate a report for it . [CODE] import java.awt.*; import java.awt.event.*; import …

Member Avatar for Ezzaral
0
100
Member Avatar for merban

I'm a newbie to JAVA and programming as a whole. I'm trying to write a basic code to declare , which holds a variable named minutes on a job, and assign a value. It should display the value in hours and minutes. An example would be, 197 minutes becomes 3 …

Member Avatar for NormR1
0
144
Member Avatar for Khodz

So i'm trying to make a module for my program that returns a multidimensional array based on another array in the form of a command-line argument. Here is the module that's keeping me up at night: [CODE]public static double[][][] getDimensions(String [] args) { final int l = args.length; double dimensions …

Member Avatar for Khodz
0
168
Member Avatar for DanHu

ok so i have 3 separate classes: Product, Action, and Invoice. Action would be my interface that allows me to add and remove items in my hashmap that is in my Invoice class. my Product class would have the instance variables name, info, id and quantity (correct me if I'm …

Member Avatar for NormR1
0
507
Member Avatar for sheiyvin
Member Avatar for 47pirates

For my school project , I got student details in database and according to system of that school yearly the student standards are raised by one grade . So how can i code so that the data i've entered in database, say 4 grade this year will become 5 grade …

Member Avatar for 47pirates
0
124
Member Avatar for SC803

public class kgPoundsConverter extends JApplet 12 { 13 private JPanel kPanel; // To hold a text field 14 private JPanel pPanel; // To hold a text field 15 private JPanel buttonPanel; // To hold a button 16 private JTextField kgram; // kilogram 17 private JTextField pounds; // pounds

Member Avatar for Nick Evan
0
85
Member Avatar for joewinsock

trying to make a payroll program, im pretty sure this is all the code i need. maybe 1 or 2 maybe 3 extra lines. ERRORS: operator * cannot be applied to java.lang.String operator * cannot be applied to double,java.lang.String operator * cannot be applied to double,java.lang.String ERRORS in CODE are …

Member Avatar for joewinsock
0
141
Member Avatar for muraj

. Goal is for user to input 2 numbers then get a multiplication chart with a row and column. Example: user enters 3 and 5, then should print ...3 4 5 (disregard the dots) 3 9 12 15 4 12 16 20 5 15 20 25 My program will not …

Member Avatar for muraj
0
1K
Member Avatar for coding101
Member Avatar for ankilosado

Hi, there, I am also very new to Java. For class, I have to create an structure that reflects that of a document stored in a plain txt file. The hyerarchy of the classes is: Class document is made of //complex objects class Page objects, that are made of class …

Member Avatar for ankilosado
0
464
Member Avatar for Fadam360

Hello everyone, I need to make a program for Java that has the user enter in 2 numbers,1-9, then prints a top row and column with those numbers in it, then prints a multiplication table for those numbers. I need to use a for loop or for loops. Ex. 2 …

Member Avatar for muraj
0
165
Member Avatar for tedmyers

Hi everyone I am new to the community and been programming in java for 2 weeks. This is my 3rd program so please take it easy on me, I know there are better ways to do things but this is what I know for now. The purpose of the program …

Member Avatar for tedmyers
0
171
Member Avatar for LianaN

Hi! I would like to add a link to JTable cell. When a user will click on this cell, then a file pointed in the cell will be opened. Could someone tell me some hints? Thanks!

Member Avatar for NormR1
0
2K
Member Avatar for Awais Ahmad

Hello ! I am using Java media framework on windows 7. I am making a program to transfer live audio and video using RTP in Java media framework. The problem is that JMF registry contains the built-in camera but when i run program it says that video source is not …

Member Avatar for CrazyDieter
0
99
Member Avatar for bops

Hello. I am currently working on a little password based file encryption feature for an application I am doing. The following is an incomplete function that I have worked on to encrypt some content and (will eventually) write it to a file. [CODE]public static void encrypt(byte [] data, char [] …

Member Avatar for Stefano Mtangoo
0
339
Member Avatar for plasticfood

[CODE]import java.util.Scanner; public class Inti{ public static void main (String [] args){ Scanner kb = new Scanner(System.in); System.out.println("enter name: "); String input = kb.nextLine(); char name1 = input.charAt(0); int blank = input.indexOf(' '+1); char name2 = input.charAt(blank); int lastBlank = input.lastIndexOf(' '+1); char name3 = input.charAt(lastBlank); System.out.println(name1 + "\n" + …

Member Avatar for plasticfood
0
104
Member Avatar for AB Nite
Member Avatar for Ghosh

Dear friends, I have joined a course for SCJP. This is the first time I am learning JAVA. I want to lean the program by solving more practice problems. Does any one has any links which will have lots of JAVA practice problems for a novice programer like me :eek:? …

Member Avatar for harman thind
-1
88
Member Avatar for nobodycool

Hey there folks, So I am working on an assignment for class and I have gotten a considerable amount done thus far. I am having some issues with the final important aspect though. The assignment asks that we read a .txt file with a bunch of records of cars sold …

Member Avatar for nobodycool
0
128
Member Avatar for mohit007kumar00

Hello guy's, As we know we have the facility to interprete your java script and HTML code on our blog. Any one have idea how to embed our java applet code on the blog. . Suppose i created a registration form using java applet and i want to display it …

Member Avatar for NormR1
0
47
Member Avatar for sanelepatrick

Hi Everyone, I have a code that permutes Strings, it rather swaps them but I wanted the code to substitute strings, using permutiotions not swap them around... Here is the sample code: import java.util.*; public class PermutationExample { public static void main(String args[]) throws Exception { Scanner input = new …

Member Avatar for NormR1
0
72
Member Avatar for sandawg

First I apologizeif the answer to my question is somewhere in the hundreds of posts listed. I am new to java and basically clueless. I am suppose to pass an array to a method and then sort the array. I get an "illegal start of expression error when attempting to …

Member Avatar for Ashok Agarwal
0
126
Member Avatar for Akilah712

Hi, I am working on a program for one of my courses. The program requires the use of a command line argument. I am using JCreator and as such my code does not work. Is it not possible to run a program with a command line prompt from JCreator? Thanks

Member Avatar for masijade
0
1K
Member Avatar for vinay1424

[B]I m doing some problems regarding Return type in java.I m facing some problem . could any help plz.[/B] 1. class Plant { 2. String getName() { return "plant"; } 3. Plant getType() { return this; } [B]// what mean 'return this' here [/B] 4. } 5. class Flower extends …

Member Avatar for Darryl.Burke
0
262
Member Avatar for nitol

how to solve this easy problem????? Write a Java program that would input ten numbers form the user and print the ten numbers sorted in descending order.

Member Avatar for jon.kiparsky
0
84
Member Avatar for dbanks4271

public class HealthProfile { private String healthfirstName; private String healthlastName; private String gender; private Float birthday; private Float weight; private Float height; private Double maximumheartrate; private Double targetheartrate; private Double bmi; //starter public void setHealthfirstname( String name ) { healthfirstName = firstname; } public String getHealthfirstname() { return healthfirstName; } …

Member Avatar for coil
0
217
Member Avatar for jssutton11

Hi, I wrote a code to solve the knapsack 0-1 problem by dynamic programming. At a certain point, around 30 max capacity, the code stops adding new values based on the incrementing max capacity and item values. I have no idea why, it finds the correct solution until the max …

Member Avatar for jssutton11
0
378

The End.