0
Please can anyone help me with the time conversion code?
Day conversion to hours
8 Answers
+ 1
I think you know that a day has 24 hours.
So if you have for example 3 days. You just take the number of days 24 times.
So in this example 3*24.
0
Thank you
0
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int emotion = scanner.nextInt();
switch(emotion){
case 1:
System.out.print("You are happy!");
break;
case 2:
System.out.print("You are sad!");
break;
case 3:
System.out.print("You are angry!");
break;
case 4:
System.out.print("You are suprised!");
break;
default:
System.out.print("Unkwon emotion.");
}
}
}
Please any help with finding the bug at case 3?
0
You have a typo inside your default case.
Unknown emotion.
0
Thank you đ....Any help with the board games codes.. tried but still gives me error
0
class Main {
public static void main(String[] args) {
//do not touch this code
Monopoly monopoly = new Monopoly();
Chess chess = new Chess();
Battleships battleships = new Battleships();
monopoly.play();
chess.play();
battleships.play();
}
}
abstract class Game {
abstract String getName();
abstract void play();
}
class Monopoly extends Game {
//give "Monopoly" name to game
String getName() {
return "Monopoly"
;
}
// play method should print "Buy all property."
void play() {
System.out.println("Buy all property.");
}
}
class Chess extends Game {
//give "Chess" name to game
String getName() {
return "Chess"
;
}
// play method should print "Kill the enemy king"
void play() {
System.out.println("Kill the enemy king.");
}
}
class Battleships extends Game {
//give "Battleships" name to game
String getName() {
return "B
0
By the way you can post a code with the plus sign surrounded with a circle. There you find all codes in the playground. Just set the filter on [My code bits] and pick the code you want to show us.
You can also post your private codes.
0
Pls I just need help with this one I have to get my certificate for submission before Friday