NPTEL+

  • NPTEL courses
  • IIT Workshops
  • Partnering courses

Course list

nptel java assignment

Programming in Java

₹ 3,000.00

Prof. Debasis Samanta IIT Kharagpur

*Additional GST and optional Exam fee are applicable.

Description

Certification process, course details.

  • Reviews (0)

INTENDED AUDIENCE

Prerequisites, industry support, about the instructor.

nptel java assignment

Debasis Samanta  holds a Ph.D. in Computer Science and Engineering from Indian Institute of Technology Kharagpur. His research interests and work experience spans the areas of Computational Intelligence, Data Analytics, Human Computer Interaction, Brain Computing and Biometric Systems. Dr. Samanta currently works as a faculty member at the Department of Computer Science & Engineering at IIT Kharagpur.

1. Join the course Learners may pay the applicable fees and enrol to a course on offer in the portal and get access to all of its contents including assignments. Validity of enrolment, which includes access to the videos and other learning material and attempting the assignments, will be mentioned on the course. Learner has to complete the assignments and get the minimum required marks to be eligible for the certification exam within this period.

COURSE ENROLMENT FEE: The Fee for Enrolment is Rs. 3000 + GST

2. Watch Videos+Submit Assignments After enrolling, learners can watch lectures and learn and follow it up with attempting/answering the assignments given.

3. Get qualified to register for exams A learner can earn a certificate in the self paced course only by appearing for the online remote proctored exam and to register for this, the learner should get minimum required marks in the assignments as given below:

CRITERIA TO GET A CERTIFICATE

Assignment score = Score more than 50% in at least 9/12 assignments.

Programming Assignment score  = Score more than 50% in at least 30/46 assignments. Exam score = 50% of the proctored certification exam score out of 100 Only the e-certificate will be made available. Hard copies will not be dispatched.”

4. Register for exams The certification exam is conducted online with remote proctoring. Once a learner has become eligible to register for the certification exam, they can choose a slot convenient to them from what is available and pay the exam fee. Schedule of available slot dates/timings for these remote-proctored online examinations will be published and made available to the learners.

EXAM FEE: The remote proctoring exam is optional for a fee of Rs.1500 + GST. An additional fee of Rs.1500 will apply for a non-standard time slot.

5. Results and Certification After the exam, based on the certification criteria of the course, results will be declared and learners will be notified of the same. A link to download the e-certificate will be shared with learners who pass the certification exam.

CERTIFICATE TEMPLATE

nptel java assignment

There are no reviews yet.

Your review  *

Name  *

Email  *

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

Programming in Java | Week 9

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 9 Assignment 9 Answers

Q1. What is the parent class of all AWT components? a. java.awt.Panel b. java.awt.Component c. java.awt.Container d. java.awt.Frame

Answer: b. java.awt.Component

Q2. Which event is generated when a user clicks a button in AWT? a. MouseEvent b. ActionListener c. KeyEvent d. WindowEvent

Answer: b. ActionListener

Q3. Which of the following architecture does the Swing framework use? a. MVC b. MVP c. Layered architecture d. Master-Slave architecture

Answer: a. MVC

Q4. A __________ is the basic class for all SWING UI components? a. Container b. JComponent c. Component d. Jbox

Answer: b. JComponent

Q5. Which event is generated when a window is resized in AWT? a. WindowEvent b. ComponentEvent c. ResizeEvent d. ContainerEvent

Answer: b. ComponentEvent

Q6. Which method is used to remove a component from a container in AWT? a. remove() b. deleteComponent() c. removeComponent() d. destroy()

Answer: a. remove()

Q7. What is true about the following code. a. Both “OK” and “Cancel” button is added, but only “Cancel” button is visble. b. Only “OK” button is added and visible, “Cancel” button is not added. c. Only “Cancel” button will be added and visible, “OK” button is not added. d. Code throws an ERROR.

Answer: a. Both “OK” and “Cancel” button is added, but only “Cancel” button is visble.

Q8. Which of the following function is used to generate the application’s top-level window? a. JPanel b. JFrame c. JCombo d. JBox

Answer: b. JFrame

Q9. In Java, what is the primary purpose of a layout manager? a. To manage memory allocation b. To arrange GUI components within a container c. To handle exception handling d. To control database connections

Answer: b. To arrange GUI components within a container

Q10. Which layout manager divides the container into five regions: North, South, East, West, and Center? a. Border Layout b. Grid Layout c. Flow Layout d. Card Layout

Answer: a. Border Layout

Programming Assignment

Question 1 Write a Java program that utilizes multithreading to calculate and print the squares of numbers from a specified begin to a specified end. The main method is already created. You need to design a SquareThread class that has two members, int begin; int end;

Each thread should sequentially print the squares of numbers from begin to end (both inclusive). The same code will be used to create another thread that prints the sqaure of numbers from end to begin in reverse order. (if begin is greater than end, print the square of each number in reverse order first) The main method will first call SquareThread with begin and end and then in reverse order. The class you create should be able to handle such case and print as required in the correct order. HINT: use the keyword synchronized in the run method.

Question 2 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 entered.

Question 3 The program given below stores characters in a byte array named byte_array, which means ‘A’ is stored as 65. Your task is the following: § Given a user input n , print the output in the given format, if n = 1, print: o byte_array[1] = ‘P’ § If the value of n is negative or is out of bound, then use TRY_CATCH to print the following: o Array index is out of range

Question 4 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 distance(Point p2){} // Function to return the distance of this Point from another Point

Question 5 Complete the code below with a catch statement to print the following if the denominator (b) is zero § Cannot Divide by ZERO

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 Problem statement: Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division.

Question 2 Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image.

Question 3 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: INPUT: 00100 00100 11111 00100 00100 OUTPUT: 10001 01010 00100 01010 10001

Question 4 Problem statement: 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: INPUT: OUTPUT: OOXOO OOXOO OOXOO OOXOO XXXOO OOXXX OOOOO OOOOO XOABC CBAOX

Question 5 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: INPUT: 00001 00001 00001 00001 00001 OUTPUT: 11110 11110 11110 11110 11110

More Nptel Courses: Click here

Session: JAN-APR 2023

Course Name: Programming in Java

Q1. Which of the following is/are correct regarding events in Java? a. EventObject is super class of all the events. b. AdjustmentEvent will be notified if scroll bar is manipulated. c. All the classes and methods required for even handling in Java is in java.io package. d. getID() method can be used to determine the name of an event.

Answer: a, b

Q2. Which of the following classes is used to display a message dialog in Java Swing? a. JOptionPane b. IDialog c. JMessageDialog d. JFrame

Answer: a. JOptionPane

Q3. Which of the following event is occurred when a button is pressed, a list item is double-clicked or a menu item is selected? a. AdjustmentEvent b. ActionEvent c. ContainerEvent d. ComponentEvent

Answer: b. ActionEvent

Q4. Which of the statements are correct about Swing programming? a. AWT is a heavyweight programming. b. Swing is heavyweight programming. c. Swing is lightweight programming. d. Both AWT and Swing are lightweight programming.

Answer: c. Swing is lightweight programming.

Q5. Event class is defined in which of the following libraries? a. java.io b. javalang c. java.net d. java.util

Answer: d. java.util

Q6. Which of the following is/are class(es) in javax.swing package? a. BoxLayout b. MenuElement c. JComponent d. Scrollable

Answer: a, c

Q7. Which of the following statement(s) is/are true? a. Swing component frame does not support Window Listner. b. Swing component combobox does not support Window Listner. c. Swing component checkbox does not support Window Listner. d. Swing component dialog does not support Window Listner.

Answer: b, c

Q8. A class which implements the ActionListener interface, also it must implement which of the following methods? a. void handle( ActionEvent e ) b. void actionPerformed( ActionEvent e ) c. void eventDispatched( AWTEvent e ) d. String getActionCommand( ActionEvent e )

Answer: b. void actionPerformed( ActionEvent e )

Q9. When a component is added or removed, which of the following events is generated? a. ComponentEvent b. ContainerEvent c. FocusEvent d. InputEvent

Answer: b. ContainerEvent

Q10. Which of these packages contains all the event handling interfaces? a. java.lang b. java.awt c. java.awt.event d. java.event

Answer: c. java.awt.event

Programming Assignment of Programming in Java

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: INPUT: 00001 00001 00001 00001 00001 OUTPUT: 11110 11110 11110 11110 11110

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: INPUT: OUTPUT: OOXOO OOXOO OOXOO OOXOO XXXOO OOXXX OOOOO OOOOO XOABC CBAOX

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: INPUT: 00100 00100 11111 00100 00100 OUTPUT: 10001 01010 00100 01010 10001

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

image 77

Note the following points carefully : 1. Use only double datatype to store all numeric values. 2. Each button on the calculator should be operated by typing the characters from ‘a’ to ‘p’. 3. To calculate 25-6, User should input fjhkc (where, f for 2, j for 5, h for ‘-‘, k for 6 and c for ‘=’ ). 3. You may use the already defined function gui_map(char). 4. Without ‘=’, operations won’t give output as shown in Input_2 and Output_2 example below. 5. The calculator should be able to perform required operations on two operands as shown in the below example: Input_1: klgc Output_1: 18.0

Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division. Note the following points carefully : 1. Use only double datatype to store calculated numeric values. 2. Assume input to be of integer datatype. 3. The output should be rounded using Math.round() method. 4. Take care of the spaces during formatting output (e.g., single space each before and after =). 5. The calculator should be able to perform required operations on a minimum of two operands as shown in the below example: Input: 5+6 Output: 5+6 = 11

More Weeks of Programming In Java: Click Here

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

Session: JULY-DEC 2022

Course Name: Programming in Java NPTEL

Q1) Which of the following Listener(s) is/are supported by button Swing component ? a. Action Listner b. Change Listner c. Item Listner d. Window Listner

Answer: a, b, c

Q2) Which of the following is/are NOT interface(s) in javax.swing package? a. MenuElement b. BoxLayout c. JComponent d. Scrollable

Q3) Which of the following statement(s) is/are false? a. Swing component frame support Window Listner b. Swing component combo box support Window Listner. c. Swing component check box support Window Listner. d. Swing component dialog support Window Listner.

Q4) 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

Answer: b. java.awt.event

Q5) Select the correct information a. JTextField cannot be used as a JLabel. b. JLabel cannot be used as a JTextField. c. Button grouped radio button cannot be used instead of JComboBox. d. JPassword Field extends JLabel.

Answer: b. JLabel cannot be used as a JTextField.

Q6) Which of the following is/are incorrect regarding events in Java? a. EventClass is super class of all the events. b. AdjustmentEvent will be notified if scroll bar is manipulated. c. All the classes and methods required for even handling in Java is in java.awt package. d. getID() method can be used to determine the type of event.

Answer: a. EventClass is super class of all the events.

Q7) Which of the following is/are interface(s) of java.awt package? a. Button b. Choice c. Dialog d. Paint

Answer: d. Paint

Q8) Which of the following displays components row-by-row in the order in which they were added to the JFrame? a. CardLayout b. FlowLayout c. BorderLayout d. GridLayout

Answer: b. FlowLayout

Q9) Which of the following statements are true? a. Java AWT components are platform-dependent. b. Java Swing componets are platform-independent. c. MVC pattern is not supported by AWT. d. MVC pattern is supported by Swing.

Answer: a, b, c, d

Q10) Which of the following method is used to set a frame, say f with size 300 × 200 pixels? JFrame f = new JFrame (); a. f.setsize (300, 200); b. f.setSize (300, 200); c. f.paint (300, 200); d. f.setVisible (300, 200);

Answer: b. f.setSize (300, 200);

Question 1 Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division. Input: 5+6 Output: 5+6 = 11

Question 2 Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image. Input: klgc Output: 18.0

Question 4 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: INPUT: OOXOO OOXOO XXXOO OOOOO XOABC OUTPUT: OOXOO OOXOO OOXXX OOOOO CBAOX

More NPTEL Solutions: https://progiez.com/nptel

These are NPTEL Programming In Java Week 9 Assignment 9 Answers

The content uploaded on this website is for reference purposes only. Please do it yourself first.

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.

Coulmn UID First_Name Last_Name Age
Type Integer Varchar(45) Varchar(45) Integer
         

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

