Category: Nptel Assignment Answers 2024

Nptel introduction to industry 4 and industrial iot week 9 assignment answers, ethical hacking nptel week 9 assignment answers, digital circuits week 9 nptel assignment answers, cloud computing nptel week 9 assignment answers, computer architecture nptel week 9 assignment answers 2024, cyber security and privacy week 9 nptel answers 2024, deep learning iit ropar week 9 nptel assignment answers, deep learning for computer vision week 9 nptel answers 2024, programming in java nptel week 9 assignment answers, soft skills nptel week 9 assignment answers.

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

I am sharing my journey of studying a course on Programming in Java taught by Prof.Debasis Samanta Sir IIT Kharagpur

omunite215/NPTEL-Programming-in-Java-Ultimate-Guide

Folders and files, repository files navigation, nptel-programming-in-java assignment solutions with explanations and course guide.

OOPs-Concept-in-Java

This Repository has the ultimate guide to crack the exam of Programming in Java Course taught by Prof.Debasis Samanta Sir from I.I.T(Indian Institute of Technology) Kharagpur

This will also help you practice java., i am sharing all my codes i did during preparation of exam and my learning process., you need to understand these concepts first before solving assignments weekwise:, week-1 => basic concepts., week-2 => methods, functions and encapsulation., week-3 => access specifiers, static scope, info hiding., week-4 => packages and interfaces(basics)., week-5 => interfaces advanced and basics of exception handling., week-6 => multithreading and iostream., week-7 => iostream advanced usage and applet programming(basics)., week-8 => applet programming advance concepts and abstract window toolkit(awt)., week-9 => swing programming and abstract window toolkit(awt)., week-10 => networking with java., week-11 => java database connectivity(jdbc) in detail., week-12 => case studies., course online exam questions:, set-1 unproctored exam ., set-2 unproctored exam ., how to use this repository, this repository is for reference., this repository has all the solutions of nptel weekly assignments. just click on branches and select the week number., each branch has readme file where you will find all the questions., the top most comment is the problem statement to understand the problem and code together., explanation of code has been done through comments wherever neccessary., tips for assignment and exam :-, - every assignment has testcase so your code must need to pass all the testcases to get marks in assignment., - dont write customized print statements because showing your creativity will simply mark zero. i got zero in few assignments not because output was wrong but wrote long print statements before outputs., - prepare basics well before going into exam., reference links to prepare for exam:-.

  • NPTEL Swayam
  • Geeks for Geeks

Whenever you learn a programming language, you understand about basics of how a software works that makes you think about the beauty of technology. Taking Java or any other programming language will clear your basic concepts of programming which will take you deeper into techonology and help you understand the world of computers.

🏠 Built With:

My Skills

Specializations:

  • UI/UX Design.
  • Web Development

🙋‍♂️ Connect With Me

nptel assignment solutions

Programming_In_Java_NPTEL

Java

Navigate to Week

Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12

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 an Armstrong number or not.

Java Week 1:Q5 To help Ram , find the highest mark and average mark secured by him in “s” number of subjects.

Java Week 2:Q1 To call the method print() in class Student following the concept of inner class.

Java Week 2:Q2 To call the method print() of class Student first and then call print() method of class School.

Java Week 2:Q3 To call print() method of class Question by creating a method named ‘studentMethod()’.

Java Week 2:Q4 To call default constructor first and then any other constructor in the class Answer.

Java Week 2:Q5 To debug the program which is intended to print ‘NPTEL JAVA’.

Java Week 3:Q1 To the generation of Fibonacci numbers.

Java Week 3:Q2 Define a class Point with two fields x and y each of type double. Also , define a method distance(Point p1, Point p2) to calculate the distance between points p1 and p2 and return the value in double. Complete the code segment given below. Use Math.sqrt( ) to calculate the square root.

Java Week 3:Q3 A class Shape is defined with two overloading constructors in it. Another class Test1 is partially defined which inherits the class Shape. The class Test1 should include two overloading constructors as appropriate for some object instantiation shown in main( ) method. You should define the constructors using the super class constructors. Also, override the method calculate( ) in Test1 to calculate the volume of a Shape.

Java Week 3:Q4 This program to exercise the call of static and non-static methods. A partial code is given defining two methods, namely sum( ) and multiply ( ). You have to call these methods to find the sum and product of two numbers.

Java Week 3:Q5 To swap two numbers using call by object reference.

Java Week 4:Q1 To execute the following program successfully. You should import the correct package(s) and/or class(s) to complete the code.

Java Week 4:Q2 To print the current year.

Java Week 4:Q3 The program in this assignment is attempted to print the following output:

Java Week 4:Q4 To call the default method in the interface First and Second.

