Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A company has N interns, interned from 1 to N. each interns has been given a device which generate password (number) everyday that will be

A company has N interns, interned from 1 to N. each interns has been given a device which generate password (number) everyday that will be used as a password for authorization at the office door every day in the morning. The internship for 50 days numbered from 0 to 49. Initially on the first day number in the device of k" intern will be 5000*k

Form the second day (ie, i=1) new number will be generated everyday in each device in the following way:

Day (i) = Day (i-1) + 5000+i;

Find the label of the intern from the given password.

Input specification

Input-1: N. number of interns Input-2: P. password used

Output: Returns the label of the intern for whom the password will be used.

Example-1:

Input1: 2

Input2: 5000

Output: 1

Example-2:

Input1: 10 Input2: 25003

Output: 3

please can you help to solve this problem by java

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

What challenges does QVC face? How has it confronted them so far?

Answered: 1 week ago

Question

Describe the options and trends in management education

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago