0

How to fix this? it says ':' expected

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here for(int i=0; i<3 i++){ amount=(int)(amount * 90/100) } System.out.println(amount); }

15th Sep 2022, 8:43 AM
Mark Angelo Alarcon
Mark Angelo Alarcon - avatar
4 odpowiedzi
+ 2
You're not attentive. The compiler tells you that there is no ";" and indicates with arrows where to do it. Also you are missing "}" and it makes no sense to convert the result of the calculation, it will be of type int anyway: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here for(int i=0; i<3; i++){ 👆 amount=amount * 90/100; 👈 } System.out.println(amount); }👈 }
15th Sep 2022, 9:03 AM
Solo
Solo - avatar
+ 2
Thanks guys. I'm so sorry
15th Sep 2022, 9:59 AM
Mark Angelo Alarcon
Mark Angelo Alarcon - avatar
+ 1
//add this for(int i=0; i<3; i++) // you forgot to use semicolo after i < 3;
15th Sep 2022, 9:13 AM
Davinder Kumar
Davinder Kumar - avatar
+ 1
We all make mistakes at the beginning of the journey ☺️ Happy Coding! 👋😎
15th Sep 2022, 10:20 AM
Solo
Solo - avatar