Java Week 4:Q5 To print the following output.

Java Week 5:Q1 An interface Number is defined in the following program. You have to declare a class A, which will implement the interface Number. Note that the method findSqr(n) will return the square of the number n.

Java Week 5:Q2 This program is to find the GCD (greatest common divisor) of two integers writing a recursive function findGCD(n1,n2). Your function should return -1, if the argument(s) is(are) other than positive number(s).

Java Week 5:Q3 Complete the code segment to catch the ArithmeticException in the following, if any. On the occurrence of such an exception, your program should print “Exception caught: Division by zero.” If there is no such exception, it will print the result of division operation on two integer values.

Java Week 5:Q4 In the following program, an array of integer data to be initialized. During the initialization, if a user enters a value other than integer value, then it will throw InputMismatchException exception. On the occurrence of such an exception, your program should print “You entered bad data.” If there is no such exception it will print the total sum of the array.

Java Week 5:Q5 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“.

Java Week 6:Q1 Complete the code segment to print the following using the concept of extending the Thread class in Java:

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 given code and complete the program so that your program prints the message “NPTEL Java”. Your program should utilize the given interface/ class.

Java Week 6:Q4 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 some numbers. Do the necessary use of ‘synchronized’ keyword, so that, the program prints the output in the following order:

Java Week 6:Q5 Add necessary codes to print the following:

Java Week 7:Q1 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.

Java Week 7:Q2 Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “Please enter valid data” .If there is no such exception, it will print the “square of the number”.

Java Week 7:Q3 A byte char array is initialized. You have to enter an index value”n”. According to index your program will print the byte and its corresponding char value. Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “exception occur” .If there is no such exception, it will print the required output.

Java Week 7:Q4 The following program reads a string from the keyboard and is stored in the String variable “s1”. You have to complete the program so that it should should print the number of vowels in s1 . If your input data doesn’t have any vowel it will print “0”.

Java Week 7:Q5 A string “s1” is already initialized. You have to read the index “n” from the keyboard. Complete the code segment to catch the exception in the following, if any. On the occurrence of such an exception, your program should print “exception occur” .If there is no such exception, your program should replace the char “a” at the index value “n” of the “s1” ,then it will print the modified string.

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

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

Java Week 8: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.

Java Week 8: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”.

Java Week 8:Q5 Write a program to display any digit(n) from 0-9 using “7 segment display”.

Java Week 9:Q1 Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division.

Java Week 9:Q2 Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image.

GUI Calculator

Java Week 9:Q3 Complete the code to perform a 45 degree anti clock wise rotation with respect to the center of a 5 × 5 2D Array as shown below:

Java Week 9:Q4 A program needs to be developed which can mirror reflect any 5 × 5 2D character array into its side-by-side reflection. Write suitable code to achieve this transformation as shown below:

Java Week 9:Q5 Write suitable code to develop a 2D Flip-Flop Array with dimension 5 × 5, which replaces all input elements with values 0 by 1 and 1 by 0. An example is shown below:

Java Week 10:Q1 The following code needs some package to work properly. Write appropriate code to import the required package(s) in order to make the program compile and execute successfully.

Java Week 10:Q2 Write the JDBC codes needed to create a Connection interface using the DriverManager class and the variable DB_URL. Check whether the connection is successful using ‘isAlive(timeout)’ method to generate the output, which is either ‘true’ or ‘false’.

Java Week 10:Q3 Due to some mistakes in the below code, the code is not compiled/executable. Modify and debug the JDBC code to make it execute successfully.

Java Week 10:Q4 Complete the code segment to create a new table named ‘PLAYERS’ in SQL database using the following information.

Java Week 10:Q5 Complete the code segment to rename an already created table named ‘PLAYERS’ into ‘SPORTS’.

Java Week 11:Q1 Complete the code segment to insert the following data using prepared statement in the existing table ‘PLAYERS’.

Java Week 11:Q2 Write the required code in order to update the following data in the table ‘PLAYERS’.

Java Week 11:Q3 Write the appropriate code in order to delete the following data in the table ‘PLAYERS’.

Java Week 11:Q4 Complete the following program to calculate the average age of the players in the table ‘PLAYERS’.

Structure of Table ‘PLAYERS’ is given below: | Coulmn | UID | First_Name | Last_Name | Age | |——–|———|————-|————-|———| | Type | Integer | Varchar(45) | Varchar(45) | Integer | | | | | | |

Java Week 11:Q5 Complete the code segment to drop the table named ‘PLAYERS’.

Java Week 12:Q1 Complete the code to develop an extended version of the ADVANCED CALCULATOR with added special functions that emulates all the functions of the GUI Calculator as shown in the image.

GUI Calculator

