Programming In Java | Week 1

Session: JAN-APR 2024

Course name: Programming In Java

Course Link: Click Here

For answers or latest updates join our telegram channel: Click here to join

These are NPTEL Programming In Java Week 1 Assignment 1 Answers

Q1. What is the primary focus of Java programming? a. Low-level optimizations b. Hardware-specific operations c. Platform independence d. Assembly language programming

Answer: c. Platform independence

Q2. Which of the following programming principles is a key aspect of Java? a. Code obfuscation b. Platform dependence c. Object-oriented programming d. Global variables

Answer: c. Object-oriented programming

Q3. What is the last step in the Java programming process? a. Java Program Execution b. Java Program Editing c. Java Program Compilation d. C/C++ versus Java

Answer: a. Java Program Execution

Q4. Which of the following is NOT a Java programming tool? a. Eclipse b. NetBeans c. IntelliJ IDEA d. GCC

Answer: d. GCC

Q5. What does the term “Write Once, Run Anywhere” (WORA) imply in Java? a. Code reusability b. Platform independence c. Cross-compilation d. Dynamic typing

Answer: b. Platform independence

Q6. In Java, what is used to store multiple values of the same type? a. Structures b. Pointers c. Arrays d. Lists

Answer: c. Arrays

Q7. Which of the following is a valid identifier in Java? a. 123identifier b. _identifier c. #identifier d. identifier-123

Answer: b. _identifier

Q8. What is the purpose of Java Language Subset? a. To limit the capabilities of Java b. To make Java code compatible with other languages c. To define a smaller set of Java features for specific purposes d. To enhance the performance of Java programs

Answer: c. To define a smaller set of Java features for specific purposes

Q9. What is the primary purpose of the Java Virtual Machine (JVM) in the Java programming language? a. Code optimization b. Platform independence c. Memory management d. Hardware-specific operations

Q10. What is emphasized during the Java Program Editing phase? a. Writing platform-specific code b. Debugging the program c. Compiling the program d. Writing and modifying the source code

Answer: d. Writing and modifying the source code

More Weeks of Programming In Java: Click here

More Nptel Courses: https://progiez.com/nptel-assignment-answers

Session: JULY-DEC 2023

Course Name: Programming In Java

Programming Assignment

Question 1 Complete the code segment to find the perimeter and area of a circle given a value of radius. You should use Math.PI constant in your program. If radius is zero or less than zero then print ” please enter non zero positive number “.

Question 2 Complete the code segment to find the largest among three numbers x,y, and z. You should use if-then-else construct in Java.

Question 3 Consider First n even numbers starting from zero(0).Complete the code segment to calculate sum of  all the numbers divisible by 3 from 0 to n. Print the sum. Example: Input: n = 5 ——- 0 2 4 6 8 Even number divisible by 3:0 6 sum:6

Question 4 Complete the code segment to check whether the number is an Armstrong number or not. Armstrong Number: A positive number is called an Armstrong number if it is equal to the sum of cubes of its digits for example 153 = 1 3 +5 3 +3 3 , 370, 371, 407, etc.

Question 5 Complete the code segment to help Ragav , find the highest mark and average mark secured by him in “s” number of subjects.

More Nptel Courses: Click here

Session: JAN-APR 2023

Course Name: NPTEL Programming In Java Assignment

Week 2: Click Here

Q1) What is the incorrect statement about bytecode? a. Java when compiles the source code, it converts it to bytecode. b. JVM (Java Virtual Machine) is an interpreter of bytecode. c. Bytecode is not portable and it needs to be compiled separately for each platform. d. JVM offers a protected environment which helps in enhanced safety for the system.

Answer: c. Bytecode is not portable and it needs to be compiled separately for each platform.

Q2) Consider the following program What is the output of the above code? a. a b. Compiler error due to line n1 c. Compiler error due to line n2 d. Print nothing

Answer: d. Print nothing

Q3) Which one of the following is not a primitive datatype? a. byte b. short c. class d. long

Answer: c. class

Q4) Which of the following is not a keyword in java? a. final b. super c. integer d. extend

Answer: c, d

Q5) Consider the following program What will be the output of the program if it is executed? a. 15-even-1 b. 15-odd-1 c. 15-even- d. 15-odd-

Answer: b. 15-odd-1

Q6) Why does the error “javac is not recognized as an internal or external command” occur? a. Path is not set for java b. JDK is not correctly installed c. .class file is not found d. javac jar is missing from java library

Answer: a. Path is not set for java

