+ 1
Cheer creator java
Here is the answer to this problem, I've been trying to find the mistake in my code for 2 days, at the end I found that I was printing "High five" instead of "High Five" you see guys, lol Here is the code: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scnr=new Scanner(System.in); double yards = scnr.nextDouble(); if(yards<1){ System.out.println("shh"); }else if(yards>10){ System.out.println("High Five"); }else if(yards<=10 && yards>=1){ for (int i=0; i<yards; i++){ System.out.print("Ra!"); }} } }
1 Resposta
+ 3
Scanner input = new Scanner(System.in);
int x = input.nextInt();
if(x<1) System.out.print("shh");
else if(x>10) System.out.print("High Five");
else for(int i=0;i<x;i++) System.out.print("Ra!");
good job
good luck