35,620 Topics

Member Avatar for
Member Avatar for nickmi

Good afternoon Well my idea is simple.What i want to do is to create a currency converter.Pretty easy task, but i want the currency rate to be updated somehow by an external server, probably from an website.Although i have experience in programming i have no clue how to use an …

Member Avatar for hfx642
0
210
Member Avatar for Ashenvale

[CODE] for (ctr = 0; ctr<cost.length; ctr++) { cost[ctr] = price[ctr] * qty[ctr]; totalCost = totalCost + cost[ctr]; aveCost = totalCost / cost.length; } System.out.printf("Average Cost: %.2f\n\n", aveCost); [/CODE] with this code the output will be, for example: [QUOTE]Average Cost: 15900.00[/QUOTE] I want my output to look like this [QUOTE]Average …

Member Avatar for NormR1
0
98
Member Avatar for Ashenvale

I'm suppose to follow this algorithm: 1. Declare all ordinary Variables 2. Prepare and initialize all arrays. 3. Prepare array to hold all item cost. 4. Initialize Array cost with 0.(using for()statement) 5. Compute cost of each item then store results to array cost.(using for()statement) 6. compute average cost(using for()statement) …

Member Avatar for Ashenvale
0
122
Member Avatar for enterpise

Actually i try to create a method which can call the scanner keyboard firstly i was trying this void makeRequest(){ request ="Hello"; } So i wanna make like when i call this method it will tell me to input the String by scanning the keyboard is it possible to do …

Member Avatar for enterpise
0
144
Member Avatar for wallet123

