Study Viral (Java Tutorials For Beginners - Step By Step)
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook Page
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET

Java Program 41 - Java Program to Print Alphabet Patterns - Study Viral

 November 23, 2018     Alphabet Pattern, Java Programs     No comments   

Java Program 41 - Java Program to Print Alphabet Patterns - Study Viral



In This Video You Can See how to Make Following
Kind of Alphabet Pattern...With two ways using integer and character data-type

EDCBA
EDCB
EDC
ED
E



Email :: info@studyviral.in
Or
Email :: studyviral.in@gmail.com 
Website:: www.StudyViraL.in 

Facebook Page ::  https://www.facebook.com/StudyViral.in/
For Suggestions You Can Email :: info@studyviral.in
http://studyviral.blogspot.in/
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 61-64)

 November 23, 2018     Computer Science And Applications Paper-II, DBMS, UGC NET JULY 2018     No comments   

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 61-64)



Q 61. In RDBMS, which type of Join returns all rows that satisfy the join condition?
 
(A) Inner Join
(B) Outer Join
(C) Semi Join
(D) Anti Join

Answer : (B) Outer Join
Explanation : Outer Join return all rows that satisfy condition from both the participating relations. An outer join extends the result of a simple join. An outer join returns all rows that satisfy the join condition and also returns some or all of those rows from one table for which no rows from the other satisfy the join condition. 
 

Q 62. Consider a relation book (title, price) which contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list ?

Select title
from book as B
where (select count ( * )
    from book as T
    where T.price > B.price) < 7
 
(A) Titles of the six most expensive books.
(B) Title of the sixth most expensive books.
(C) Titles of the seven most expensive books.
(D) Title of the seventh most expensive books.
 

Answer :  (C) Titles of the seven most expensive books.
 
Q 63.  In a Hierarchical database, a hashing function is used to locate the ________.

(A) Collision
(B) Root
(C) Foreign Key
(D) Records
 
Answer :  (B) Root
Explanation :  A Data Model is the methodology used by a particular DBMS to organize and access the data.
Hierarchical, Network and Relational Model are the three popular data models. 
However, the relational model is more widely used.
 
Hierarchical Model :

  • The hierarchical model was developed by IBM in 1968.
  • The data is organize in a tree structure where the nodes represent the records and the branches of the tree represent the fields.
  • Since the data is organized in a tree structure, the parent node has the links to its child nodes.
  • If we want to search a record, we have to traverse the tree from the root through all its parent nodes to reach the specific record. Thus, searching for a record is very time consuming.
  • The hashing function is used to locate the root.

 
Q 64. Relations produced from E – R Model will always be in ________.

(A) 1 NF
(B) 2 NF
(C) 3 NF
(D) 4 NF
 
Answer :  (A) 1 NF




Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 60)

 November 23, 2018     Computer Science And Applications Paper-II, Operation System, UGC NET JULY 2018     No comments   

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 60)



Q 60. In which of the following scheduling criteria, context switching will never take place ?

(A) ROUND ROBIN
(B) Preemptive SJF
(C) Non-preemptive SJF
(D) Preemptive priority


Answer : (C) Non-preemptive SJF


In Non – preemptive algorithms context switching will never take place because it doesn’t allow to switch the process until it is completed fully.

Except Non-Preemptive SJF , All are Preemptive.
CPU will leave the Shotest Process only after its Full execution,Once process is started to execute.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 59)

 November 23, 2018     Computer Science And Applications Paper-II, Operation System, UGC NET JULY 2018     No comments   

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 59)



Q 59. Consider the following three processes with the arrival time and CPU burst time given in milliseconds:

ProcessArrival TimeBurst Time
P107
P214
P328

The Gantt Chart for preemptive SJF scheduling algorithm is _________.

(A)
                    P1                               P2                     P3           
0                                           7                      13                        21

(B)
         P1                      P2                    P1                     P         
0                      1                        5                      11                    19    

(C)
                    P1                               P2                     P3           
0                                           7                      13                        19

(D)
          P2                    P3                                P1                     
0                      4                       12                                            19

Answer : (B)

Explanation : 
A) Not preemptive. P1 continues execution without being preempted.
B) Preemptive SJF . P1 executes for 1 second followed by execution of P2 for 4 secs. Then P1 finishes execution followed by P3.
C) Not preemptive as each of the processes carries on execution without being preempted.
D)Preemptive but P2 starts execution even before it has arrived which can't happen in reality.

