>ok so as of now i have and input box that opens stating to enter number
>of minuets to be converted. That part is fine so now i am having to to
>stat what is entered to be taken and done out to find nuber of
>days,hrs,mins. and using the % operator and the /60 and then i am
>getting lost and not sure how to go about this
see http://mindprod.com/jgloss/mixedbase.html
http://mindprod.com/jgloss/time.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
whl - 12 Mar 2006 20:17 GMT
What if have so far
import javax.swing.JOptionPane;
public class part2 {
/*
NAME: Wai Houng Leung
COS 160, Spring 2006, W 10:00 AM- 12:45 PM, Dr. Bantz
Assignment: #2, I am taking COS 160 in Java*/
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//---------------------------------------
// Part 2
//Converts a Number of Minutes to the
//equivalent number of Day,Hours,and Minutes
//
//---------------------------------------
String input;
int minutes = 60 ;
input = JOptionPane.showInputDialog("Enter Number of Minutes");
int JOptionPane.showMessageDialog(null,input / minutes);
}
private static String minutes() {
// TODO Auto-generated method stub
return null;
}
}
lost i guess
whl - 12 Mar 2006 20:17 GMT
what i have so far ,
import javax.swing.JOptionPane;
public class part2 {
/*
NAME: Wai Houng Leung
COS 160, Spring 2006, W 10:00 AM- 12:45 PM, Dr. Bantz
Assignment: #2, I am taking COS 160 in Java*/
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//---------------------------------------
// Part 2
//Converts a Number of Minutes to the
//equivalent number of Day,Hours,and Minutes
//
//---------------------------------------
String input;
int minutes = 60 ;
input = JOptionPane.showInputDialog("Enter Number of Minutes");
int JOptionPane.showMessageDialog(null,input / minutes);
}
private static String minutes() {
// TODO Auto-generated method stub
return null;
}
}
guess i am lost
whl - 12 Mar 2006 20:18 GMT
what i have so far ,
import javax.swing.JOptionPane;
public class part2 {
/*
NAME: Wai Houng Leung
COS 160, Spring 2006, W 10:00 AM- 12:45 PM, Dr. Bantz
Assignment: #2, I am taking COS 160 in Java*/
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//---------------------------------------
// Part 2
//Converts a Number of Minutes to the
//equivalent number of Day,Hours,and Minutes
//
//---------------------------------------
String input;
int minutes = 60 ;
input = JOptionPane.showInputDialog("Enter Number of Minutes");
int JOptionPane.showMessageDialog(null,input / minutes);
}
private static String minutes() {
// TODO Auto-generated method stub
return null;
}
}
guess i am lost
Oliver Wong - 16 Mar 2006 18:15 GMT
> what i have so far ,
>
[quoted text clipped - 37 lines]
> }
> guess i am lost
See
http://www.cs.usm.maine.edu/~bantz/instruction/COS160/Spring05/COS160assignment2.html
<quote>
Hint: This program is short but a little tricky. You must use integer
division and remainder (modulus, %) even if you can think of a way to do
this without them. If the original number of minutes is stored in an int
variable named minutes, then the number of hours is minutes / 60. See page
78 of the text for a little more about integer division. The number of
minutes remaining after that number of hours has been accounted for is
minutes % 60. See page 78 of the text for more on remainder. See also
below.
Note on integer division and remainder: If the values on both sides of a /
(division) operator are integers, the result will also be an integer.
Integers cannot represent a fractional value. That means that 5/2 cannot be
what we might expect (2.5), but is, in fact, the whole part of the resulting
value (2). The remainder is what remains after integer division. In grade
school you learned that 16/3 is 5 with aremainder of 1. The remainder
operator, %, evaluates 16 % 3 as 1.Both division and remainder work the same
if either or both of the operands is an integer variable instead of an
integer constant. Thus if we had a Java program with the following
statements in it:
int a = 16, b = 5, c, d;
c = a / b;
d = a % b;
// c would now have the value 3 and d would have the value 1
</quote>
- Oliver