Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package conditionalStatementsLab;
- import java.util.Scanner;
- public class P06SpeedInfo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double speed = Double.parseDouble(scanner.nextLine());
- String resultText = "";
- if (speed <= 10) {
- resultText = "slow";
- } else if (speed <= 50) {
- resultText = "average";
- } else if (speed <= 150) {
- resultText = "fast";
- } else if (speed <= 1000) {
- resultText = "ultra fast";
- } else {
- resultText = "extremely fast";
- }
- System.out.println(resultText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement