32,204 Topics

Member Avatar for
Member Avatar for Prosatanos

It sorts names in ArrayList, but how exactly does it happen? public void sortStudentsAlphabetic() { int i, j; Student temp; Student[] array = new Student[studentsList.size()]; for (int k = 0; k < array.length; k++) { array[k] = studentsList.get(k); } for (i = 0; i < array.length - 1; i++) { …

Member Avatar for JamesCherrill
0
185
Member Avatar for John_165

Use a **for** loop to find the smallest integer n such that n^3 is greater than 1000 So I came out with below code public class Chapter4 { static int n = 0; public static void main(String[] args) { for (int i = 1; Math.pow(i, 3) <= 1000; i++) { …

Member Avatar for rproffitt
0
1K
Member Avatar for Bensaber

Hello, I'm new in java programming, i have insert amounts in database in this Format exp : 1.100.200,00 but the subtraction of this amount give false result . here is part of my code DecimalFormat df = new DecimalFormat(); DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setDecimalSeparator(','); symbols.setGroupingSeparator(' '); df.setDecimalFormatSymbols(symbols); statement = …

Member Avatar for Bensaber
0
304
Member Avatar for ibenwa

hello please i need help, am writing a project to check if a particular folder exist in client system , if not let it create it, but if found let it delet it from client side immediately the client visit the site. i try this on my localhost it work …

Member Avatar for JamesCherrill
0
195
Member Avatar for laguardian

So, I've created a program that when a user inputs a type of vehicle, it will print how much will the user pay for their fare. Here's what I have so far: How do I call the methods Vehicle, Vehicle1, etc.. so that I am able to print the fare …

Member Avatar for stultuske
0
3K
Member Avatar for Megan_7

Draw a flowchart and write the pseudocode to represent the logic for a program that will open two files, input and output.

Member Avatar for stultuske
-3
164
Member Avatar for John_165

Write a program that displays all numbers divisible by 3 and 4 within a range entered by user. Display five numbers per line. Numbers are separated by exactly two spaces. This is my code public class Chapter4 { public static void main(String[] args) { Scanner input = new Scanner(System.in); final …

Member Avatar for JamesCherrill
0
2K
Member Avatar for overwraith

I have a question about the dining philosopher problem. This is not about homework. I seem to have solved it, does it actually relate to anything? Is there any software that actually requires it?

Member Avatar for rproffitt
0
194
Member Avatar for Gl753

I'm working on assignment that requires me to generate and store 50 random PPS Numbers in an array but I'm not sure as to how to go about doing this. Keep in mind that I'm not asking anyone to do this assignment for me, this is just the part I …

Member Avatar for Janko_1
0
3K
Member Avatar for kenneth_12

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); Date date = sdf.parse(d); Calendar cal = GregorianCalendar.getInstance(); cal.setTime(date); for (i=0;x>i;i++){ cal.add(GregorianCalendar.DATE, 7); String t = sdf.format(cal.getTime()); DefaultTableModel model = (DefaultTableModel) jTable1.getModel(); model.addRow(new Object[]{t,c}); }

Member Avatar for Tarek_2
0
446
Member Avatar for alda_1

heyy can anyone please help me with this homework in java because i am new at this Create a program where it should appear in a dialog box your name,last name and the avarage of four exams :)

Member Avatar for Tarek_2
0
300
Member Avatar for divinity02

hi pple I am building this electronic role using an interface. during the course of designing the interface, tried running it just to see the look and feel of it and it is not showing can someone tell me why this happen. here is the code. havent start coding it …

Member Avatar for divinity02
0
3K
Member Avatar for Cj_5

Hi, first timer here so sorry before hand if I forget to mention something. My code run the window fine but when I hit the calculate button I receive an error message. Firstly this is my code package Chapter12; import javax.swing.*; import java.awt.event.*; public class TheaterGUI extends JFrame { JTextField …

Member Avatar for JamesCherrill
0
543
Member Avatar for coroll

Hi, I want to find all the words(scabble words) that can be made out of given set of letters. ex: abnana results: a aa ab an baa ban banana na nab How could i achieve this? Do i need a binary tree? Plz some one help me...

Member Avatar for JamesCherrill
0
2K
Member Avatar for Fen_1

I am working on implementing a binary search tree as an array implementation, but I am having trouble with correctly printing out all of the students' records using the showAll() method and my application also doesn't print out anything for the insert and fetch methods. What am I doing wrong? …

Member Avatar for JamesCherrill
0
401
Member Avatar for Saboor880

HI! I have made an desktop application, which i have to install on my client's pc. But I want that, except that particular cleint's pc, no other pc could run it. For this purpose i got a solution to get mac address of that pc and make a check for …

Member Avatar for stultuske
0
280
Member Avatar for skimmpy

how to reverse words in a sentence without using split or string tokenizer. I/p :- how are you O/p :- you are how

Member Avatar for stultuske
0
5K
Member Avatar for Dietrich_1

So I am confused as to how to generate random integers between a range, in the first one it says to make the range from 0 to n-1 and the precondition is that n has to be greater than 0. For the second import java.util.Random ; /** * This class …

Member Avatar for rproffitt
0
547
Member Avatar for overwraith

I am creating a reporting engine, it is kind of novel. **The only question I have is what are some of the wierder scheduling related things you guys have seen for you cyclical computer programs to date**. I am trying to cover as many fringe cases as I can, and …

Member Avatar for rproffitt
0
294
Member Avatar for aman rathi

Is there any method in java to generate random number (integer, byte or float). please tell me if any i need it in my program. if possible please give full example. thanks.

Member Avatar for stultuske
1
1K
Member Avatar for Mira Kris

Hello there, I'm new to Java programming nd I wan't to learn more from it. May I ask you some tips in creating a Lucky Nine game in Java with AI as the other player. Thank you so much for you help.

Member Avatar for stultuske
0
362
Member Avatar for manisha

Hi, I want to start the command prompt window from my java program. Tried using Runtime but its not working.These are my codes : [code]String command = "cmd.exe"; try { child = Runtime.getRuntime().exec(command); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }[/code] Actually, its working when i …

Member Avatar for stultuske
0
2K
Member Avatar for Dietrich_1

So I am having trouble knowing what to return in the bottom method any help would be appreciated . Here are the specifications for completing the StringArray class: (a) In the class StringArray write method numInArray,using the method signature below. numInArray should return the number of times the string s …

Member Avatar for JamesCherrill
0
877
Member Avatar for Moksuhd

Hi guys, This is my first post and basically i require some help editing my current code to help display number of students with a mark of 40 or above specifically. And also i am having difficulty generating a average i thought i done it but it remained constant a …

Member Avatar for JamesCherrill
0
444
Member Avatar for SimonIoa

I tried to run an Ionic 3 project from existing files using not C++ but Apache/Cordova and i am getting these errors. Idid a Typescript project works fine. But Cordova won't run with Javascript? Severity Code Description Project File Line Suppression State Error TS2304 Build:Cannot find name 'object'. ionic2 C:\Users\Simon\AppData\Local\Microsoft\Windows\INetCookies\Desktop\Various …

Member Avatar for SimonIoa
0
1K
Member Avatar for Dietrich_1

So I have a project with a tester that is not displaying what I thought it would display. The project description and everything is as follows: Given an array of integers, how can we make some basic statistical calculations on the data? Specifically, we want to be able to determine …

Member Avatar for hericles
0
11K
Member Avatar for Abdullah_18

hi can you help me please Write a program that breaks a number into its digits. Program keeps prompting the user to enter an integer and displays the digits of that integer until user enters -1 run like that Enter a number (-1 to end): 3457 ↵ Digit1 = 7 …

Member Avatar for pty
0
405
Member Avatar for rahaf_1

Write a program that computes the gold zakat. The user should enter the gold weight in gram and its worth. The program should print and calculate the zakat if the gold is worth 3000 or more. Otherwise, the program should print 0. Hint: zakat = gold worth * 2.5% how …

Member Avatar for rahaf_1
-1
1K
Member Avatar for BananaBread

Hi there. Sorry if this is in the wrong place! I am looking to create an app which allows a user to click on some words from a list (or three) to create a random sentence. What would be the easiest way to do this? I am using Android Studio …

Member Avatar for rubberman
0
363
Member Avatar for overwraith

I am creating an application that uses NHibernate, an object relational mapper that is a port of the Java Object relational mapper hibernate. Currently I am trying to represent my entities via hibernate xml files. The application I have right now is throwing an error I am thinking may be …

Member Avatar for stultuske
0
638

The End.