Coulmn UID First_Name Last_Name Age
Row 1 1 Ram Gopal 26
Row 2 2 John Mayer 22

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

Coulmn UID First_Name Last_Name Age
From 1 Ram Gopal 26
To 1 Rama Gopala 24

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

Coulmn UID First_Name Last_Name Age
Delete 1 Rama Gopala 24

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

' src=

  • All Courses
  • Privacy Policy

' src=

Swayam Solver

Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.

NPTEL Programming in Java Jan 2024 Week 12

Week 12 : programming assignment 1.

Write a program that calculates the letter grade based on a numerical score entered by the user.

§   >=80 - A

§   70-79 - B

§   60-69 - C

§   50-59 - D

§   40-49 - P

§   <40 - F

Follow the naming convention as given in the main method of the suffix code.

Public Test CasesInputExpected OutputActual OutputStatus

Week 12 : Programming Assignment 2

Write a program that validates a user's password based on the following criteria (in the following order):

§   1. The password must be at least 8 characters long.

§   2. The password must contain at least one uppercase letter (A-Z).

§   3. The password must contain at least one lowercase letter (a-z).

§   4. The password must contain at least one digit (0-9).

Take the following assumptions regarding the input:

§   The input will not contain any spaces

Your output should print the rule that it violates  exactly  as defined above.

If the password violates multiple rules then the  first rule it violates should take priority .

For example:

Input:          

Output:      

Your password is invalid. The password must be at least 8 characters long.

Week 12 : Programming Assignment 3

Write a program that analyzes a given text and provides the following information:

§   Number of words:  The total number of words in the text.

§   Longest word:  The longest word found in the text.

§   Vowel count:  The total number of vowels (a, e, i, o, u) in the text.

§   The input will only contain lowerspace characters[a-z] and spaces.

§   The last word will not end with a space nor with any special character.

You need to print exactly as shown in the test case.

Do not print anyting else while taking input.

Private Test cases used for EvaluationStatus
Test Case 1
Test Case 2

Week 12 : Programming Assignment 4

Write a Java program to calculate the area of different shapes using inheritance.

Each shape should  extend   the  abstact class Shape

Your task is to make the following classes by extending the  Shape   class:

§   Circle   (use  Math.PI  for area calculation)

§   Rectangle

§   Square

Each Shape subclass should have these  private   variables apart from the  private   variables for storing  sides   or  radius .

private String shapeType ; private double area ;

Public Test CasesInputExpected OutputActual OutputStatus

Week 12 : Programming Assignment 5

Implement two classes,  Car   and  Bike , that implement the  Vehicle   interface. Each class should have appropriate attributes and constructors. Ensure that the  start ,  accelerate , and  brake  methods are implemented correctly for each vehicle.

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

Here are the assignment answers you need.

vklsaravanan/nptel-programmingInJava

Folders and files.

NameName
132 Commits

Repository files navigation

nptel

Programming In Java

Exercise1_1 - Complete the code segment to find the perimeter and area of a circle given a value of radius. Exercise1_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. Exercise1_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. Exercise1_4 - Complete the code segment to check whether the number is an Armstrong number or not. Exercise1_5 - Complete the code segment to help Ragav , find the highest mark and average mark secured by him in "s" number of subjects.

Exercise2_1 - Complete the code segment to call the method print() of class Student first and then call print() method of class School. Exercise2_2 - Complete the code segment to call the method print() of class given class Printer to print the following. Exercise2_3 - Complete the code segment to call print() method of class Question by creating a method named ‘studentMethod()’. Exercise2_4 - Complete the code segment to call default constructor first and then any other constructor in the class. Exercise2_5 - Complete the code segment to debug / complete the program which is intended to print 'NPTEL JAVA'.

Excercise3_1 - This program is related to the generation of Fibonacci numbers.>For example: 0,1, 1,2, 3,5, 8, 13,… is a Fibonacci sequence where 13 is the 8th Fibonacci number. Exercise3_2 - 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. Exercise3_3 - A class Shape is defined with two overloading constructors in it. Another class Test1 is partially defined which inherits the class Shape. The ..., Exercise3_4 - 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......, Exercise3_5 - Complete the code segment to swap two numbers using call by object reference.

