here is my current code:
removing code for privacy purposes.
as you can see, subtract and multiply are not giving what they should output (i haven't fiddled with divide yet). i have no idea...
Type: Posts; User: taze
here is my current code:
removing code for privacy purposes.
as you can see, subtract and multiply are not giving what they should output (i haven't fiddled with divide yet). i have no idea...
EDIT: Figured it out, my rows/cols were swapped in the swap method. Oops.
For some reason, my code is that column is acting as a row and row acting as a column. Row should be the horizontal count, column being the vertical (as specified by my professor), however they have...
I fixed the second (the y's being v's) with a minor tweak in the decrypt method, I have no idea how, in the above code, I can save the newline characters so the output will print out correctly.
So I have it all done, now I just have one really bizarre issue.
You know Archie Comic's Svenson? For some reason that is the accent of my decryption software.
The output that is supposed to come...
What I need to do is use the args command to choose which method to go to. For instance, I have methods encrypt, decrypt, and crack. The user will open their command and prompt this:
...
What we're supposed to do is make it so that it finds the most common letter, that most common later is therefore 'e' (this is the premise). We then (or before, whichever I can get working) convert...
Thanks, so I got the encrypter working perfectly...now I'm working on making something that decrypts. To do that, I want it to find the most common letter in the array and it will see it's distance...
Then why doesn't
if (array[i] != space) {
(int) array[i] = (int) array[i] - 97;
work? I am trying to cast int array and subtract 97 from the number, however the compiler gives the...
Ooh yes, that is a useless if statement.
I had assumed that
int charAsNum = array[i] was supposed to change the array, so that it takes the letter and turn it into a number. Is there any way to...
Oops, I guess I should have been clearer, what happens is that the output (displayed thanks to System.out.println(array[i])) is the original array, so it is printing out a b c, what it should be...
So the goal of the assignment (or this direct part I'm working on at the moment) is to take an input (in this case, the file just has 'a b c d' in it.) and using a key (say by adding 5) take the...
Here is the error message I am getting:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: -1
at...
So I have this:
import java.util.*;
import java.io.*;
public class StoryGenB {
public static void main(String[] args) {
file();
}
So I fixed that so the current code is this:
import java.util.*;
import java.io.*;
public class StoryGenB {
public static void main(String[] args) {
file();
}
So I did realize that I wasn't printing anything out to the filewriter, and I renamed it like above so that my code is now this:
import java.util.*;
import java.io.*;
public class StoryGenB {...
Doesn't f.close() near the end of the code do the flush/closing of the FileWriter? It still only creates a blank document instead of writing the text.
Unfortunately, FileWriter is not something I've learned and I have any idea how to implement to the above code, likewise the file we have to use to bring the story has to be declared early on (when...
I've gotten sort of stuck on my assignment for my Java class and I was wondering if anyone could point me in the right direction.
The general idea of what is intended is that the computer will...
Well that worked and I'm a little embarrassed I missed that! Thanks so much for the help.
I looked and I don't need the initial yes/no answer, so I got rid of it.
So the goal is to allow them to choose play again as long as they have a positive bankroll, however once their bankroll is...
So basically, when someone's bankroll gets to 0 or below 0, I want the program to end so they cannot play any longer. Here is my current code:
import java.util.*;
public class Craps {...
It compiles and with a few minor tweaks to the basic mathematics it works as it's supposed to! Thank you so much for the help and sorry for being so confused! You really cleared it up, thank you!
3. So basically, you're saying that what I am attempting to do is do a calculation without stating the variables first - trying to define c before I define a and b.
So I thought to, in place of...
Unfortunately - I don't see it clearly.
You state:
Should the calculateTermBudget() method be called first, or should the other methods be called first with their results used to call the...