32,199 Topics
| |
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.. - - - … | |
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 + … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
. 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 … | |
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 … | |
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 … | |
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 … | |
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! | |
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 … | |
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 [] … | |
[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" + … | |
Please I need a code in java to convert infix to postfix in java. | |
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:? … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
[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 … | |
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. | |
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; } … | |
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 … |
The End.