| Author |
Message |
|
|
you guys are way too clever, dont have a clue what your on about, can i steal your brains for a bit lol
|
 |
|
|
cheers for that. erm i'm sorta stuck on the first bit "write a method that takes a string as a parameter and returns a string. " dont understand what that means!
all i got so far is:
public Encode {
public static void main (String [] args)
public scrambleString();
LOL im well pants at this stuff!
|
 |
|
|
|
i officially hate java! its pants, i wish i'd taken geography instead!!!!!
|
 |
|
|
|
lol makes no difference, i still cant do any of the rest and it wudnt be my work, dont really fully understand what it does anyway
|
 |
|
|
i have to do it using the "ceaser cipher" as it says in my notes. ive sorta given up anyway, i really cant do it, ive written 3 lines of code and i cant get past that! its too hard
|
 |
|
|
the letters are moved on 3 spaces
e.g abc becomes cde this carries on in a loop so xyz becomes abc
|
 |
|
|
k, first you need to scramble the word using a cipher that moves the letters along 3 spaces
then this needs to be asigned to an ASCII code number
then you need to subtract all the ASCII values to get the coded message
this needs to be displayed
this then needs to be done in reverse to get the message back
|
 |
|
|
"create a Java program that allows you to encode and decode secret messages. Initially, a message should be stored in your Java program as a String, and should then be encoded and displayed. Finally, the coded message should then be decoded and displayed (to check it is the same as the original message)"
*Create a new class called "Encode".
*Write a method called "scrambleString" that takes a string as a parameter and returns a string.
*The method should encode the string provided in the parameter by using a Caesar cipher with a displacement of 3, (see this diagram for an illustration). The resulting string should be returned from the method.
*You should only change the characters in the string if they are letters (ignore any other characters).
i need some help starting this, i'm really struggling with the whole java concept and i need some advice!
|
 |
|
|
i am having trouble with making arrays work in my code!
# First, write a line of code that creates an array of 10 integers.
# Now write a loop that steps through the array, and sets each of the values in the array to a different number. e.g. set each array element to the same number as its index multiplied by ten.
myArray[number] = number * 10;
# Finally, write another loop to display all the values in the array, each on a separate line (Hint: System.out.println() may come in useful).
here is what i hae done so far:
class Array {
public static void main (String [] args){
int[]number = new int[10];
for(int i = 0; i< 10; i++){
System.out.println(number);
}
}
}
This is the driver:
public class ArrayTest{
public static void main (String [] args){
Array myArray = new Array();
myArray[number] = number * 10;
System.out.println(number);
}
}
the error is to do with the int number. i really am not sure what i am doing wrong! its all a bit mad
|
 |
|
|
im working on some code that prints out how many days are in each month, so if you enter 1, it will tell you that January has 31 days. This is my code so far but it doesnt like the parseInt line:
class DaysInMonth {
public static void main(String[] arguments) {
int[] daysInMonth = new int[12];
int m = Integer.parseInt(arguments[]); <---------- doesnt like this line!
for (int m = 1; m<=12; m++);
if (m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12)
daysInMonth[m-1] = 31;
else if (m==4 || m==6 || m==9 || m==11)
daysInMonth[m-1] = 30;
else if (m==2)
daysInMonth[m-1] =28;
for (int m=0; m<12; m++); {
System.out.println("The number of days in month" [m] + daysInMonth);
}
}
}
|
 |
|
|
hey, i am just doing computer science at uni as my minor and i'm finding it really difficult
i have some questions i need to do and i wondered if anyone could tell me if i'm doing them right!?
1. how many stars will this loop display?
for (int star = 9; star < 0; star --)
System.out.print("*")
i understood that to mean that the star has a value of 9, and when star is less than 0, do star minus 1. so i thought the answer was 0, but i am really confused can anyone help???
|
 |
|
|