why is that some of the codes that i put in are not being implemented when i run this?? i mea, the cycle of my program doesnt seem to be flowing the way i want it to be, come take a look :( [CODE] { /** * @param args */ …

Member Avatar for stultuske
0
125
Member Avatar for Daigan

I can't figure out what the error is. [CODE]public void quizTest () { c = new Console(); int total = 34; String[] quizArray = new String [total]; String quizQuestions; int i = 0; int u = 0; try { FileReader readQuestion = new FileReader ("QuizQuestions1.txt"); BufferedReader buffReadQuestion = new BufferedReader …

Member Avatar for Daigan
0
87
Member Avatar for wallet123

i dont know that my error is, my code for balance is not working properly and im having a problem with my if else statements, they say i lack this "{" but i dont know where to put it [CODE] { /** * @param args */ public static void main(String[] …

Member Avatar for mcriscolo
0
175
Member Avatar for Daigan

Are there like 3d pushable buttons in Java? I want to put 3 buttons on top of each other, is that posible? I found JButton and I don't think I can do it with that?

Member Avatar for Daigan
0
122
Member Avatar for sirlink99

When I run my code, and advance from level to level it works correctly, but when I would like to restart my program I cannot get the frame to reset. Here is my code [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Frame implements KeyListener{ GraphicsDevice vc; Player p …

Member Avatar for sirlink99
0
141
Member Avatar for Warl30ck

Hello, fellow programmers. Today I encountered a problem getting the 2d array length. By this I mean How many x values are filled, that all the x's sub values are filled {y}. ex x-> 1, 2, 3 ,4, 5, 6 y 1, 1, 1 | 2, 2, 2 3, 3, …

Member Avatar for Warl30ck
0
162
Member Avatar for dennysimon

Hi all I tried todo javac command on two classes (one after another) the problem is when I javac the first it gives me error ,because class of the second not already exist,the same happen when i javac the second ,class of the first also not already exist. how to …

Member Avatar for dmanw100
0
112
Member Avatar for behemothdave

My assignment is as follows: Create aJApplet that contains twoJTextFields, aJButton, and threeJLabels. When the user types an employee’ s first and last names (separated by a space) in a JTextField, the employee ’ s job title is displayed in a secondJTextField. Include two JLabels to describe theJTextFields used for …

Member Avatar for NormR1
0
519
Member Avatar for laklaker

So hello everyone! This is my school project but I'm having a problem in my code. So here is the program i want to create. I want to create a program that can generate 5 numbers from 1-9 then user will guess it. My problem only is on the generating …

Member Avatar for DavidKroukamp
0
236
Member Avatar for OVOXO

So I'm looking for a way to assign a set of numbers in a random way in a 2d array. The array is {1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10} How would I assign these values randomly in a 5 row and 4 column array? Or is there a way to generate a random number for …

Member Avatar for dmanw100
0
119
Member Avatar for gourav1

my question is that can we send e-mail through code written in java? i know that it can be made in php but don't knoe about java...if answer is yes, then can u give me hint that how to proceed means what to use(API, servlets or jsp or link from …

Member Avatar for stultuske
0
370
Member Avatar for Narayanan87

Hi i am new to JSP. I am setting a boolean value for session attribute in the java class. Now i am getting the same in the jsp using session.getAttribute("session attribute") method. Now i want to remove the session value in jsp. How could i achieve this??? Plz Help..

Member Avatar for laxmipriya22
0
94
Member Avatar for nyaneshi

I am a first year I.T student. We haven't really been taught PROPERLY about throws Exceptions and FileReaders. So I need help, why my program keeps telling me I have a InputMismatchException? Netbeans doesn't show any errors in my codes. and i just added a Method for Lowest Grade[since that's …

Member Avatar for NormR1
0
118
Member Avatar for Majestics

Its a simple problem... I placed the socket code under a button, if server is present it respond very quickly if not it takes time to respond.... I want to shorter that time , is there any way?

Member Avatar for ~s.o.s~
0
807
Member Avatar for vaironl

Hello forum, Vaironl here. I have a small question, I'm making a new screen using the GridBagLayout, since my old screen was using absolute positioning. I'm using a JScrollPane and setting a subPanel in it. THe subPanel contains 40 labels saying Ingredient. For some reasong the Ingredient Scroller will take …

Member Avatar for mKorbel
1
1,000
Member Avatar for new_2_java

Hello folks, I am trying to add a JFrame object into JTabbedPane, but I am getting a java.lang.IllegalArgumentException. Here's my code snipt. [code] // other codes... JTabbedPane tabs = new JTabbedPane(); tabs.addTab("Flight Information",flightInfoPane); <-------------- line 28 // other codes... private FlightInfoPane flightInfoPane = new FlightInfoPane(); [/code] Here I have flightInfoPane …

Member Avatar for test.tracker
0
846
Member Avatar for sirlink99

I was watching a video on how they made Watson (the robot that was on jeopardy), and another one where a person made a simulation where triangles (animals) learned when to get food, and such, and then taught their offsprings, and then they learned more, and then the intelligence developed. …

Member Avatar for harinath_2007
0
175
Member Avatar for asif49

Suppose you have a supermarket, and every item which belongs in that supermarket is stored in one place. Then you have sections of the supermarket like "Food & Cuisine", "Entertainment" and so on. The user of your program needs to be able to list every item within the supermarket, then …

Member Avatar for asif49
0
214
Member Avatar for krishnisilva

hi, [CODE] public Record get(VideoObj v) { // TODO if((v ==null) || (v=="")) return null; else return ??; } [/CODE] Recor and VideoObj are classes. if the methos return type is Record, can someone tell me what should I return? thanks

Member Avatar for stultuske
0
229
Member Avatar for sirlink99

I am making a java game, and I have heard that when I use the Math.random() method it has greater chances of generating some numbers. is this true, and if so how can I fix it. If not which method generates numbers unequally? Thanks for your help.

Member Avatar for sirlink99
0
3K
Member Avatar for toferdagofer

I am trying to compare two arrays of objects to verify that they have the same values. It is returning false when it should be returning true. Im not sure what I am doing wrong when comparing the two arrays. Class : arrayObject [CODE]import java.util.*; public class arrayObject { private …

Member Avatar for mcriscolo
0
2K
Member Avatar for sha11e

I have seen some people talking about it and my question is... I have a program that opens a input and output stream, when the program gets the message '#end' it should terminate the program. Does it really matter if I close the in-and output streams and then close the …

Member Avatar for JamesCherrill
0
131
Member Avatar for CodeJava1

could some one explain the code below [CODE]import java.util.Map; import java.util.HashMap; import java.util.Collection; import java.util.ArrayList; final class InventorySet { /** @invariant <code>_data != null</code> */ private final Map<VideoObj,Record> _data = new HashMap<VideoObj,Record>(); InventorySet() { } /** * Return the number of Records. */ public int size() { // fill in …

Member Avatar for CodeJava1
0
252
Member Avatar for ravi_91

friends,, i wanna resize the image with specific dimensions while retrieving from database here is my code help me [CODE]<%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <% Connection connection = null; ResultSet rs = null; PreparedStatement psmnt = null; InputStream sImage; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); connection = DriverManager.getConnection("jdbc:odbc:ravi", "system", "system"); …

Member Avatar for peter_budo
0
82
Member Avatar for Joshua73

Hi i am doing a student grade lab where the student enters a grade they got on a test and they get a letter grade. My program only gives the user a F even if it should be another grade. This is my code. [CODE]strT1 = JOptionPane.showInputDialog("Enter 1st test score:"); …

Member Avatar for stultuske
0
260
Member Avatar for Joshua73
0
81

The End.