Q7) Following is a piece of code where some parts of a statement is missing: In the following, some options are given. You have to choose the correct option(s) for the argument in System.out.print() function to print the value 102. a. nptel[nptel.length-2] + nptel[0] b. nptel[0] + nptel[nptel.length-2] c. “” + nptel[nptel.length-2] + nptel[0] d. “” + nptel[0] + nptel[nptel.length-2]

Answer: a, b

Q8) Which of the following concept that Java doesn’t support? a. inheritance b. serialization c. goto d. array

Answer: c. goto

Q9) The subsystem of JVM that is used to load class files is known as ______. a. Classloader b. JRE c. JDK d. Compiler

Answer: a. Classloader

Q10) What is the value of total after executing the following code snippet? int mark = 5; int grace = 2; int total = mark + (mark > 6 ? ++grace : –grace); a. 6 b. 5 c. 4 d. 3

Answer: a. 6

Assignment Solution

Complete the code segment to help Ragav , find the highest mark and average mark secured by him in “s” number of subjects.

Consider First n even numbers starting from zero(0).Complete the code segment to calculate sum of  all the numbers divisible by 3 from 0 to n. Print the sum. Example: Input: n = 5 ——- 0 2 4 6 8 Even number divisible by 3:0 6 sum:6

Complete the code segment to find the perimeter and area of a circle given a value of radius. You should use Math.PI constant in your program. If radius is zero or less than zero then print ” please enter non zero positive number “.

Complete the code segment to check whether the number is an Armstrong number or not. Armstrong Number: A positive number is called an Armstrong number if it is equal to the sum of cubes of its digits for example 153 = 1 3 +5 3 +3 3 , 370, 371, 407, etc.

Complete the code segment to find the largest among three numbers x,y, and z. You should use if-then-else construct in Java.

Session: JULY-DEC 2022

1. What of the following can be used for a variable name in java? a. Byte b. Throw c. This d. Extend

Answer: Please login to see answer .

2. A platform is the hardware or software environment in which a program runs. Which of the following is/are java platform component? a. HTML b. Java Virtual Machine c. Java application programming interface(API) d. HotJava

3. What is the value returned by the method f()  define below? Public static int f(int x, int y) {return (x>y) ? y: x; }

  • The sum of x and y that is,  x + y.
  • Thee difference of x and y that is,  x-y.
  • The maximum of x and y that is,the large r value of x and y
  • The minimum of x and y that is, the smaller r value of x and y

4. A java file with extension ‘.class’ contains

  •  Java source code
  • Java byte code
  • A program file written in java programming language

5. Which of the following is used to find and fix bus in the Java programs?

6. What will be the output of the program if it is executed?

What will be the output of the program if it is executed?

ANSWER:-  a

7. Following is a piece of code where some part of the statement is missing :

In the following , some option are given. You have to choose the correct option for the argument in system.out.print() function to print the first and the  last but one characters in the array nptel.

  • nptel[nptel.length-2] + nptel[0]
  • nptel[0] + nptel[nptel.length-2]
  • “” +  nptel[nptel.length-2] + nptel[0]
  • “” + nptel[0] + nptel[nptel.length-2]

8. Consider the following program .

  •  Print first six even numbers.
  •  Print first six odd  numbers.
  • Print first five even number.
  • Print first six Fibonacci numbers.

9. Int N = Integer.parseInt (args[])

10. Consider the following   program.

  • Print the value of N!
  • Print the value of N(N+1)/2
  • Print the value of 1*3*3*



..* N
  • Print the value of 1!*2!*3!*




*N!

Programming Assignment Answers

Q1. Complete the code segment to find the perimeter and area of a circle given a value of radius.

You should use Math.PI constant in your program. If radius is zero or less than zero then print ” please enter non zero positive number “.

Q2. Complete the code segment to find the largest among three numbers x,y, and z. You should use if-then-else construct in Java.

Q3. Consider First n even numbers starting from zero(0). Complete the code segment to calculate sum of  all the numbers divisible by 3 from 0 to n. Print the sum.

4. Complete the code segment to check whether the number is an Armstrong number or not.

Q5. Complete the code segment to help Ragav , find the highest mark and average mark secured by him in “s” number of subjects.

* The material and content uploaded on this website are for general information and reference purposes only. Please do it by your own first. COPYING MATERIALS IS STRICTLY PROHIBITED.

MORE NPTEL ANSWERS: CLICK HERE

These are NPTEL Programming In Java Week 1 Assignment 1 Answers

swayam-logo

Programming In Java

--> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> --> -->

Note: This exam date is subject to change based on seat availability. You can check final exam date on your hall ticket.

