Questions tagged [drjava]

A lightweight IDE for java, designed primarily for students

DrJava is a lightweight development environment for writing Java programs.

It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users. DrJava is available for free under the BSD License, and it is under active development by the JavaPLT group at Rice University.

For more information and downloads, visit the official site.

188 questions
0
votes
5 answers

retrieving a random word from a txt file and getting no output, and no compiler error java

i cannot change the shell of the program, the end goal is to choose a random word from a list of words in a txt file. i've scanned through this many many times, gone through the code one by one, tried many different things, but every time i run it,…
0
votes
3 answers

Dead code with arrays?

I am getting a "Dead Code" warning on my battleship game. I am testing if a ship can be placed and am seeing different direction that the ship will face if it can be placed. I then get input using In.class and after checking if it can be placed with…
0
votes
1 answer

Repeating elements in an array without repeating the same element

I take a computer science projects class, and I've been working on a project and I'm stuck. I have to write a program that has 5 riddles and 5 answers. I'm having trouble trying to repeat elements in an array randomly, without repeating the same…
0
votes
3 answers

String variable Initialization error

I'm receiving an error from my compiler. Anybody have any clues? import java.util.Scanner; public class mathProg { public static void main (String[] args) { Scanner keyboard = new Scanner(System.in); int num1, num2, numsum, numdif, numpro,…
0
votes
2 answers

java wont resolve to a variable

I am trying to make a rock paper scissors game in java. i have my base code here import java.util.Scanner; import java.util.Random; public class RPSBase { public static void main(String args[]) { Random rndm = new Random(); int c =0 +…
derpyherp
  • 455
  • 4
  • 9
  • 18
0
votes
1 answer

NullPointerException java sound file

import java.util.*; import java.awt.*; import java.io.*; public class Project4 { public static void main (String[] args) { // MAIN CODE String noteRepresentation = "78!9@a#bc$d%ef^g&A*BC(D)EF_G+H"; String noteString =…
0
votes
1 answer

Java Solution Checker issue

I've missed the deadline for this assignment but it is still bugging me that I do not understand what I'm doing for this project. Its part 2 of a sudoku solution checker that needs four methods added to it which are…
user3060040
  • 77
  • 1
  • 9
0
votes
1 answer

Can't figure out Java Sudoku Solution Checker

I'm working on a Sudoku Solution checker in Java right now that had been split into two parts. This second part wants five new "specific methods" added into the code which are boolean checks for rows, columns, blocks, and then return if they are…
user3060040
  • 77
  • 1
  • 9
0
votes
3 answers

how to detect all caps word in a string

I am new using java. I wanted to ask, if I have a text file containing different words per line and I want to read that file as a string in order to detect if there are certain words that are written in all caps (abbreviations). The exception being…
user2932716
0
votes
1 answer

How come java won't print the last line?

I'm new to java and I have an assignment to count #s in tweets (the # has to be at the beginning of the word). Here's the code: public static void main (String str[]) throws IOException { Scanner scan = new Scanner(System.in); …
Matthew Wu
  • 11
  • 1
0
votes
2 answers

Java Inner Classes NullPointerException

I am writing a short Java program that is supposed to take in a list of 5 integers and assign each to one of 6 members. I want to maximize the number of members who are receiving a value between their min and max values. Anyways, for some reason…
Sam G-H
  • 627
  • 6
  • 17
0
votes
1 answer

Bouncing ball off of paddle in breakout game ~java

So I am currently writing a code for a breakout game in java. Right now, I have it set up so that it prompts the player with a dialog box that asks the player how many bricks they want per row (a number between 4 and 40). The part that gets messed…
user2938241
  • 35
  • 2
  • 8
0
votes
1 answer

drjava: Is closing upon cancelling intended?

Whenever I try to close a file in drjava after making some edits and not saving, the program, as expected, gives the dialog box: "[Filename] has been modified. Would you like to save it?" In many cases, I'll decide at this point to cancel the…
0
votes
1 answer

Sorter program: What is the next step?

Here is the link to my homework assignment. http://courses.cs.purdue.edu/cs18000:fall13:hw13 I would prefer an explanation as opposed to the code that would actually answer the question so I can learn. The code I have right now is this. public…
0
votes
2 answers

How to get the full fraction value of a division result in java?

I am new to Java and I am using DrJava IDE for my testing. I have the following division 49700/40000 and it displays 1.0 instead of 1.2425. double t = 49700/40000; System.out.println(t); Is it something I am doing wrong?
Nair
  • 7,438
  • 10
  • 41
  • 69