Notes, abstracts, papers, exams and problems of Computers to Other Classes

Showing results 0 - 1 of 1 1

Clasified in Problems of Computers of Other Classes.

Written at Dicember 15, 2009 on enEnglish with a size of 2,511 bytes.


//A
public class Tempo{
private int hora, mins, segs;
int quant = 0;

//B
public Tempo(){
quant++;
}

public Tempo(int hora, int mins, int segs){
quant++;
setHora(hora);
setMins(mins);
setSegs(segs);
}


//C
public void solicita(){
String h = JOptionPane.showInputDialog("Informe a hora:");
String m = JOptionPane.showInputDialog("Informe os minutos:");
String s = JOptionPane.showInputDialog("Informe os segundos:");

hora = Integer.parseInt(h);
mins = Integer.parseInt(m);
segs = Integer.parseInt(s);
}

//D
public void imprime(){
String h, m, s;
if (hora < 10){
h = "0"+hora;
}else{
h = ""+hora;
}

if (mins < 10){

... (Continue)
Karma: -10%
5 Hits
1
© Wikiteka, 2010
Chuletas  |  Apuntes