32,199 Topics

Member Avatar for
Member Avatar for John_233

`import java.util.*; import java.time.*; public class Customer import java.util.*; import java.time.*; public class Customer{ private String name; private int custID; static int nextCustID = 100; ArrayList<Rent> rents = new ArrayList<Rent>(); public Customer(String n){ name = n; custID = nextCustID++; } public void addRent(int copyNo, LocalDate date, int days){ Rent r …

Member Avatar for JamesCherrill
0
345
Member Avatar for Adel_5

hi i want some change in this code. let one writer, one reader at the same time. Writer has preference. package test; import java.util.concurrent.Semaphore; class ReaderWritersProblem { static Semaphore readLock = new Semaphore(1); static Semaphore writeLock = new Semaphore(1); volatile static int readCount = 0; static class Read implements Runnable …

Member Avatar for jwenting
0
413
Member Avatar for yashal

Hi all, Can anyone help me implement push pop instruction and call recall function in the wombat one program. Im a newbie to these things so it will be helpful if anyone could just take me step by step on what to do. many thanks.

Member Avatar for rproffitt
0
160
Member Avatar for Jeinel

Hi can anyone help me convert these codes into java and let me know which classes are to have? // Clustering.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <string.h> #include "MersenneTwister.h" #define CATAGORICAL_CONST 30.0 #define MAX_FILENAME_SIZE 500 #define MAX_BUFFER_SIZE 500 #define MAX_STRING_SIZE 100 #define …

Member Avatar for Dani
0
988
Member Avatar for csacoa

I'm using android studio to create a multiple choice question app, and i've coded the quiz but so far it just goes on forever. I want to make it so that once the user has answered 20 questions, whether they are right or wrong, the game ends and sends them …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Violet_82

Hi guys, I seem to have an issue with a boolean method returining a value. Here is the code excerpt - irrelevant code omitted: public class StreamsTest { public static void main(String[] args) { String[] arr = new String[]{"a", "b", "c"}; //convert array to string with streams List<String> list = …

Member Avatar for masijade
0
3K
Member Avatar for csacoa

Just a quick question, I'm trying to speed up my app and I've seen forum posts where people say reducing the size of pictures speeds up their app. I was hoping to replace my exit cross in the top corner of my app (which is a png because I drew …

Member Avatar for rproffitt
0
427
Member Avatar for guffadi

//With this method, I input a string and return an array that contains a sorted list of characters as per the frequency. Eg: If i input "apple", the out put should be p,a,l,e, How do I do this? public static ArrayList<Character> characterFreqDist(String statement) { char[] Array = statement.toCharArray(); int length …

Member Avatar for JamesCherrill
0
3K
Member Avatar for richard.haines.39

Need Help! Here's the first production worker. Exception in thread "main" java.lang.IllegalArgumentException: Multiple decimal separators in pattern "#.##0.00" at java.text.DecimalFormat.applyPattern(DecimalFormat.java:2519) at java.text.DecimalFormat.<init>(DecimalFormat.java:416) at ProductionWorker.toString(ProductionWorker.java:42) at java.lang.String.valueOf(String.java:2826) at java.io.PrintStream.println(PrintStream.java:771) at WorkerDemo.main(WorkerDemo.java:10) Java Result: 1 BUILD SUCCESSFUL (total time: 8 seconds) // Employee Class public class Employee { private String name; private …

Member Avatar for Demonix
0
6K
Member Avatar for guffadi

/** This code is supposed to take the user input of the length and breadth of the room in one class, get the user input of the material and cost from the other class and calculate the total cost.*/ import java.util.Scanner; //My first class class RoomFlooring { private String FloorMaterial; …

Member Avatar for JamesCherrill
0
850
Member Avatar for guffadi

import java.util.Scanner; class Room_Dimension { private double length; private double width; public Room_Dimension(double length, double width) { this.length = length; this.width = width; } public void setLength(double length) { this.length = length; } public void setWidth(double width) { this.width = width; } public double getLength() { return length; } public …

Member Avatar for JamesCherrill
0
605
Member Avatar for Johannes_4

Hi, how do I sort the string in alphabetical order? find most occuring character("blablabla") remove most occuring("aaa") input: blablabla output: "aaa"

Member Avatar for JamesCherrill
0
2K
Member Avatar for Fernando_14

I have a small application written using javascript (NodeJS). How can I run it as an executable file?

Member Avatar for Lianamelissa
0
3K
Member Avatar for sadiyah_1

Hey!!!!I'm looking for the perl to java conversion!!!! Can Someone please help me with the snippet!!!! As soon as possible!! Its very important!!!! my @hosts = get_hosts_ips_bymkt(); for(my $i = 0; $i < scalar(@hosts); $i = $i + 1){ my $ssh_true = eval { Net::SSH::Perl->new($hosts[$i]) }; // # $success = …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Mike1986

A palindrome is a phrase that reads the same forwards as it does backwards. For example, “a man, a plan, a canal, Panama,” is a palindrome. Write a program that uses a stack data structure to check for palindromes in each line of a text file. Test your program on …

Member Avatar for JamesCherrill
0
2K
Member Avatar for V3N0M

Hi guys so I was playing with some code which would determine the whether a string is a palindrome or not. Its been a mixed bag of results with some palindromes being detected while others aren't. I do apologize to the lack of polish of my comments but I hope …

Member Avatar for JamesCherrill
0
3K
Member Avatar for ic17054

Hi everyone! i'm new to binary trees, and i wanted to write a method to find out how many nodes have bigger values than an integer n!! Any help would be appreciated :) ishi xx

Member Avatar for rproffitt
0
182
Member Avatar for rainmaker42

I have an assignment doing a constructor that accelerates and brakes the speed of the car (among other non-troublesome things) but when I run the program, the speed stays constant and spits out whatever the original number is rather than raising and lowering by 5 like I want it to. …

Member Avatar for rainmaker42
0
515
Member Avatar for miller anderson

Hi everyone, I'd like to ask you all to help me with this two questions and I've been faced recently, 1.What would be the algorithm which takes the pointers of two Binary Search Trees roots, if equal returns true if not FALSE. (both BSTs are the same as well as …

Member Avatar for Tarek_2
0
305
Member Avatar for Maxpein

hello. I need some help in java 1.The program browse the filename of the text file to be counted 2.The contents of the file will be stored to a temporary storage. 3.Identifies if the c source code in a form of text file is physical lines of code, blank lines …

Member Avatar for rproffitt
0
399
Member Avatar for terrie4

Does anyone know about robovm??? It is a platform to make ios apps in java. I need it for a new project I´m working on in a nearshore outsourcing company.

Member Avatar for rproffitt
0
373
Member Avatar for dukoolsharma
Member Avatar for golith1974

I am testing my Library class and the addItem method is not adding an item to the arraylist import java.util.ArrayList; public class Library { /** * itemList contains the List of all items in the library. */ private ArrayList<Item> itemList = new ArrayList<Item>(); Item item = new Item(); // Empty …

Member Avatar for JamesCherrill
0
354
Member Avatar for rakesh4java

# I want to give a button in my JSP page, which on click of it should store an image in the filesystem. # Following is the code ScreenCapture.java which is a servlet. Purpose: To capture the screen of working area and store it in file system. Problem: - An …

Member Avatar for stultuske
0
1K
Member Avatar for Kam_1

Hi, I have a problem, because I have a list, in which I'd like to be able to add and remove components, but in other thread I use components from this list. Is there a safe way to operate over this list? Would using synchronized functions (one for drawing, one …

Member Avatar for JamesCherrill
0
341
Member Avatar for dukoolsharma

Why much time is needed to access an applet having swing components the first time?

Member Avatar for HimaniBansal
-1
305
Member Avatar for Karen_9

I'm new to Java and I'm trying to recreate a simplified version of the Game of Mastermind. I managed to allow the player to input once but then it stops. I don't know how to fix this, I've tried everything I knew how to do to fix this but I …

Member Avatar for JamesCherrill
0
373
Member Avatar for misstj555

# Lab Assignment # We must create a program that will print a sorted list of all the students and the corresponding scores listing the highest score first and the lowest score last. In this case I would need a Bubble Sort. ## Question ## This is my "Bubble Sort" …

Member Avatar for misstj555
0
2K
Member Avatar for Leem_1

I do the class but there are some codes I need to help me please : -Write a number of member functions that do the following: •Calculate the student GPA •Search for the highest mark taken in a particular course •Print the ID, first name, and last name of all …

Member Avatar for nourimane
1
936
Member Avatar for Kam_1

Hi, I have the program, which is a traffic simulation, and I have a few linked lists in it. I'd like to ask you what is the easiest way to check if I don't have duplicats in them? The code which runs it looks like that: public static void main(String[] …

Member Avatar for JamesCherrill
0
284

The End.