Skip to main content

Mock 3 Slot3 - Handson - 21st July Java (30 Marks) 2. Detailed Information

 The Librarian of Universal Library wants to maintains log for all the books in the library.

Help the librarian to maintain the log in such a way that a book's name should be followed by its Author's name. Refer the output statements for the format.

Note: 

  • The Book name and Author name can contain space in between them. 
  • If the length of book name is less than or equal to 3 display "Invalid Book Name" and terminate the program.
  •  If the length of author name is less than to 6 display "Invalid Author Name".

Please do not use System.exit(0) to terminate the program.


Sample Input 1:

Enter the book name:

Programming in C

Enter the author name:

Richies

Sample Output 1:

Programming in C book was written by Richies

Sample Input 2:

Enter the book name:

Programming in C

Enter the author name:

Rich

Sample Output 2:

Invalid Author Name

Sample Input 3:

Enter the book name:

C++

Sample Output 3:

Invalid Book Name

The Librarian of Universal Library wants to maintains log for all the books in the library.  Help the librarian to maintain the log in such a way that a book's name should be followed by its Author's name. Refer the output statements for the format.  Note:   The Book name and Author name can contain space in between them.  If the length of book name is less than or equal to 3 display "Invalid Book Name" and terminate the program.  If the length of author name is less than to 6 display "Invalid Author Name". Please do not use System.exit(0) to terminate the program.    Sample Input 1:  Enter the book name:  Programming in C  Enter the author name:  Richies  Sample Output 1:  Programming in C book was written by Richies  Sample Input 2:  Enter the book name:  Programming in C  Enter the author name:  Rich  Sample Output 2:  Invalid Author Name  Sample Input 3:  Enter the book name:  C++  Sample Output 3:  Invalid Book Name Mock 3 Slot3 - Handson - 21st July  Java (30 Marks)  2. Detailed Information   Evaluation Result:    Result Description Summary of tests  *Note: All the test cases might not have same weightage +------------------------------+ |  8 tests run/ 8 tests passed | +------------------------------+


Evaluation Result:


 

Result Description

Summary of tests
*Note: All the test cases might not have same weightage
+------------------------------+
|  8 tests run/ 8 tests passed |
+------------------------------+

Comments

Must Read:

Zero One Knapsack | Recursion

 1. You are given a number n, representing the count of items. 2. You are given n numbers, representing the values of n items. 3. You are given n numbers, representing the weights of n items. 3. You are given a number "cap", which is the capacity of a bag you've. 4. You are required to calculate and print the maximum value that can be created in the bag without       overflowing it's capacity. Note: Each item can be taken 0 or 1 number of times. You are not allowed to put the same item again and again. Input Format A number n v1 v2 .. n number of elements w1 w2 .. n number of elements A number cap Output Format A number representing the maximum value that can be created in the bag without overflowing it's capacity Constraints 1 <= n <= 20 0 <= v1, v2, .. n elements <= 50 0 < w1, w2, .. n elements <= 10 0 < cap <= 10 Sample Input 5 15 14 10 45 30 2 5 1 3 4 7 Sample Output 75 Solution: import java.io.*; import java.util.*; public class Main...

Count Encodings

 1. You are given a string str of digits. (will never start with a 0) 2. You are required to encode the str as per following rules     1 -> a     2 -> b     3 -> c     ..     25 -> y     26 -> z 3. You are required to calculate and print the count of encodings for the string str.      For 123 -> there are 3 encodings. abc, aw, lc      For 993 -> there is 1 encoding. iic       For 013 -> This is an invalid input. A string starting with 0 will not be passed.      For 103 -> there is 1 encoding. jc      For 303 -> there are 0 encodings. But such a string maybe passed. In this case       print 0. Input Format A string str Output Format count of encodings Constraints 0 < str.length <= 10 Sample Input 123 Sample Output 3 Solution: import java.io.*; import java.util.*; public class Main {   ...

Rhumbus Pattern

  /* @ToDo     Rhumbus Pattern                 *   *   *   *   *                *   *   *   *   *            *   *   *   *   *        *   *   *   *   *    *   *   *   *   *        */ #include   <iostream> using   namespace   std ; int   main (){       #ifndef  ONLINE_JUDGE        ...

Climb Stairs With Variable Jumps

 1. You are given a number n, representing the number of stairs in a staircase. 2. You are on the 0th step and are required to climb to the top. 3. You are given n numbers, where ith element's value represents - till how far from the step you       could jump to in a single move.        You can of course jump fewer number of steps in the move. 4. You are required to print the number of different paths via which you can climb to the top. Input Format A number n .. n more elements Output Format A number representing the number of ways to climb the stairs from 0 to top. Constraints 0 <= n <= 20 0 <= n1, n2, .. <= 20 Sample Input 10 3 3 0 2 1 2 4 2 0 0 Sample Output 5 Solution: import java.io.*; import java.util.*; public class Main {     public static void main(String[] args) throws Exception {         // write your code here         Scanner sc = new Scanner(System.in);   ...

Software Engineering Concepts Configuration Management And Version Control Post-Quiz

 Software Engineering Concepts       Configuration Management And Version Control            Post-Quiz

UNIX Introduction to Unix | Post-Quiz

 UNIX  Introduction to Unix  Post-Quiz  Feedback Congratulations! You have passed by securing more that 80%. Question  1 Correct Mark 1.00 out of 1.00 Flag question Question text  What is the default maximum number of processes that can exist in Unix? Select one: a.  unlimited b.   32768           c.   4096        d.  1024          Feedback Your answer is correct. The correct answer is:  32768         Question  2 Correct Mark 1.00 out of 1.00 Flag question Question text Single user mode shell has _____ prompt.  Select one: a.   $ Normal user  b.  % Admin user c.  ~ Home user d.  # Root user    Feedback Your answer is correct. The correct answer is: # Root user  Question  3 Correct Mark 1.00 out of 1.00 Flag question Question text Predict the output for the following...

DH ASE B3 Slot 3 Mock 1 - Quiz

 DH ASE B3       Slot 3            Mock 1                 Quiz

Mock 3 Slot3 - Handson - 21st July RDBMS (20 Marks) 1.1 Owner Details

  Write a query to display Owner id, Owner name and Contact details of owner from 'Coimbatore' or 'Bangalore'. For contact details, display the Email ID, if it is not available, display phone number. If both are not available, display ‘NA’. Give alias name as CONTACT_DETAILS. Sort the result based on Owner name in descending order. ( Hint : Retrieve data from Owners table , Data is  case sensitive) Evaluation Result: Result Description Summary of tests:(Note:Your query is evaluated against different datasets. Kindly do not Hardcode) +------------------------------+ | 2 tests run / 2 test passed | +------------------------------+

Subscribe to Get's Answer by Email