Page Visits

Course layout, books and references, instructor bio.

nptel java programming assignment answers 2022

Prof. Debasis Samanta

Course certificate.

  • Assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course. 
  • ( All assignments in a particular week will be counted towards final scoring - quizzes and programming assignments). 
  • Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam - out of 100
  • Proctored Exam score =50% of the proctored certification exam score out of 100

nptel java programming assignment answers 2022

DOWNLOAD APP

nptel java programming assignment answers 2022

SWAYAM SUPPORT

Please choose the SWAYAM National Coordinator for support. * :

Quizermania Logo

Programming in Java | NPTEL 2022 | Week 6 Programming Assignments Solutions

This article will help you with the answers of  Programming in Java NPTEL 2022 Week 6 Programming Assignment Solutions .

Programming in Java NPTEL Week 6 Programming Assignment 1 Solutions

Complete the code segment  to print the following using the concept of extending the  Thread  class in Java: —————–OUTPUT——————- Thread is Running. ————————————————-

Programming Assignment 2 Solution

In the following program, a thread class Question62 is created using the Runnable interface Complete the main() to create a thread object of the class Question62 and run the thread. It should print the output as given below. —————–OUTPUT——————- Welcome to Java Week 6 New Question. Main Thread has ended. ————————————————-

Programming Assignment 3 Solution

A part of the Java program is given, which can be completed in many ways, for example using the concept of thread, etc.  Follow the given code and complete the program so that your program prints the message “NPTEL Java week-6 new Assignment Q3”. Your program should utilize the given interface/ class.

Week 6: Programming Assignment 4 Solution

Execution of two or more threads occurs in a random order. The keyword ‘synchronized’ in Java is used to control the execution of thread in a strict sequence. In the following, the program is expected to print the output as given below. Do the necessary use of ‘synchronized’ keyword, so that, the program prints the Final sum as given below:   —————–OUTPUT——————- Final sum:6000 ————————————————-

Week 6: Programming Assignment 5 Solution

Add necessary codes to print the following: —————–OUTPUT——————- Name of thread ‘t1’:Thread-0 Name of thread ‘t2’:Thread-1 New name of thread ‘t1’:Week 6 Assignment Q5 New name of thread ‘t2’:Week 6 Assignment Q5 New ————————————————-

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Related Posts

Html mcq : html basics (multiple choice question), html mcq : html web browsers (multiple choice question).

Preprocessor Directives

C programming MCQ : Preprocessor Directives(MULTIPLE CHOICE QUESTION)

C++ mcq : c++ basics(multiple choice question), leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

  • 1st Central Law Reviews: Expert Legal Analysis & Insights

NPTEL Programming In Java Assignment 8 Answers 2022

NPTEL Programming In Java Assignment 8 Answers 2022:-  All the Answers provided here to help the students as a reference, You must submit your assignment at your own knowledge

What is Programming In Java?

With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, that software should be platform-independent, Internet-enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment. Now, the Java programming language is being used for mobile programming, Internet programming, and many other applications compatible with distributed systems. This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own field of studies. CRITERIA TO GET A CERTIFICATE Average assignment score = 25% of the average of the best 8 assignments out of the total 12 assignments given in the course. Exam score = 75% of the proctored certification exam score out of 100 Final score = Average assignment score + Exam score YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF THE AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100. Below you can find the answers for NPTEL Programming In Java Assignment 8

NPTEL Programming In Java Assignment 8 Answers 2022 {July – Dec}

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

2. Which of the following is/are NOT an exception of java.awt package? a. AWTEror b. AWTException c. FontFormatException d. all of these

Answers will be Uploaded Shortly and it will be Notified on Telegram, So  JOIN NOW

NPTEL Programming In Java Assignment 8 Answers 2022

3. Which of the following method is/are a class button of java.awt package? a. paint(Graphics g) b. setLabel(String label) c. getCurent() d. getltem(int index)

4. Which of the following container does not contain titlebar and menubar 2? a. window b. panel c. container d. frame

5. Which package provides many event classes and Listener interfaces for event handling? a. java.awt.activeevent b. java.awt.event C. java.awt.listener d. none of these

6. What is the name of the method used to get the current font of an graphic in java.awt.graphies? a. abstract FontMetrics getFontMetrics(Font f) b. abstract Font getFont() C. FontMetrics getFontMetrics() d. None of these

👇 For Week 09 Assignment Answers 👇

7. Which of the following method remove all items from scrolling list in java.awt.list? a. hide() b. clear() C. remove() d. None

