Answered step by step
Verified Expert Solution
Question
1 Approved Answer
why I nave error. in each. line when I write. the same answer for java code import java.util.Scanner; public class Hil3_problemi_Esam { public static void
why I nave error. in each. line when I write. the same answer for java code
import java.util.Scanner; public class Hil3_problemi_Esam { public static void main(String[] args) O Scanner sc = new Scanner(System.in); II ask user to input number of books System.out.println("How many Books did you buy: "); int count = sc.nextInt(); // checking for negative values if (count) { System.out.println("Invalid input."); return; } Il Display correct points according to number of books switch(count) case 1: System.out.println("you.earn 0 points. ".): case 1: System.out.println("you earn.5 points."): case 2: Systen.out.println("you earn. 15. points."): case 3: System.out.println("you, earn 30..points."); default: System.out.println("you earn 60 points."); } 42 44} RE 39M
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started