Exercise4_1 - 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. Exercise4_2 - Complete the code segment to print the current year. Your code should compile successfully. Exercise4_3 - The program in this assignment is attempted to print the following output: Exercise4_4 - Complete the code segment to call the default method in the interface First and Second. Exercise4_5 - Modify the code segment to print the following output.

Exercise5_1 - 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. Exercise5_2 - 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. Exercise5_3 - 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. Exercise5_4 - 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.., Exercise5_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.

Exercise6_1 - Complete the code segment to print the following using the concept of extending the Thread class in Java: Exercise6_2 - 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. Exercise6_3 - Given a snippet of code, 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 ------------------------------------------------- Exercise6_4 - Execution of two or more threads occurs in a random order. The keyword 'synchronized' in Java is used to control the execution of thread .., Exercise6_5 - 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.

Exercise7_1 - 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. Exercise7_2 - 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". Exercise7_3 - 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.., Exercise7_4 - The following program reads a string from the keyboard and is stored in the String variable "s1".., Exercise7_5 -A string "s1" is already initialized. You have to read the index "n" from..,

Exercise8_1 - Write a program which will print a pyramid of " " 's of height "n" and print the number of " " 's in the pyramid. Exercise8_2 - Write a program which will print a pascal pyramid of " " 's of height "l" . Exercise8_3 - 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. Exercise8_4 - 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". Exercise8_5 - Write a program to display any digit(n) from 0-9 represented as a "7 segment display".

Exercise9_1 - Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division. Exercise9_2 - Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image. Exercise9_3 - 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: Exercise9_4 - 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: Exercise9_5 - 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:

Exercise10_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. Exercise10_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) Exercise10_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. Exercise10_4 - Complete the code segment to rename an already created table named ‘PLAYERS’ into ‘SPORTS’. Exercise10_5 - Complete the code segment to rename an already created table named ‘PLAYERS’ into ‘SPORTS’.

nptel java assignment

Author @vklsaravanan
Connect with me:
  • Java 100.0%

swayam-logo

Programming in Java

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

Note: This exam date is subjected 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 assignment

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 assignment

DOWNLOAD APP

nptel java assignment

SWAYAM SUPPORT

Please choose the SWAYAM National Coordinator for support. * :

IMAGES

  1. NPTEL PROGRAMMING IN JAVA WEEK 10 PROGRAMMING ASSIGNMENT ANSWERS

    nptel java assignment

  2. NPTEL PROGRAMMING IN JAVA WEEK 10 ASSIGNMENT ANSWERS

    nptel java assignment

  3. Programming in Java Nptel Week 10 Assignment 10 answers solutions #nptel2021

    nptel java assignment

  4. NPTEL Programming in Java Week 12 Quiz Assignment Solutions || July 2021 || Swayam

    nptel java assignment

  5. NPTEL Programming In Java Week 8 assignment 8 Quiz Answers 2022 || Unique Jankari

    nptel java assignment

  6. NPTEL Programming In Java WEEK2 Programming Assignment Solutions

    nptel java assignment

VIDEO

  1. NPTEL Programming in Java -Assignment(WEEK-7)

  2. NPTEL Assignment 07 Solutions for Engineering Drawing and Computer Graphics

  3. NPTEL Programming In Java Week 1 Assignment 1 Answers l Jan 2024

  4. NPTEL Programming In Java || Week 4 || Assignment 4 Solution || NPTEL Swayam || JAN

  5. NPTEL JAVA

  6. NPTEL Programming In Java || Week 4 || Assignment 4 Solution || NPTEL Swayam || JAN