Java Week 12:Q2 A partial code fragment is given. The URL class object is created in try block.You should write appropriate method( ) to print the protocol name and host name from the given url string.

Java Week 12:Q3 Write a program to create a record by taking inputs using Scanner class as first name as string ,last name as string ,roll number as integer ,subject1 mark as float,subject2 mark as float. Your program should print in the format

Java Week 12:Q4 A program code is given to call the parent class static method and instance method in derive class without creating object of parent class. You should write the appropriate code so that the program print the contents of static method() and instance method () of parent class.

Java Week 12:Q5 Write a recursive function to print the sum of first n odd integer numbers. The recursive function should have the prototype

NPTEL Solutions

Imad | revision | all questions of mar-apr session, courses to which we are providing solutions currently (jan-apr 2018):-.

Programming, Data Structures and Algorithms using Python :-

MCQs-  Week 1 | Week 2  | Week 4  | Week 6

Practical assignments –  week 2  |  week 3  | week 4  | week 5, introduction to modern application development:-, mcqs-  week 1  |  week 2   | week 3  | week 4   | week 5  | week 7, courses to which we provided solutions (sep-nov 2017) :-.

Introduction to Modern Application Development ( IMAD ) :-

MCQs –   Week 1,   Week 2, Week 3, Week 4 , Week 5 , Week 6 , Week 7

Must See Bonus Posts :-

Tutorial 1:-  Doing Useful Stuff with Python – Getting RGB color value of mouse position

MCQs-  Week 1 , Week 2 , Week  4 , Week 6 , Week 7

Programming assignment –  week 2  ,  week 3 , week 4 , week 5 , week 8.

Programming in C++ :-

MCQs – Week 1 , Week 2 , Week 3 , Week 4 

Introduction to Algorithm and Analysis :-

MCQs –  Week 1 , Week 2 , Week 3 , Week 4 , Week 5

AI: search methods for problem-solving:-

MCQs-  Week 1 , Week 2

Disclaimer: Here you can find all the solution of all courses of NPTEL  Computer Science stream. We hope this will be useful to you. These answers are for verification only. You are not allowed to copy directly from the post(code of conduct of NPTEL). We can’t ensure that you can get 100% marks if you follow our answers.

COMMENTS

  1. NPTEL Assignment Answers 2024 with Solutions (July-Dec)

    Each week-XX.md file provides detailed solutions and explanations for that week’s assignments. Review these files to find the information you need. By following these steps, you can easily locate and use the assignment answers and solutions for the NPTEL courses provided in this repository.

  2. nptel-assignments · 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.

  3. NPTEL Assignment Answers 2024 And Solutions Progiez

    We provide you NPTEL Assignment Answers 2024 and solutions of all courses. Week 1,2,3, 4, 5, 6, 7 , 8, 9, 10 ,11, 1. By Swayam platform.

  4. NPTEL | Assignment Solutions - YouTube

    In this playlist, I have discussed NPTEL assignment solutions with detailed explanations. This playlist covered solutions of the design and analysis of algor...

  5. Assignment 5 solutions.pdf - INTRODUCTION TO WIRELESS AND...

    INTRODUCTION TO WIRELESS AND CELLULAR COMMUNICATIONS NPTEL JUL – NOV 2020 Assignment – 5 Solutions. 1. A mobile communication system uses a DBPSK modulation scheme (Tx sends 0 at the beginning of the transmission). Bit 0 is transmitted with phase and Bit 1 is transmitted with phase.

  6. Introduction to Cloud Computing: NPTEL Assignment Solutions ...

    From virtualization to networking and beyond, let's master the core concepts together and unlock the potential of cloud computing. Get ready to dive in and complete every assignment with us ...

  7. NPTEL-Programming-in-Java Assignment Solutions with ...

    This Repository has all the solutions of NPTEL Weekly Assignments. Just Click on Branches and select the week number. Each Branch has readme file where you will find all the questions. The top most comment is the problem statement to understand the problem and code together.

  8. Programming in Java| NPTEL| WEEK 3 ASSIGNMENT| solution

    In this video, I walk you through the solution to Nptel Week 3 assignment, providing detailed explanations for each question.

  9. Programming_In_Java_NPTEL | This site is to share the ...

    This site is to share the solution of prgramming and quiz assignment given during the Programming In java by Prof. Debasis Samantha on NPTEL.

  10. NPTEL Solutions - Hackademic

    NPTEL Solutions | Hackademic. IMAD | Revision | All questions of Mar-Apr session. Courses to which we are providing solutions currently (Jan-Apr 2018):- Programming, Data Structures and Algorithms using Python :- MCQs- Week 1 | Week 2 | Week 4 | Week 6. Practical Assignments – Week 2 | Week 3 | Week 4 | Week 5.