Computer Science, asked by sathwikadasari40937, 6 months ago

missed chapters
A new Chemistry teacher is very strict and
the students to do well in class. To aid this
lectures on each chapter will be repeated
periodically through the semester. In each
the next chapter is presented. When they
the end of the book, the lectures start ov
chapter 0. More formally, if there are
numChapters in the book, then on the it
!
ecture will be on chapter i%numChapte​

Answers

Answered by vish666656
4

Answer:

same here. can't understand it either

Answered by pragyakirti12345
0

Answer: Java Program

Given : Missed Chapters Program

Explanation:

import java.util.*;

public class Missed_Chapters

{

public static int missedLectures(int numChapters,int b,int e)

{

 return Math.min(e-b+1,numChapters);

}

public static void main(String[] args)

{

               Scanner sc = new Scanner(System.in);

 System.out.println(missedLectures(5,5,6));   //2

 System.out.println(missedLectures(4,3,5));     //3

}

}

#SPJ3

Similar questions