- Friday, September 27, 2024
NPTEL Programming in Java Week 11 Assignment Solution 2023
NPTEL Programming in Java Week 11 All Programming Assignment Solutions – January 2023 | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software.
Further, those 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, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to 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 filed of studies.
COURSE LAYOUT
- 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)
- Week 10 : Networking with Java
- Week 11: Java Object Database Connectivity (ODBC)
- Week 12: Interface and Packages for Software Development
Course Name : “Programming in Java July 2023”
Question : 1 Complete the code segment to insert the following data using prepared statement in the existing table ‘ PLAYERS ’ .
Question : 2 Write the required code in order to update the following data in the table ‘ PLAYERS ’
Question : 3 Write the appropriate code in order to delete the following data in the table ‘ PLAYERS ’ .
Question : 4 Complete the following program to calculate the average age of the players in the table ‘ PLAYERS ’ .
Question : 5 Complete the code segment to drop the table named ‘ PLAYERS ’ .
- All Courses
- Privacy Policy
Swayam Solver
Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.
NPTEL Programming In Java Programming Assignment July-2024 Swayam
NPTEL » Programming in Java
Please scroll down for latest Programs. 👇
Week 01 : Programming Assignment 1
Write a Java program to print the area and perimeter of a rectangle.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Private Test cases used for Evaluation | Status |
Test Case 1 |
Week 01 : Programming Assignment 2
Write a Java program and compute the sum of an integer's digits.
Week 01 : Programming Assignment 3
Write a Java program to display n terms of natural numbers and their sum.
(Remember to match the output given exactly, including the spaces and new lines)
(passed with presentation error means you will get full marks)
Week 01 : Programming Assignment 4
Write a Java program to make such a pattern like a right angle triangle with the number increased by 1.
(Ignore presentation errors for this and all future programming assignments) (passed with presentation error means you will get full marks )
Week 01 : Programming Assignment 5
Write a Java program to convert an integer number to a binary number.
Week 02 : Programming Assignment 1
Complete the code segment to call the method display() of class Former first and then call display() method of class Latter.
Week 02 : Programming Assignment 2
Create a class Student with private attributes for name and age .
Use a constructor to initialize these attributes and provide public getter methods to access them.
In the main method, an instance of Student is created and the student's details are printed.
Guideline to Solve:
§ Define the Student class with private attributes.
§ Use a constructor to initialize the attributes.
§ Implement getter methods for the attributes.
Follow the naming convetion used in the Fixed code.
Week 02 : Programming Assignment 3
Create a class Rectangle with attributes length and width .
Provide two constructors: one with no parameters ( default to 1 ) and
another with parameters to initialize the attributes.
Use the this keyword to avoid name space collision.
Create a getArea() function that returns the area of the rectangle.
§ Define the Rectangle class with attributes and constructors.
§ Define a default Rectangle constructor that inializes length and width to 1.
§ Use the this keyword in the parameterized constructor.
§ Define a getArea() funtion that returns the area of there rectangle
Week 02 : Programming Assignment 4
Create a class Circle that encapsulates the properties of a circle.
The class should have a private field for the radius, a constructor to initialize the radius, and methods to calculate the area and circumference of the circle.
NOTE: use Math.PI for PI calculations (DO NOT USE 22/7)
§ Define the Circle class with attributes and constructors.
§ Define a getArea() funtion that returns the area of there Circle (use Math.PI)
§ Define a getCircumference() funtion that returns the circumference of there Circle (use Math.PI)
Week 02 : Programming Assignment 5
Complete the code by creating the constructor and the getter functions for a class Dog as defined below.
Week 03 : Programming Assignment 1
Create a class Department having a method getCourses that prints "These are the department's courses" . It will have two subclasses , ComputerScience and MechanicalEngineering , each having a method with the same name that prints specific courses for the respective departments.Call the method by creating an object of each of the three classes.
Week 03 : Programming Assignment 2
Week 03 : programming assignment 3.
Write a program to print the factorial of a number by defining a recursive method named 'Factorial'.
Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. E.g.-
4! = 1*2*3*4 = 24
3! = 3*2*1 = 6
2! = 2*1 = 2
Week 03 : Programming Assignment 4
Write a program to take integer inputs from user until he/she presses q ( Ask to press q to quit after every integer input ). Print average and product of all numbers.
Week 03 : Programming Assignment 5
Write a Java program to create a class called Employee with methods called work() and getSalary(). Create a subclass called HRManager that overrides the work() method and adds a new method called addEmployee().
Week 04 : Programming Assignment 1
Complete the code segment to swap two numbers using call by object reference.
Week 04 : Programming Assignment 2
1 - Problem Statement:
Define a class Point with members
§ private double x;
§ private double y;
and methods:
§ public Point(double x, double y){} // Constructor to create a new point?
§ public double slope(Point p2){} // Function to return the slope of the line formed from current Point and another Point (Assume that input will always be chosen so that slope will never be infinite)
Week 04 : Programming Assignment 3
This program to exercise the create static and non-static methods. A partial code is given, you have to define two methods, namely sum( ) and multiply( ). These methods have been called to find the sum and product of two numbers. Complete the code segment as instructed.
Week 04 : Programming Assignment 4
The program in this assignment is attempted to print the following output:
-----------------OUTPUT-------------------
This is large
This is medium
This is small
This is extra-large
-------------------------------------------------
However, the code is intentionally with some bugs in it. Debug the code to execute the program successfully.
Week 04 : Programming Assignment 5
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
Even number divisible by 3:0 6
Week 05 : Programming Assignment 1
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Week 05 : Programming Assignment 2
Write a program to create an interface Searchable with a method search(String keyword) that searches for a given keyword in a text document. Create two classes Document and WebPage that implement the Searchable interface and provide their own implementations of the search() method.
Week 05 : Programming Assignment 3
Week 05 : programming assignment 4, week 05 : programming assignment 5, week 06 : programming assignment 1, week 06 : programming assignment 2, week 06 : programming assignment 3, week 06 : programming assignment 4, week 06 : programming assignment 5, week 07 : programming assignment 1, week 07 : programming assignment 2.
Write a program to print Swastika Pattern in Java.
Input is 2 numbers.
(Rows and Columns)
For Example:
* *
NOTE: Do not print any spaces between the ‘*’
Output should match exactly as specified by the question
Week 07 : Programming Assignment 3
Write a program to remove all occurrences of an element from array in Java.
Week 07 : Programming Assignment 4
Write a p rogram to compute the sum of all prime numbers in a given range. The range value will be positive.
Follow the naming convention as given in the main method of the suffix code.
Week 07 : Programming Assignment 5
Code to create two threads, one printing even numbers and the other printing odd numbers.
§ The PrintNumbers class is declared, and it implements the Runnable interface. This interface is part of Java's concurrency support and is used to represent a task that can be executed concurrently by a thread.
§ Create a constructor of this class that takes two private instance variables (start and end) to represent the range of numbers that will be printed by the thread.
§ Create a run method that is required by the Runnable interface and contains the code that will be executed when the thread is started. In this case, it should prints odd numbers within the specified range (start to end) using a for loop.
§ Hint: Thread.currentThread().getName() returns the name of the currently executing thread, which is useful for identifying which thread is printing the numbers.
Week 08 : Programming Assignment 1
Complete the code segment to print the current year. Your code should compile successfully.
Note: In this program, you are not allowed to use any import statement. Use should use predefined class Calendar defined in java.util package.
Week 08 : Programming Assignment 2
Complete the code segment to call the default method in the interface First and Second.
Week 08 : Programming Assignment 3
Modify the code segment to print the following output.
-----------------OUTPUT------------------- (this line should not be printed)
Circle: This is Shape1
Circle: This is Shape2
------------------------------------------------- (this line should not be printed) (Remember to match the output given exactly, including the spaces and new lines) (passed with presentation error means you will always get full marks)
Week 08 : Programming Assignment 4
Complete the code segment to execute the following program successfully. You should import the correct package(s) and/or class(s) to complete the code.
(Note: there is no error in the given fixed code, there is a way to print without using “System”)
(Hint: Use Static import)
Week 08 : Programming Assignment 5
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“. (Hint: Try to catch the exception and print it) (NOTE: DO NOT USE MORE THAN ONE TRY CATCH, there may be a penalty if you use more than one try catch block)
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Week 09 : Programming Assignment 1
Write a Java program to display the number rhombus structure. Input: n=2 Output: 1 212 1 (the output shown with the public test case has no spaces in the beginning, its a fault of the swayam portal as it removes whitespaces before and after the output you can write your program normally including spaces and it will be correct)
(passed with presentation error means you will always get full marks)
Week 09 : Programming Assignment 2
Write a Java program to create an abstract class Person with abstract methods eat(), sleep() and exercise(). Create subclasses Athlete and LazyPerson that extend the Person class and implement the respective methods to describe how each person eats, sleeps and exercises. Override the respective method in each subclass.
Week 09 : Programming Assignment 3
Write a Java program to create a base class Shape with methods draw() and calculateArea(). Create two subclasses Circle and Cylinder. Override the draw() method in each subclass to draw the respective shape. In addition, override the calculateArea() method in the Cylinder subclass to calculate and return the total surface area of the cylinder.
(Remember to match the output given exactly, including the spaces and new lines) (passed with presentation error means you will always get full marks)
Week 09 : Programming Assignment 4
Write a Java program to create a class called "ElectronicsProduct" with attributes for product ID, name, and price. Implement methods to apply a discount and calculate the final price. Create a subclass " WashingMachine" that adds a warranty period attribute and a method to extend the warranty.
Week 09 : Programming Assignment 5
Write a Java program to find the length of the longest sequence of zeros in binary representation of an integer.
Week 10 : Programming Assignment 1
Complete the code fragment to read three integer inputs from keyboard and find the sum and store the result in the variable "sum". NOTE: Name the class W10_P1 and the file W10_P1.java
Week 10 : Programming Assignment 2
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 “Error: Exception occoured”.
If there is no such exception, it will print the required output.
Week 10 : Programming Assignment 3
A string is read from the keyboard and is assigned to variable "s1". Your program should print the "number of vowels in s1”. However, if your input is other than "String" data type it will print "0".
Week 10 : Programming Assignment 4
A string "s1" is already initialized. You have to read the index "n".
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.
Week 10 : Programming Assignment 5
Complete the code below with a catch statement to print the following if the denominator (b) is zero
print “Cannot Divide by ZERO”
No comments:
Post a comment.
Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.
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
Assignment solutions
laxminagln/Programming_in_Java-NPTEL
Folders and files.
Name | Name | |||
---|---|---|---|---|
71 Commits | ||||
Repository files navigation
Programming_in_java-nptel.
- Java 100.0%
Programming in Java | Week 10
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 10 Assignment 10 Answers
Q1. Which class provides methods to work with URLs? a. URLConnection b. HttpURL c. NetURLg d. URL
Answer: Please login to see answer .
Q2. What does the following code do? a. Creates a JFrame with a JButton labeled “Programming in Java” b. Compiles with errors c. Displays a message dialog d. Creates a JPanel with a JButton labeled “Programming in Java”
Q3. What happens when the button in this Java code snippet is clicked? a. The program exits b. A message dialog with the text “Welcome to the course” is displayed c. The button label changes to “Welcome to the course” d. Nothing happens
Q4. What GUI component is used to input the password in this Java code snippet? a. JTextField b. JButton c. JtextArea d. JPasswordField
Q5. What does this Java code snippet create? a. A frame with a list of colors displayed as buttons b. A frame with a combo box containing options “Red”, “Green”, and “Blue” c. A frame with radio buttons for selecting colors d. A frame with checkboxes for selecting colors
Q6. What does this Java code snippet do? a. Just prints the IP address of the local machine b. Prints the IP address and host name of the local machine c. Prints the IP address and host name of “nptel.ac.in” d. Just prints the IP address of “nptel.ac.in”
Q7. What does this Java code snippet do? a. Connects to a MySQL database, retrieves data from the “employees” table, and prints it b. Inserts data into the “employees” table of a MySQL database c. Deletes data from the “employees” table of a MySQL database d. Updates data in the “employees” table of a MySQL database
Q8. What does this Java code snippet do? a. Retrieves data from the “employees” table b. Inserts a new employee record into the “employees” table c. Updates employee records in the “employees” table d. Deletes employee records from the “employees” table
Q9. What additional code is needed at #1 to complete this Java program to send a message? a. socket.recieve(packet); b. Socket.Send(packet); c. Socket.send(packet); d. socket.send(packet);
Q10. What is missing in this Java program? a. Retrieving the number of employees b. Deleting employee records c. Updating employee records d. Importing necessary JDBC libraries
Programming Assignment
Question 1 Program to sort the elements of an array in ascending order. Follow the naming convention as given in the main method of the suffix code.
Question 2 Print a given matrix in spiral form. Follow the naming convention as given in the main method of the suffix code.
Question 3 Code to create two threads, one printing even numbers and the other printing odd numbers.
Question 4 Program to compute the sum of all prime numbers in a given range. The range value will be positive.Follow the naming convention as given in the main method of the suffix code.
Question 5 Write a program that converts temperatures between Celsius and Fahrenheit. Implement two methods, celsiusToFahrenheit and fahrenheitToCelsius, to perform the conversions.
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
Question 1 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.
Question 2 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’. Note the following points carefully: 1. Name the connection object as ‘conn’ only. 2. Use timeout value as 1.
Question 3 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.
Question 4 Complete the code segment to create a new table named ‘PLAYERS’ in SQL database using the following information.
UID | First_Name | Last_Name | Age | |
Integer | Varchar (45) | Varchar (45) | Integer |
Question 5 Complete the code segment to rename an already created table named ‘PLAYERS’ into ‘SPORTS’.
More Nptel Courses: Click here
Session: JAN-APR 2023
Course Name: Programming in Java
Q1. Which of the following statement(s) is(are) true? a. TCPis not reliable. b. UDP is most reliable. c. TCPis fast and UDP is slow. d. In HTTPS, all communication between two computers are encrypted.
Answer: d. In HTTPS, all communication between two computers are encrypted.
Q2. Which of the following statement(s) is/are true? a. DatagramSocket implements Object. b. DatagramSocket implements Closeable. c. DatagramSocket extends Object. d. DatagramSocket extends Closeable. e. DatagramSocket extends Object implements Closeable
Answer: e. DatagramSocket extends Object implements Closeable
Q3. Which of the following is/are interface(s) present in java.net package? a. InterfaceAddress b. FileNameMap c. DatagramPacket d. DatagramSocket
Answer: b. FileNameMap
Q4. Which of the following statement(s) is/are true? a. Addresses belongs to a Low-Level API. b. Sockets belong to High-Level API. c. URIs and URLs are Low-Level API. d. Interfaces are High-Level API.
Answer: a. Addresses belongs to a Low-Level API.
Q5. In context of the following URL, identify the correct option. https://nptel.ac.in a. There is no protocol provided in the above link. b. The website provides a secure connection. c. The given link is incomplete and hence cannot open a website. d. The ac.in refers to the website path.
Answer: b. The website provides a secure connection.
Q6. Which of the following is/are application layer protocol(s)? a. TCP b. UDP c. ARP d. SMTP
Answer: d. SMTP
Q7. What is true about IP:PORT in the following options? a. Port number 21 is the default FTP port. b. Only port number is required for FTP connections and no IP is required. c. 127.0.0.1 and localhost are same. d. There is no concept of PORT in IPv6.
Answer: a, c
Q8. Which of the following is/are valid Data Definition Language (DDL) command(s)? a. SELECT b. INSERT c. UPDATE d. ALTER TABLE
Answer: d. ALTER TABLE
Q9. In JDBC, all raw data types (including binary documents or images) should be read and uploaded to the database as an array of a. byte b. vector c. char d. file
Answer: a. byte
Q10. The package, which is required to be imported for the JDBC programming? a. java.net b. java.lang c. java.io d. java.sql
Answer: d. java.sql
Programming Assignment of Programming in Java
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 .
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’. Note the following points carefully: 1. Name the connection object as ‘conn’ only. 2. Use timeout value as 1.
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.
Question 4 Complete the code segment to create a new table named ‘ PLAYERS ’ in SQL database using the following information.
Complete the code segment to rename an already created table named ‘PLAYERS’ into ‘SPORTS’.
More Weeks of Programming In Java: Click Here
More Nptel courses: https://progiez.com/nptel-assignment-answers/
COMMENTS
Programming In Java Week 11 Assignment 11 Answers Solution Quiz | 2024-JanJoin NPTEL - Programming in Java : https://telegram.me/ProgrammingInJavaNPTELFollow...
September 23, 2021. Faheem Ahmad. NPTEL Programming in Java Week 11 All Programming Assignment Solutions | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust.
02/07/2020 Programming in Java - Course https://onlinecourses.nptel.ac.in/noc20_cs08/progassignment?name=181 3/3 Assignment Solution Books Live Interactive
🔊 Programming In Java NPTEL Elective Course 2023 | GATE NPTEL | https://techiestalk.in/NPTEL Programming In Java WEEK11 Programming Assignment Solutions | S...
🔊 NPTEL Programming In Java WEEK11 Quiz Assignment Solutions | Swayam July 2023 | IIT Kharagpur | GATE NPTEL⛳ABOUT THE COURSE :With the growth of Informatio...
This repository in NPTEL course Programming in Java Question and Quiz answer. - Programming-in-Java-NPTEL/week 11/Exercise 11.1.java at master · sumitnce1/Programming-in-Java-NPTEL
These are NPTEL Programming In Java Week 11 Assignment 11 Answers. Question 2. 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'.
Due on 2024-04-11, 23:59 IST. 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. Your last recorded submission was on 2024-03-30, 17:29 IST. Select the Language for this assignment. File name for this program : import java.sql.*;
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. java javaprogram nptel javaprograms javaprogramming nptel-solutions nptel-assignments nptel-courses nptel-downloader nptel-java nptel-course nptel-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 ...
Faheem Ahmad. NPTEL Programming in Java Week11 All Programming Assignment Solutions - July - Oct 2023 | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust.
Week 8 : Week 9 : Week 10 : Week 11 : Lecture 51 : JDBC—II (unit? unit=12&lesson=65) Lecture 52 : JDBC—III (unit? unit=12&lesson=66) Lecture 53 : Demonstration —XX (unit? unit=12&lesson=67) Lecture 54 : Demonstration —XXI (unit? unit=12&lesson=68) Lecture 55 : Demonstration —XXII (unit? unit=12&lesson=69) Quiz : Assignment 11 ...
April 8, 2023. Faheem Ahmad. NPTEL Programming in Java Week 11 All Programming Assignment Solutions - January 2023 | Swayam. With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and ...
🔊 Programming In Java NPTEL Elective Course 2023🔗Programming Assignment Link : https://bit.ly/3GtA2QCNPTEL Programming In Java WEEK 11 Quiz Assignment Solu...
Week 02 : Programming Assignment 1. Due on 2024-08-08, 23:59 IST. Complete the code segment to call the method display () of class Former first and then call display () method of class Latter. Your last recorded submission was on 2024-07-27, 11:52 IST.
Languages. Java 100.0%. Assignment solutions. Contribute to laxminagln/Programming_in_Java-NPTEL development by creating an account on GitHub.
Visit our website :https://getpythoncode-help.github.io/Join us on telegramhttps://t.me/getpythoncode Follow me on Instagramhttps://www.instagram.com/getpyt...
Follow the naming convention as given in the main method of the suffix code. Solution: Answer: Please login to see answer. These are NPTEL Programming In Java Week 10 Assignment 10 Answers. Question 3. Code to create two threads, one printing even numbers and the other printing odd numbers. Solution: int start;
Join this channel to get exclusive access to MCQ's with Exam preparation videos !:https://www.youtube.com/channel/UC4y1gGiklB8ynBrAtzErLEQ/joinFor 500/- pdf...
Programming In Java | Week 11 Answers 2023 | NPTEL | SWAYAMYour Queries : nptel programming in java assignment answers 2023programming in java week- 11 assig...