35,618 Topics

Member Avatar for
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
379
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
886
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
445
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 lucy nana

I facing a problem with checkbox value that already exists inside the database. so how can I retrieve those value into another database table? The table subject and service below is what I want. But based on the code below the SERVICE TABLE on SUBJECTID COLUMN producing null value. How …

0
451
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
412
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
364
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
642
Member Avatar for overwraith

I have the following error as part of my nhibernate project; **Could not find a setter for property '0' in class 'AdHockey.Models.User'** The following is my model; public class User { /// <summary> /// Unique identifier for group used by program and database layer. /// </summary> public virtual int UserId …

Member Avatar for overwraith
0
2K
Member Avatar for random_1

Hello, is it possible to have a multidimensional array of different type? We have to create a simple "joke" application with GUI, and what I was thinking is that for each question a character(image) with a speech bubble asks a question like for example a joke about a banana would …

Member Avatar for JamesCherrill
0
278
Member Avatar for Dietrich_1

So I am having trouble with the last bit of the car class, I have to update the number of gallons in the car based on the number of miles driven... public class Car { private double mpg; private double mileage; private double tankCapacity; private double gasInTank; /** Constructs a …

Member Avatar for JamesCherrill
0
888
Member Avatar for Dietrich_1

Alright so I have a tester for this class and it keeps saying this message: "Now testing your drive method: *** A car with mileage of 700 miles driving 400 miles before running out of gas should not now have mileage of 1700.0 miles" However when I remove the mileage …

Member Avatar for stultuske
0
424
Member Avatar for Dietrich_1

So I am simplifying fractions for my fractions class and I am having trouble with the euclidian code for the gcd, it also doesn't print to the console window it just runs and nothing happens: public class GCD { public static void main(String[]args) { int n = 5 ; int …

Member Avatar for tinstaafl
0
186
Member Avatar for Dietrich_1

HI, so my code compiles but does not give the result I intended. Any help is greatly appreciated! How can we count the number of occurrences of a character or group of characters (a substring) inside of a given string of characters? In other words, how can we count the …

Member Avatar for JamesCherrill
0
451
Member Avatar for Dietrich_1

HI, so my code compiles but does not give the result I intended. Any help is greatly appreciated! public class SubstringCounter { public static int substringCounter(String master, String substring) { int count = 0 ; for(int pos = 0 ; pos < master.length() ; pos++) { int index = master.indexOf(substring, …

Member Avatar for JamesCherrill
1
359
Member Avatar for Deamanjoe

How can implement a perfect hashed data structure using the four basic operations? Could I do something like this or do I need to break up my code into two different classes and then test the methods from another class's main method? public class PerfectHashed{ int ticketNumber; // keyfield String …

Member Avatar for rproffitt
0
392
Member Avatar for rahaf_1

Write a java program that asks a person for his height (in meters) and weight (in kilograms) and outputs one of the messages: underweight, normal, or obese, using the BMI formula and BMI classification. Body Mass Index (BMI) is an index used to measure the body fat using the height …

Member Avatar for rahaf_1
0
2K
Member Avatar for Thanuj_1

We have a flex project which called from browser by using a swf file. After flash update the swf file is disabled. Here are the list of flash versions and browsers that we used in windows 7 OS. * Installed Firefox 56.0 - NPAPI 25.0.0.170 version in Firefox . - …

Member Avatar for rproffitt
0
425
Member Avatar for Mohammed_44

//The php section of the code <?php function getJSONFromDB($sql){ $conn = mysqli_connect("localhost", "root", "","rent"); //echo $sql; $result = mysqli_query($conn, $sql)or die(mysqli_error()); $arr=array(); while($row = mysqli_fetch_assoc($result)) { $arr[]=$row; } return json_encode($arr); } $jsonData= getJSONFromDB("select Pic from Display"); $jsn=json_decode($jsonData); //for loop to retrieve rows from database for($i=0;$i<sizeof($jsn);$i++){ $a=$jsn[$i]->Pic; //here is the main …

Member Avatar for network18
0
379
Member Avatar for nonik

please help me, create an algorithm that can be used to spell out a positive number worth less than 1,000,000 and create a c ++ program for the algorithm

Member Avatar for stultuske
0
385
Member Avatar for Stefce

Hello everyone hope you are doing well, i was busy these days i was having problem with the police in my country, they catch me smoking weed and now i got criminal record... but never mind that i hope will be better in the future. So i got in mind …

Member Avatar for taersious
0
949
Member Avatar for Dipayan_1

Can you please Create a student database in java using string and arrays wherein we can store details of students Like their ROLL no, Name, Father's Name,DOB, Section and then also search a student using his DOB or Roll No. or Name?

Member Avatar for pty
0
2K
Member Avatar for kenya_1
Member Avatar for Zxander

I've come across a little problem. How do I make it so that after my game is finished, I can choose whetever to exit my program or just restarting it from the beginning. In main method I've started my while loop to check my tries left if my counter is …

Member Avatar for Zxander
0
355
Member Avatar for Sinisa_1

Good man James helped me learn die roll board game programming in Java, and I applied it on Ladders and Snakes. Made one in Java. Now I'm learning to do it in Android. Here's the question: Making simple Ladders and Snakes game. Can't use those in Google Play, they don't …

Member Avatar for Sinisa_1
0
3K
Member Avatar for divinity02

hi this is one of my assignment that I have to do. it is a triangle calculator. everything well with it but it just the calculation. when I run it, it gives a zero output. I think it may be my calculation. can someone take a look at it and …

Member Avatar for tinstaafl
0
286

The End.