NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023

Join Our WhatsApp Group Join Now
Join Us On Telegram Join Now

NPTEL Programming In Java Week 8 Quiz Assignment Solutions

NPTEL Programming In Java Week 1 Assignment Answers 2023

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023

1. Which of the following method is/are of class button in java.awt package?
a. getLabelO
b. setLabel(String label)
c. getCurrentO
d. getItem(int index)

Answer :- For Answer Click Here

2. Which of the following is NOT a class of java.awt package?
a. Button
b. Component
c. Dialog
d. Paint

Answer :- For Answer Click Here

3. Which of the following statements) is/are correct?
a. AWT components are platform-independent.
b. AWT follows the MVC (Model View Controller).
c. Swing components are platform-dependent.
d. Swing follows MVC (Model View Controller).

Answer :- For Answer Click Here

4. When we invoke repaint () for a java. awt. Component object, the AWT invokes which following method?
a. draw)
b. show
c. update()
d. paint)

Answer :- For Answer Click Here

5. Which package provides many event classes and Listener interfaces for event handling?
a. java.awt
b. java.lang
c. java.io
d. java.util

Answer :- For Answer Click Here

6.

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023
Answer :- For Answer Click Here

7. Which of the following is TRUE regarding check box and radio button?
a. Check box is used for single selection item whereas radio button is used for multiple selection.
b. Check box is used for multiple selection items whereas radio button is used for single selection.
c. Both are used for multiple as well as single item selection.
d. Checkbox is always preferred than radio buttons.

Answer :- For Answer Click Here

8. Which of the following is TRUE about check bor in Java?
a. A check box can be in either an “on” (true) or “off* (false) state.
b. Clicking on a check box changes its state from “on” to “off,” or from “off” to “on.”
c. A check box can be in an “on” (true) and in “off* (false) state simultaneouslv.
d. Check boxes cannot be grouped together.

Answer :- For Answer Click Here

9. Which of the following is the latest graphics and media package for Java?
a. Applet
b. AWT
c. Swing
d. JavaFX

Answer :- For Answer Click Here

10. If setText(String text) is a method of Label class, then why it is called non editable?
a. Because user-input is unavailable during runtime.
b. A Label is just a TextField with non-editable property turned on.
c. Labels are editable by default.
d. setText(String text) is not a method of Label class.

Answer :- For Answer Click Here

NPTEL Programming In Java Week 8 Programming Assignment Solutions 2023

Week 8 : Programming Assignment 1

Q1. Write a program which will print a pyramid of “*” ‘s of height “n” and print the number of “*” ‘s in the pyramid.

For example:
Input : 5
Output:  

        * 
      * * * 
    * * * * *
  * * * * * * * 
* * * * * * * * * 
25

Answer :- For Answer Click Here

Week 8 : Programming Assignment 2

Q2. Write a program which will print a pascal  pyramid of  “*” ‘s of height “l” .

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023
Answer :- For Answer Click Here

Week 8 : Programming Assignment 3

Q3. Write a program which will print a pyramid of “numbers” ‘s of height “n” and print the sum of all number’s in the pyramid.

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023
Answer :- For Answer Click Here

Week 8 : Programming Assignment 4

Q4. Write a program to print symmetric Pascal’s triangle of “*” ‘s of height “l” of odd length . If input “l” is even then your program will print “Invalid line number”

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023
Answer :- For Answer Click Here

Week 8 : Programming Assignment 5

Q4. Write a program to display any digit(n) from 0-9 represented as a “7 segment  display”

NPTEL Programming In Java Week 8 Quiz Assignment Answers 2023
Answer :- For Answer Click Here
Course NameProgramming In Java
CategoryNPTEL Assignment Answer
HomeClick Here
Join Us on TelegramClick Here

Leave a comment