8. Which of the following statement is true about the update) in java.awt package? a. Sets the color of the graphics context to be the foreground color of this component. b. Calls this component’s paint method to completely redraw this component. c. Clears this component by filling it with the background color. d. All of these.

9. Which of the following methods can be used to return the current size size of a java.awt.Component object? a. dimension() b. setSize() C. area() d. size() e. resize(0

10. When we invoke update () for a java.awt.Component object, the A\VT invokes which of the following method? a. show() b. draw) c. paint() d. repaint0

Programming Assignment

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

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

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 .

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” .

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

For More NPTEL Answers:-  CLICK HERE Join Our Telegram:-  CLICK HERE

NPTEL Programming In Java Assignment 8 Answers 2022:-

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

👇 FOR NEXT WEEK ASSIGNMENT ANSWERS 👇

Disclaimer :- We do not claim 100% surety of solutions, these solutions are based on our sole expertise, and by using posting these answers we are simply looking to help students as a reference, so we urge do your assignment on your own.

For More NPTEL Answers:-  CLICK HERE

Join Our Telegram:-  CLICK HERE

Programming In Java Assignment 8 Answers 2022:-  All the Answers provided here to help the students as a reference, You must submit your assignment at your own knowledge

If you found this article Interesting and helpful, don’t forget to share it with your friends to get this information.

Leave a Comment Cancel reply

You must be logged in to post a comment.

Please Enable JavaScript in your Browser to Visit this Site.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

IMAGES

  1. NPTEL PROGRAMMING IN JAVA WEEK 5 ASSIGNMENT ANSWERS

    nptel java programming assignment answers 2022

  2. NPTEL PROGRAMMING IN JAVA WEEK 6 ASSIGNMENT ANSWERS

    nptel java programming assignment answers 2022

  3. NPTEL Programming In Java Assignment 1 Answers Solution Week 1

    nptel java programming assignment answers 2022

  4. NPTEL Programming In Java Week 8 assignment 8 Quiz Answers 2022

    nptel java programming assignment answers 2022

  5. NPTEL Programming In Java assignment 1 Answers 2022 || Unique Jankari

    nptel java programming assignment answers 2022

  6. NPTEL

    nptel java programming assignment answers 2022

VIDEO

  1. JAVA PROGRAMMING

  2. NPTEL Java week 01 programming assignment 3 solutions #nptel #aboutcomputercode

  3. NPTEL

  4. NPTEL Programming In Java WEEK 7 PROGRAMMING ASSIGNMENT ANSWERS

  5. NPTEL programming in Java Week 8 Assignment 8 Answers Solution Quiz

  6. NPTEL Programming in Java Week-1 Assignment Solution #nptelcourseanswers

