User Profile
Collapse
-
i honestly i have no idea.my brain is like frying trying to figure this out. do i do something like make another loop array? and put char, then count digitis. -
public class hw_7{
public static void main(String[] args){
int[] anArray = new int[100];
for(int index =0; index <anArray.length ; index++){
anArray[index] = (int) (Math.random()* 10);
}
for(int element = 0; element < anArray.length; element++) {
System.out.prin tln("anArray[" + element + "]\t" + anArray[element]);...Leave a comment:
-
Math.random and Arrays
this what i got so far. i understand arrays and Math.random i think,but i need to use Math.random and arrays to make 100 random integers between 1 -9 what am i doing wrong? and what am i missing
import java.util.*;
import javax.swing.JOp tionPane;
public class hw_7 {
public static void main(String[] args){
Scanner input=new Scanner(System. in);
int Random =input.nextInt( );... -
-
import java.util.*;
public class hw_6 {
public static void main(String[] args){
System.out.prin tln("How much Millseconds ");
get millis; from input;
System.out.prin tln(convertMill is(millis) );
}
//return string
private static String convertMillis(l ong millis) {
StringBuffer sb = new StringBuffer();
sb.append(hours );...Leave a comment:
-
mport java.util.*;
public class hw_6 {
public static void main(String[] args){
}
private static String convertMillis(l ong millis) {
System.out.prin t("How much Millseconds ");
long time = millis / 1000;
int seconds = ((int)(time % 60));
int minutes = ((int)((time % 3600) / 60));
int hours = ((int)(time / 3600));
return convertMillis(0 ) ;
}
private...Leave a comment:
-
it doesn't matter i guess. as long it turns out like something like this 154:19:10 when the progarm is done. so it being hours:Minutes:S econdsLeave a comment:
-
Converting Milliseconds to Time
import java.util.*;
public class hw_6 {
public static void main(String[] args){
}
public static void convertMillis(l ong millis){
System.out.prin t("How much Millseconds ");
long Millis =0;
long time = Millis / 1000;
int seconds = ((int)(time % 60));
int minutes = ((int)((time % 3600) / 60));
int hours =...Leave a comment:
-
Help with convertMills
i have hard time doing this program.a example i have to is a string returning as hours:minutes:s econds, like convertMillis(5 500) returns a string 0:0:5, convertMillis(1 00000) returns a string, 0:140:. and convertMillis(5 55550000) 154:19:10. i am like having a brain bust lately and cant figure how to come make one and compile.Anyone help me? i have to make millseconds to hours:minutes:s econds
No activity results to display
Show More
Leave a comment: