To calculate the chapter from which you must solve the programming exercise, divide the integer number representing your student ID by 3, consider the remainder (either 0, 1 or 2) and increment it by 3. The result you obtain represents the chapter number, and it should be 3, 4 or 5.

Respuesta :

ijeggs

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

       System.out.println("Please Enter Your Student ID");

       Scanner in = new Scanner(System.in);

       int yourId = in.nextInt();

      int chapterToRead = (yourId%3)+3;

       System.out.println("You are to read chapter: "+chapterToRead);

   }

}

Explanation:

This solution is implemented in Java programming language. The scanner class is used to receive user input which is saved in an int variable yourId. In order to obtain the remainder when the students' ID is divided by 3, we use the modulo (%) operator which returns the remainder