User Profile

Collapse

Profile Sidebar

Collapse
rsduck
rsduck
Last Activity: May 1 '12, 03:14 PM
Joined: Mar 6 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rsduck
    replied to Tallying numbers in an array???
    in Java
    I'm still missing something here... I changed the skiableDays() method to this:
    Code:
    public static void skiableDays(int[] sNWD) {
    		int skiable=0;
    		int i=0;
     		skiable+=sNWD[i];
    		if (skiable >= 4){
    		System.out.println("There were "+skiable+" skiable days.");
    		}
    	}
    This grabs every instance where sNWD[i] is 4 or greater and prints that instance....
    See more | Go to post

    Leave a comment:


  • rsduck
    replied to Tallying numbers in an array???
    in Java
    Ok so I called my skiableDays() function. The issues is that it is now counting the ints per row instead of adding up the rows with ints greater than or equal to 4.
    Example:
    These are the last 7 lines of the output:
    There were 5 skiable days.
    There were 5 skiable days.
    There were 0 skiable days.
    There were 0 skiable days.
    There were 0 skiable days.
    There were 0 skiable days.
    There were...
    See more | Go to post

    Leave a comment:


  • rsduck
    started a topic Tallying numbers in an array???
    in Java

    Tallying numbers in an array???

    I'm writing a program that took a matrix and put each column into its own int[]. Now for the part I'm struggling with. I need to tally up the numbers that are >= 4. Here's my code:
    Code:
    import java.io.*;
    import java.util.*;
    public class SunMoon {
    
    	
    	public static void main(String[] args) throws FileNotFoundException {
    		// TODO Auto-generated method stub
    		File file = new File("Portland.txt");
    ...
    See more | Go to post

  • How do I read from a text file and translate that info to graphics?

    My program is supposed to render graphics from the attached file. I can get my program to read the file without issue. My problem lies in getting the file to convert into graphics. I'm not even sure where to begin on this one. To say I'm frustrated would be a major understatement at this point. Here is my code so far:

    Code:
    import java.awt.*;
    import java.util.*;
    import java.io.*;
    
    public class Project8
    ...
    See more | Go to post

  • rsduck
    replied to Caesar Cipher letter extraction
    in Java
    I figured it out. In my method encrypt() I could only extract one letter and replace it with the corresponding letter from my key. So what I did was create 2 more methods named encryptI() and encryptII().
    This was from the encrypt() method:
    "String encrypted = encrypt(message , key);"
    So with my 2 other methods I did the same thing as with the first except for one change in each:
    "String encryptedI = encryptI(encryp ted,key);"...
    See more | Go to post

    Leave a comment:


  • rsduck
    replied to Caesar Cipher letter extraction
    in Java
    Basically, instead of encrypting the message, it's just having me encrypt the individual letters. For the other letters 'E' is the equivalent of 'b' according to the key, and 'D' the equivalent of 'a'.
    Maybe this will help you understand:
    Note: this text contains only one of each letter. If it were " abcabcabc" the result string would become "DbcDbcDbc" , then "DEcDEcDEc" , then "DEFDEFDEF" ...
    See more | Go to post

    Leave a comment:


  • rsduck
    replied to Caesar Cipher letter extraction
    in Java
    Sorry about the typo. I'm supposed to extract multiple letters at once.
    For example:
    Replace all 'c's with 'F's. Getting "the quiFk Erown fox jumps over the lDzy dog"

    The letters in bold show letters that were extracted, and replaced with their equivalent in the key(found in my main method).
    Does that make any sense?
    See more | Go to post

    Leave a comment:


  • rsduck
    started a topic Caesar Cipher letter extraction
    in Java

    Caesar Cipher letter extraction

    Hey, I have spent all of my afternoon writing this program that uses a Caesar Cipher for encryption. I have the entire program written and it works fine. this is the problem area:

    New text string is the above string converted to lower case, "the quick brown fox jumps over the lazy dog"
    Extract the letter 'D' (first letter) from the key. Extract the letter 'a' (first letter) from the ALPHABET.
    Replace all ...
    See more | Go to post

  • rsduck
    replied to Craps wins and losses
    in Java
    Thank-you so much! I literally tried everything except that.
    See more | Go to post

    Leave a comment:


  • rsduck
    started a topic Craps wins and losses
    in Java

    Craps wins and losses

    Hi, I'm writing a program that simulates 100 rounds of craps. I have the code written mostly. My one problem is that I can't seem to get the total numbers of wins and losses.
    Code:
    import java.util.Random;
    
    public class Test {
    
    	/**
    	 * This Program show the results of simulated games of craps using if else statements
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method
    ...
    See more | Go to post
    Last edited by Meetee; Mar 6 '12, 04:24 AM. Reason: use code tags [CODE][/CODE]
No activity results to display
Show More
Working...