Professional Documents
Culture Documents
OUTPUT
SOURCE CODE
OUTPUT
Algorithm
b. Read and store values for `lr` and `ur` from the user.
Step 3: Define a method named `display` that takes two integers `a` and `b`:
a. Calculate the binary representation of the current number using the `binary` method.
b. Check if the binary representation satisfies the condition using the `check` method.
Step 4: Define a method named `binary` that takes an integer `n` and returns an integer:
e. Increment `b`.
2. Use a loop to calculate the number of digits in `n` and store them in an array `ar`.
3. Use a loop to check the condition for each digit in the array:
Method Listing:
Class Listing:
Class Purpose
Represents a class for finding and displaying numbers in a given range whose binary representation has at least
one '1' in even positions. The program takes user input for the lower and upper range and uses methods like
binary and check to perform the required operations. The main method creates an object of this class and
BinOdd invokes the necessary methods.
Algorithm
Data
member: Type Purpose Scope
Default constructor, Parameterized
dd int Day of the date constructor
Default constructor, Parameterized
mm int Month of the date constructor
Default constructor, DateNumberToDate
d2 int Day used in the DateNumberToDate method method
Month used in the DateNumberToDate Default constructor, DateNumberToDate
m2 int method method
Array representing the number of days in
days int[] each month Default constructor
Day number used in accept and display Default constructor, accept method,
daynum int methods display method
sc Scanner Scanner object for input Default constructor
Method Listing:
Class Listing:
Class Purpose
Represents a class for handling dates. It includes methods to convert between a date and a day
Date_ number. The main method takes user input for a date, calculates and displays its day number, accepts
Serial Date Assignment Name Teacher’s Signature
No.
11 25.09.2023 EvenSeries
12 29.09.2023 Transpose
13 03.10.2023 Words
14 06.10.2023 Catalan
15 09.10.2023 Rome
16 13.10.2023 Book
17 16.10.2023 Lucky
18 16.10.2023 Ass18
19 06.11.2023 Mathrev
20 17.11.2023 Assotw
21 08.12.2023 Cr
22 13.12.2023 BinOdd
23 15.12.2023 Ass23
24 03.01.2024 Date
25 10.01.2024 Encrypt