COMMENTS

  1. nptel-solutions · GitHub Topics · GitHub

    NPTEL Assignment Answers and Solutions 2024 (July-Dec). ... Welcome to the NPTEL "Programming in Java" course repository! This repository hosts a comprehensive collection of programming assignments, quizzes, and test solutions for the NPTEL "Programming in Java" course offered in the years 2024, 2022, and 2020.

  2. bkkothari2255/Programming_In_Java_NPTEL

    Java Week 6:Q2 In the following program, a thread class ThreadRun is created using the Runnable interface which prints "Thread using Runnable interface". Complete the main class to create a thread object of the class ThreadRun and run the thread, Java Week 6:Q3 A part of the Java program is given, which can be completed in many ways, for example using the concept of thread, etc. Follow the ...

  3. nptel-java-solutions · GitHub Topics · GitHub

    Welcome to the NPTEL "Programming in Java" course repository! This repository hosts a comprehensive collection of programming assignments, quizzes, and test solutions for the NPTEL "Programming in Java" course offered in the years 2024, 2022, and 2020.

  4. Programming in Java

    Programming in Java NPTEL Week 2 Programming Assignment 1 Solutions. Complete the code segment to call the method print() of class Student first and then call print() method of class School. // This is the class named School class School { // This is a method in class School public void print() { System.out.println("Hi!

  5. Programming in Java

    Programming in Java NPTEL 2022 Week 12 Quiz Solutions. Q1. Which statement is true in case of using "this" keyword in a static method? a) "this" keyword can be used in static method to access static variables only. b) "this" keyword can't be used in static method. c) "this" keyword can be used in static method. d) None.

  6. Programming in Java

    Week 4: Programming Assignment 4 Solution. Complete the code segment to call the default method in the interface First and Second. interface First{// default method default void show(){System.out.println("Default method implementation of First interface.");}} interface Second{// Default method default void show(){System.out.println("Default ...

  7. NPTEL

    🌟 Welcome to my NPTEL Programming in Java repository! 🚀 This repository is a comprehensive collection of my solutions and detailed notes for the NPTEL Programming in Java course. It's designed for learners, Java enthusiasts, and anyone eager to delve into the world of Java programming. Resources

  8. Programming In Java

    October 2022 NPTEL Exams - Hall Tickets Released! ... Programming In Java - Assignment- 7,8,9,10 & 11 Solution Released Dear Participants, The Assignment-7,8,9 ... You will have to write your answers on sheets of paper and submit the answer sheets. Papers will be sent to the faculty for evaluation.

  9. NPTEL Programming In Java Assignment 1 Answers Solution Week 1

    Join our Telegram Channel : https://telegram.me/SwayamSolverLink of Code :-https://programified.blogspot.com/2022/07/programming-in-java-july-2022-programs.h...

  10. NPTEL 2022

    Programming in Java NPTEL Week 7 Programming Assignment 1 Solutions. Complete the following code fragment to read three integer values from the keyboard and find the sum of the values. Declare a variable "sum" of type int and store the result in it. // Write the appropriate statement(s) to import the package(s) you need in your program ...

  11. NPTEL Programming In Java Week 1 Assignment 1 Answers

    These are NPTEL Programming In Java Week 1 Assignment 1 Answers. Question 3. Complete the code segment to find the perimeter and area of a circle given a value of radius. You should use Math.PI constant in your program. If radius is zero or less than zero then print " please enter non zero positive number ". Solution:

  12. Programming In Java

    Week 1 : Overview of Object-Oriented Programming and Java. Week 2: Java Programming Elements. Week 3: Input-Output Handling in Java. Week 4: Encapsulation. Week 5: Inheritance. Week 6: Exception Handling. Week 7: Multithreaded Programming. Week 8: Java Applets and Servlets. Week 9: Java Swing and Abstract Windowing Toolkit (AWT)

  13. NPTEL 2022

    Week 5: Programming Assignment 5 Solution. In the following program, there may be multiple exceptions. You have to complete the code using only one try-catch block to handle all the possible exceptions. For example, if user's input is 1, then it will throw and catch "java.lang.NullPointerException". j = 92/ zero; break; case 1: int b ...

  14. nptel-assignments · GitHub Topics · GitHub

    Nptel assignment answer for Java Programming. java nptel-assignments Updated Apr 12, 2024; progiez / nptel-assignmnet-answers Star 8. Code Issues Pull requests ... and test solutions for the NPTEL "Programming in Java" course offered in the years 2024, 2022, and 2020.

  15. GitHub

    By following these steps, you can easily locate and use the assignment answers and solutions for the NPTEL courses provided in this repository. We hope this resource assists you in your studies! List of Courses

  16. NPTEL 2022

    Week 6: Programming Assignment 4 Solution. Execution of two or more threads occurs in a random order. The keyword 'synchronized' in Java is used to control the execution of thread in a strict sequence. In the following, the program is expected to print the output as given below. Do the necessary use of 'synchronized' keyword, so that ...

  17. NPTEL Programming In Java Assignment 8 Answers 2022

    NPTEL Programming In Java Assignment 8 Answers 2022:-. Q1. Write a program which will print a pyramid of "*" 's of height "n" and print the number of "*" 's in the pyramid. Code:-. import java.util.*; public class Pattern1 {.

  18. Programming-in-Java-NPTEL/README.md at master

    Java Week 1:Q1 To find the perimeter and area of a circle given a value of radius. Java Week 1:Q2 To find the largest among three numbers x, y, and z. Java Week 1:Q3 Consider First n even numbers starting from zero (0) and calculate sum of all the numbers divisible by 3 from 0 to n. Print the sum. Java Week 1:Q4 To check whether the number is ...

  19. NPTEL-JAVA-PROGRAMMING/README.md at main

    Programming Assignments: Dive into hands-on coding exercises that reinforce key concepts covered in the course.Each assignment presents unique challenges to sharpen your Java programming skills. Quizzes: Test your understanding of Java programming with quizzes designed to assess your knowledge and comprehension of course topics.Challenge yourself and track your progress as you advance through ...

Course Status : Completed
Course Type : Elective
Duration : 12 weeks
Category :
Credit Points : 3
Undergraduate
Start Date : 24 Jan 2022
End Date : 15 Apr 2022
Enrollment Ends : 07 Feb 2022
Exam Date : 24 Apr 2022 IST