nvm my new compile error was just a typo. i got what you said but i still got an error all b/c of a typo. thanks
Type: Posts; User: silverpen10
nvm my new compile error was just a typo. i got what you said but i still got an error all b/c of a typo. thanks
no I'm not sure how to do that in this case
Write a program that generates 100 random integers in the range 0 to 25, and stores them in an array. Then, the program should call a class method that sorts the odd numbers into an array and another...
public class Unit8
{
public static void main( String [] args )
{
int [] even = new int [ 100 ];
int [] odd = new int [ 100 ];
int randomNum;
i think cels method is pulling f as 0 not from the case 1
gottcha so i should do it in the other program
--- Update ---
if i put 55 in for fahrenheit i get 57.6 (it should be 12.7)
public class prgmONE // Peter Krasinski
{
public static void...
nvm i did 5/9. your right i get 1.0
its 0 how do i change it
Its sill not returning the proper value
public class prgmONE // Peter Krasinski
{
public static void main(String [] args)
{
double c = 0, f = 0;
double c2 = cels(c, f);
int which =...
new program
public class prgmONE // Peter Krasinski
{
public static void main(String [] args)
{
int c = 0, f = 0;
int c2 = cels(c, f);
int which = Input.getInt("1 for Celsius, 2...
i got it to work
new code
public class prgmTWO
{
public static void main(String [] args)
{
double P = Input.getInt("How much have you deposited?");
double i = Input.getInt("What is...
Last login: Mon Jan 7 11:11:36 on ttys000
petes-MacBook-Air:~ pkrasinski$ cd java\ programs/
petes-MacBook-Air:java programs pkrasinski$ javac prgmTWO.java
prgmTWO.java:10: variable s might not...
heres the error1701
sorry its small
input.class?
i dont know whats wrong
public class prgmTWO
{
public static void main(String [] args)
{
double P = Input.getInt("How much have you deposited?");
double i = Input.getInt("What is...
true but i got a 100
public class Unit6_1 // Peter Krasinski
{
public static void main( String [] args )
{
int i = 0;
int sumODD = 0, sumEVEN = 0;
while ( ++i <= 25 )
{
if (i % 2...
every time it loops it displays the sum of the next even or odd number. the final is the sum of all numbers. i want to display that number alone
public class Unit6_1 // Peter Krasinski
{
public static void main( String [] args )
{
int i = 0;
int sumODD = 0, sumEVEN = 0;
while ( ++i <= 25 )
{
if (i % 2...
got it thanks
i never used counters before can you explain
public class Unit6_2 // Peter Krasinski
{
public static void main( String [] args )
{
int x = 0;
System.out.println();
while ( x <= 10 )
{
Nvm i got the numbers now how would you add all values of odd or even
i got the evens by i % 2 == 0. but i can't get the odd even with if else