COMMENTS

  1. 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)

  2. Computer Science and Engineering

    NPTEL provides E-learning through online Web and Video courses various streams. Toggle navigation. About us; ... noc20-cs08_Week_01_Assignment_01: noc20-cs08_Week_01_Assignment_01: noc20-cs08_Week_01_Assignment_02: ... Java Programming Steps: Download Verified; 3: Lecture 03: Java Tools and Resources: Download

  3. Welcome to my NPTEL Programming in Java repository! ...

    🌟 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

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

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

  6. Programming in Java

    NPTEL: Exam Registration is open now for Jan 2022 courses! ... Programming in Java - Assignment-6 Solution Released Dear Participants, The Assignment-6 of Week- 6 Solution for the course Programming in Java has been released in the portal. Please go through the solution and in case of any doubt post your queries in the forum.

  7. PDF Java Week 10: Q1

    Java Week 10: Q1. 04-09, 23:59 ISTThe following code needs some package. o work properly. Write appropriate code to import the required package(s) in order to make the program compile and exec. Sample Test Cases. Input. Output. Test Case 1. true. Test Case 2trueThe due date for submitting this assig.

  8. PDF Java Week 2:Q1

    Java Week 2:Q1 Complete the code segment to call the method print() of class Student. NOTE: Don't provide any INPUT in Sample Test Cases Sample Test Cases Input Output Test Case 1 Hi! I am class STUDENT. Test Case 2 Hi! I am class STUDENT. The due date for submitting this assignment has passed. As per our records you have not submitted this ...

  9. Programming In Java

    Programming In Java - - Announcements. Programming In Java : Exam certification criteria - Jan 2023. Dear Learners, Please see the certification criteria of this course below. Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course. Exam score = 75% of the proctored (in person ...

  10. Programming in Java

    Assignment score = Score more than 50% in at least 9/12 assignments. Programming Assignment score = Score more than 50% in at least 30/46 assignments. Exam score = 50% of the proctored certification exam score out of 100 Only the e-certificate will be made available. Hard copies will not be dispatched." 4. Register for exams

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

  12. 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:

  13. 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)

  14. NPTEL Programming In Java Week 9 Assignment 9 Answers

    Answer: a. remove () For answers or latest updates join our telegram channel: Click here to join. These are NPTEL Programming In Java Week 9 Assignment 9 Answers. Q7. What is true about the following code. a. Both "OK" and "Cancel" button is added, but only "Cancel" button is visble. b.

  15. Swayam Solver: NPTEL Programming in Java Jan 2024 Week 6 to 12

    NPTEL Programming in Java Jan 2024 Week 6 to 12 Posted on March 01, 2024 Please scroll down for latest Programs. 👇 . Week 6 : Programming Assignment 1. Due on 2024-03-14, 23:59 IST. ... Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program , your assignment will not ...

  16. nptel-solutions · GitHub Topics · GitHub

    nptel 2021 programming-in-java nptel-solutions nptel-assignments programming-in-java-nptel-solutions nptel-java-solutions Updated Aug 1, 2021; avinashyadav16 / The-Joy-of-Computing-Using-Pyhton Star 4. Code Issues Pull requests 12 Weeks long NPTEL Elective MOOC Course's codes, assignments and solutions. ...

  17. Swayam Solver: NPTEL Programming in Java Jan 2024 Week 11

    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.*;

  18. Programming In Java

    The assignment 0 for the course Programming In Java has been released. This assignment is based on a prerequisite of the course. Kindly note that marks obtained in this assignment will not be considered for the final assessment. You can find the assignment under Week 0 unit on the left-hand side of your screen.

  19. Programming_In_Java_NPTEL

    Java Week 3:Q5 To swap two numbers using call by object reference. WEEK 4. 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:

  20. Swayam Solver: NPTEL Programming in Java Jan 2024 Week 12

    The password must be at least 8 characters long. Follow the naming convention as given in the main method of the suffix code. Your last recorded submission was on 2024-04-06, 18:47 IST. Select the Language for this assignment. File name for this program : import java.util.Scanner; public class W12_P2 {.

  21. GitHub

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

  22. Data Structure and algorithms using Java

    Week 1: 1D array, list and vector, 2D matrices and tables of objects. Week 2:Java implementation of 1D and 2D arrays and its operations. Week 3: Linked lists and its various operations, stack and queue. Week 4: Java implementation of linked lists, stack and queue. Week 5: Binary trees: Representation and operations.

  23. 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)

Course Status : Completed
Course Type : Elective
Duration : 12 weeks
Category :
Credit Points : 3
Undergraduate
Start Date : 27 Jan 2020
End Date : 17 Apr 2020
Enrollment Ends : 03 Feb 2020
Exam Date : 26 Apr 2020 IST