32,204 Topics
| |
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++) { … | |
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++) { … | |
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 = … | |
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 … | |
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 … | |
Draw a flowchart and write the pseudocode to represent the logic for a program that will open two files, input and output. | |
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 … | |
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? | |
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 … | |
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}); } | |
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 :) | |
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 … | |
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 … | |
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... | |
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? … | |
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 … | |
how to reverse words in a sentence without using split or string tokenizer. I/p :- how are you O/p :- you are how | |
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 … | |
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 … | |
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. | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.