P1 arrive at 0 it will be served by CPU for 1 unit. After 1 unit P2 arrived ans it is shortest So it will execute for 4 unit, after its execution There are 2 processes out of which P1 is shortest so it will execute for 6 unit after its execution P1 will execute for 8 unit.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 56-58)

 November 23, 2018     Computer Science And Applications Paper-II, Operation System, UGC NET JULY 2018     No comments   

UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 56-58)



Q 56. Which of the following statements are true ?
(a) External Fragmentation exists when there is enough total memory space to satisfy a request but the available space is contiguous.
(b) Memory Fragmentation can be internal as well as external.
(c) One solution to external Fragmentation is compaction.


Code:
(A) (a) and (b) only
(B) (a) and (c) only
(C) (b) and (c) only
(D) (a), (b) and (c)

Answer : (C) (b) and (c) only

Explanation:

  • External Fragmentation exists when there is enough total memory space to satisfy a request but the available space is contiguous. This is a false statement because external fragmentation occurs due to non contiguous available space.
  • Memory Fragmentation can be internal as well as external.True
  • One solution to external Fragmentation is compaction or shuffle memory contents.True


  • Q 57. Page information in memory is also called as Page Table. The essential contents in each entry of a page table is/are _________.

    (A) Page Access information
    (B) Virtual Page number
    (C) Page Frame number
    (D) Both virtual page number and Page Frame Number

    Answer : (C) Page Frame number

    Explanation: Page information in memory is also called as Page Table. The essential contents in each entry of a page table is page frame number. (i.e. Frame Number is essential in page table.)


    Q 58. Consider a virtual page reference string 1, 2, 3, 2, 4, 2, 5, 2, 3, 4. Suppose LRU page replacement algorithm is implemented with 3 page frames in main memory. Then the number of page faults are_________.

    (A) 5
    (B) 7
    (C) 9
    (D) 10


    Answer : (B) 7

    Explanation: Page replacement diagram for LRU:


    Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 54-55)

     November 23, 2018     Computer Science And Applications Paper-II, Operation System, UGC NET JULY 2018     No comments   

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 54-55)





    Q 54. Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPU's having explicit I/O instructions, such I/O protection is ensured by having the I/O instructions privileged. In a CPU with memory mapped I/O, there is no explicit I/O instruction. Which one of the following is true for a CPU with memory mapped I/O ?

    (A) I/O protection is ensured by operating system routines.
    (B) I/O protection is ensured by a hardware trap.
    (C) I/O protection is ensured during system configuration.
    (D) I/O protection is not possible.

    Answer : (A) I/O protection is ensured by operating system routines.

    Explanation: Memory mapped I/O means, accessing I/O via general memory access as opposed to specialized IO instructions.
    The programmer can directly access any memory location directly. To prevent such an access, the OS (kernel) will divide the address space into kernel space and user space. An user application can easily access user application. To access kernel space, we need system calls (traps).


    Q 55. Which UNIX/Linux command is used to make all files and sub-directories in the directory “progs” executable by all users ?

    (A) chmod− R a+x progs
    (B) chmod −R 222 progs
    (C) chmod−X a+x progs
    (D) chmod −X 222 progs

    Answer : (A) chmod− R a+x progs

    Solution : Option A will make all files and sub-directories in the directory (progs) executable by all users.
    -R is for recurssive calls, so that sub-directories within the directories can be accessed.
    a is for all users
    +x is for making things executable
    Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 51-53)

     November 23, 2018     Computer Science And Applications Paper-II, UGC NET JULY 2018     2 comments   

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 51-55)



    Q 51. At a particular time of computation, the value of a counting semaphore is 10. Then 12 P operations and “x” V operations were performed on this semaphore. If the final value of semaphore is 7, x will be:

    (A) 8
    (B) 9
    (C) 10
    (D) 11

    Answer :  (B) 9
    Solution : P operation : Decrements the value of semaphore by 1
    V operation : Increments the value of semaphore by 1
    Initially, value of semaphore = 10
    After 12 P operations, value of semaphore = 10 – 12 = – 2
    Now, after x V operations, value of semaphore = 7
    – 2 + xV = 7
    xV = 2 + 7 = 9 


    Q 52. In a paged memory, the page hit ratio is 0.40. The time required to access a page in secondary memory is equal to 120 ns. The time required to access a page in primary memory is 15 ns. The average time required to access a page is ________.

    (A) 105
    (B) 68
    (C) 75
    (D) 78

    Answer :  (D) 78

    Solution : Average access time = hit ratio * primary memory access time + (1 – hit ratio) * secondary memory access time

    Average access time = 0.4 * 15 + 0.6 * 120←
    Average access time = 6 + 72
    Average access time = 78.
    So, option (D) is correct.


    Q 53. In a multi-user operating system, 30 requests are made to use a particular resource per hour, on an average. The probability that no requests are made in 40 minutes, when arrival pattern is a poisson distribution, is _________.
     
    (A) e-15
    (B) 1 – e-15
    (C) 1 – e-20
    (D) e-20


    Answer : (D) e-20

    Solution : In One Hour = 30 Requests Sent
     in 40 minutes =   30 x 40   =  20  Requests Sent

                                            60 
     Here 20 is Number of request Sent in 40 minutes. (Let 𝛌 is number of request in 40 minutes)
    Therefore  𝛌 = 20

    But according to given statement in question Actual requests are made in 40 minutes is ZERO.
    Let x is actual requests in 40 minutes. (According to Question)
    i.e. x = 0 
      

    e−t/θe−t/θ
    e−t/θ

    Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 46-50)

     October 25, 2018     Computer Networks, Computer Science And Applications Paper-II, UGC NET JULY 2018     No comments   

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 46-50)






    Q 46. Which of the following statements are true ?

    (a) Three broad categories of Networks are
         (i) Circuit Switched Networks
        (ii) Packet Switched Networks
        (iii) Message Switched Networks

    (b) Circuit Switched Network resources need not be reserved during the set up phase.

    (c) In packet switching there is no resource allocation for packets.

    Code :
    1. (a) and (b) only
    2. (b) and (c) only
    3. (a) and (c) only
    4. (a), (b) and (c)

    Answer: 3). (a) and (c) only


    Q 47. In Challenge-Response authentication the claimant ________.
    1. Proves that she knows the secret without revealing it
    2. Proves that she doesn’t know the secret
    3. Reveals the secret
    4. Gives a challenge


    Answer: 1). Proves that she knows the secret without revealing it
    Reason: Challenge-Response authentication is a computer security protocol in which one party ask a question and another party must provide a valid answer. I.e. she knows the secret without revealing it or will provide the secret when it is asked.



    Q 48. Decrypt the message “WTAAD” using the Caesar Cipher with key=15.
    1. LIPPS
    2. HELLO
    3. OLLEH
    4. DAATW
    Answer: 2). HELLO
    Reason: In Ceaser cipher algorithm encryption and decryption takes place. During encryption right shift takes place depending upon the key and in decryption left shift takes place depending on key. In the given question key value is 15 and decryption is asked:
    Given message is WTAAD
    Left shift 15 on W is H
    Left shift 15 on T is E
    Left shift 15 on A is L
    Left shift 15 on A is L
    Left shift 15 on D is O
    The decrypted message will HELLO.


    Q 49. To guarantee correction of upto t errors, the minimum Hamming distance dmin in a block code must be ________.
    1. t+1
    2. t−2
    3. 2t−1
    4. 2t+1
    Answer: 4). 2t+1



    Q 50. Encrypt the Message “HELLO MY DEARZ” using Transposition Cipher with

    1. HLLEO YM AEDRZ
    2. EHOLL ZYM RAED
    3. ELHL MDOY AZER
    4. ELHL DOMY ZAER

    Answer: 3). ELHL MDOY AZER 
    Reason:
    In question encryption of given message using Transposition Cipher with 




    Given message is “HELLO MY DEARZ” Now arrange them in group of 4
    I.e. HELL OMYD EARZ
    i.e. replace the following...

    • second character in above format to the first place
    • fourth character to the second place
    • first character to the third place
    • third character to the fourth place.
    Encrypted message will be ELHL MDOY AZER.
    Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 41-45)

     October 25, 2018     Computer Networks, Computer Science And Applications Paper-II, UGC NET JULY 2018     No comments   

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 41-45)




    Q 41. A slotted ALOHA network transmits 200-bit frames using a shared channel with a 200 Kbps bandwidth. Find the throughput of the system, if the system (all stations put together) produces 250 frames per second :

    1. 49
    2. 368
    3. 149
    4. 151

    Answer: 1). 49


    Solution : Here G is 1/4, Therefore S = G x e-G = 0.195 (19.5), 
    this means 250 x 0.195 = 49. Only 49 frames out of 250 will probably survive.


    Q 42. The period of a signal is 100 ms. Its frequency is _________.

    1. 100³ Hertz
    2. 10⁻² KHz
    3. 10⁻³ KHz
    4. 10⁵ Hertz

    Answer: 2). 10⁻² KHz
    Solution: Explanation: We know that:
    frequency(f) = 1 / Time period(T)
    Given time period(T) = 100 ms
    f = 1 / 100ms
    f = 1000 / 100000 ms
    We know that 1000 ms = 1 sec and we can write 1000 as 1 k, i.e. f = 1k / 100s
    f = 10-2 kHz (1 / s = Hz) So, option (B) is correct.


    Q 43. The dotted-decimal notation of the following IPV4 address in binary notation is _________.

    10000001 00001011 00001011 11101111

    1. 111.56.45.239
    2. 129.11.10.238
    3. 129.11.11.239
    4. 111.56.11.239
    Answer: 3). 129.11.11.239

    Explanation:  IPV4 address = 10000001 00001011 00001011 11101111
    10000001 = 129,       00001011 = 11,     00001011 = 11,     11101111 = 239

    IPV4 address 10000001 00001011 00001011 11101111 is equivalent to 129.11.11.239
    So, option (C) is correct.


    Q 44. Which of the following statements are true ?


    (a) Advanced Mobile Phone System (AMPS) is a second generation cellular phone system.


    (b) IS – 95 is a second generation cellular phone system based on CDMA and DSSS.


    (c) The Third generation cellular phone system will provide universal personnel communication.

    Code :

    1. (a) and (b) only
    2. (b) and (c) only
    3. (a), (b) and (c)
    4. (a) and (c) only
    Answer: 2). (b) and (c) only
    Reason:
    • Advanced Mobile Phone System (AMPS) is a First generation cellular phone system.False
    • IS – 95 is a second generation cellular phone system based on CDMA and DSSS.True 
    • The Third generation cellular phone system will provide universal personnel communication.True
    SO, option (B) is correct.




    45. Match the following symmetric block ciphers with corresponding block and key sizes :


    Answer: 2). (ii)     (iv)       (i)      (iii)

    Reason:


  • Data Encryption Standard(DES) block cipher uses block size 64 and key size 64
  • International Data Encryption Algorithm (IDEA) uses block size 64 and key size 12.
  • BLOW FISH is the relacement for DES or IDEA, it uses block size 64 and key size ranges between 32 and 448
  • Advanced Encryption Standard (AES) uses block size 128 and key sizes 128, 192, 256

  • Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 37-40)

     October 25, 2018     Computer Science And Applications Paper-II, UGC NET JULY 2018     No comments   

    UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 37-40)





    Q 37. Context sensitive language can be recognized by a :

    (1) Finite state machine
    (2) Deterministic finite automata
    (3) Non-deterministic finite automata
    (4) Linear bounded automata

    Answer:  (4) Linear bounded automata


    Q 38. The set A={ 0n 1n 2n | n=1, 2, 3, ……… } is an example of a grammar that is :

    (1) Context sensitive
    (2) Context free
    (3) Regular
    (4) None of the above
     

    Answer:  (1) Context sensitive



    Q 39. A bottom-up parser generates :

    (1) Left-most derivation in reverse
    (2) Right-most derivation in reverse
    (3) Left-most derivation
    (4) Right-most derivation

     
    Answer:  (2) Right-most derivation in reverse



    Q 40. Consider the following statements( ) :

    S1 : There exists no algorithm for deciding if any two Turing machines M1 and M2 accept the same language.

    S2 : The problem of determining whether a Turing machine halts on any input is undecidable.

    Which of the following options is correct ?

    (1) Both S1 and S2 are correct
    (2) Both S1 and S2 are not correct
    (3) Only S1 is correct
    (4) Only S2 is correct

     
    Answer:  (1) Both S1 and S2 are correct


    Read More
    • Share This:  
    •  Facebook
    •  Twitter
    •  Google+
    •  Stumble
    •  Digg
    Newer Posts Older Posts Home

    Facebook

    StudyViral

    Labels

    Alphabet Pattern Binary Tree BLOB (Binary Large Object) Computer Networks Computer Science And Applications Paper-II Data Structure DBMS Digital Clock Digital Watch Extra Tutorials File Upload Find Age from Date of Birth Graph-Algorithms Java and J2EE web applications JAVA JDK 12 Java Mail API Java MySQL Java Programs Java Programs List Java Servlets Java Swing Java Swing With MySQL Database Java Tutorials JCalender KVS Compuer Science - January 2017 Question Paper MS Access JDBC Java Application Multiuser Login NETBEANS 11 IDE Occurrence of Digits in Number Operation System Pattern Program Reverse of String Sending Email Servlet Servlet Tutorial Software Engineering Star Struts 2 FrameWork Struts 2 Registration Form UGC NET JULY 2018 Windows Commands

    Popular Posts

    • Create CON, AUX, NUL name folder and files in Windows - Study Viral
      Create CON, AUX, NUL name folder and files in Windows - Study Viral Most of you may be aware of many MS-DOS commands but still n...
    • UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 26)
      UGC NET JULY 2018 (Computer Science And Applications Paper-II) (Question 26) Q 26. A binary search tree in which every non-leaf node...
    • Java Swing Application for Sending E-Mail - StudyViral
      Java Swing Application for Sending E-Mail - StudyViral Hello Friends Welcome to StudyViraL Channel In this video I am going...

    Categories

    • Alphabet Pattern (13)
    • Binary Tree (2)
    • BLOB (Binary Large Object) (1)
    • Computer Networks (2)
    • Computer Science And Applications Paper-II (40)
    • Data Structure (6)
    • DBMS (1)
    • Digital Clock (1)
    • Digital Watch (1)
    • Extra Tutorials (3)
    • File Upload (1)
    • Find Age from Date of Birth (1)
    • Graph-Algorithms (1)
    • Java and J2EE web applications (3)
    • JAVA JDK 12 (1)
    • Java Mail API (3)
    • Java MySQL (5)
    • Java Programs (44)
    • Java Programs List (3)
    • Java Servlets (3)
    • Java Swing (16)
    • Java Swing With MySQL Database (4)
    • Java Tutorials (37)
    • JCalender (1)
    • KVS Compuer Science - January 2017 Question Paper (6)
    • MS Access JDBC Java Application (6)
    • Multiuser Login (1)
    • NETBEANS 11 IDE (1)
    • Occurrence of Digits in Number (1)
    • Operation System (4)
    • Pattern Program (8)
    • Reverse of String (2)
    • Sending Email (1)
    • Servlet (3)
    • Servlet Tutorial (3)
    • Software Engineering (4)
    • Star (7)
    • Struts 2 FrameWork (2)
    • Struts 2 Registration Form (1)
    • UGC NET JULY 2018 (40)
    • Windows Commands (2)

    Pages

    • Java Tutorials
    • ASP.NET (in Hindi)
    • Java Programs List

    Blog Archive

    • ►  2021 (3)
      • ►  April 2021 (3)
    • ►  2019 (7)
      • ►  June 2019 (1)
      • ►  May 2019 (2)
      • ►  March 2019 (4)
    • ▼  2018 (111)
      • ▼  November 2018 (7)
        • Java Program 41 - Java Program to Print Alphabet P...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
      • ►  October 2018 (20)
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
        • UGC NET JULY 2018 (Computer Science And Applicatio...
      • ►  September 2018 (10)
      • ►  August 2018 (3)
      • ►  July 2018 (19)
      • ►  June 2018 (5)
      • ►  May 2018 (2)
      • ►  April 2018 (3)
      • ►  March 2018 (11)
      • ►  February 2018 (18)
      • ►  January 2018 (13)
    • ►  2017 (36)
      • ►  December 2017 (10)
      • ►  November 2017 (9)
      • ►  October 2017 (7)
      • ►  September 2017 (10)

    About Me

    Rohit Basra
    Hello guys my name Rohit Basra. I love to code and teach java language.
    View my complete profile

    Followers

    Copyright © Study Viral (Java Tutorials For Beginners - Step By Step) | Powered by Blogger