CSE110 Mid1 4
CSE110 Mid1 4
Note: There are 5 (five) questions, answer ALL of them. Course Outcome (CO), Cognitive Level, and Mark
of each questionnaire are mentioned at the right margin.
1. An ISBN-10 (International Standard Book Number) consists of 10 digits: The last [CO1, C2,
digit, is a checksum, which is calculated from the other nine digits using the Mark: 4]
following formula:
If the checksum is 10, the last digit is denoted as X according to the ISBN-10
convention. Write a program that prompts the user to enter the first 9 digits and
displays the 10-digit ISBN (including leading zeros). Your program should read
the input as an integer.
3. a. Create a Main class “CheckAcc”. Inside the main method of the Main class [CO1, C3,
create n number of objects of the Account class. Mark: 10]
Page 1 of 2
c. Now create a static method inside the Main class “ Boolean Equals ( Account
a1, Account a2)” which will take any two objects of Account type and return
true if the balance of the two objects are the same and return false otherwise.
e. Is it possible to call the Account (int id, double balance ) constructor from the
Account ()constructor? If yes then please write that specific part of the code
where we can call Account (int id, double balance ) from Account ().
4. Write a java program that will take a text as input and convert the text into tokens. [CO1, C3,
Sample output is given below: Mark: 4]
Input: I love java programming.
Output: I
love
java
programming.
5. Consider the following marks of Mid1, Mid2. Final, lab, and quiz exam of five [CO1, C3,
students. Mark: 6]
Write a program in Java that uses the above-mentioned dataset. Use a method
named processExamResult() that takes data of a particular exam and prints the
name of the student who obtained the highest and lowest marks in the exam.
Sample output is given below
Page 2 of 2