NPTEL Programming In Java Assignment 8 Answers 2022

NPTEL Programming In Java Assignment 8 Answers 2022 :- Here All The Questions and Answers Provided to Help All The Students and NPTEL Candidate as a Reference Purpose, It is Mandetory to Submit Your Weekly Assignment By Your Own Understand Level.

 

Are you looking for the Assignment Answers to NPTEL Programming In Java Assignment 8 Answers 2022? If Yes You are in Our Great Place to Getting Your Solution, This Post Should be help you with the Assignment answer to the National Programme on Technology Enhanced Learning (NPTEL) Course “NPTEL Programming In Java Week 8 Assignment Solution 2022”

 

NPTEL Programming In Java

From My Side : With the expansion of knowledge and Communication Technology, there’s a desire to develop massive and complicated package. Further, those package ought to be platform freelance, web enabled, straightforward to switch, secure, and robust. to satisfy this demand object-oriented paradigm has been developed and supported this paradigm the Java artificial language emerges because the best programming atmosphere. Now, Java artificial language is being employed for mobile programming, web programming, and plenty of alternative applications compatible to distributed systems. This course aims to hide the essential topics of Java programming in order that the participants will improve their skills to address the present demand of IT industries and solve several issues in their own filed of studies.

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.

INTENDED AUDIENCE :  The undergraduate students from the engineering disciplines namely CSE, IT, EE, ECE, etc. might be interested for this course.
PREREQUISITES :  This course requires that the students are familiar with programming language such as C/C++ and data structures, algorithms.
INDUSTRY SUPPORT :   All IT companies.

CRITERIA TO GET A CERTIFICATE

This course can have Associate in Nursing unproctored programming communication conjointly excluding the Proctored communication, please check announcement section for date and time. The programming communication can have a weightage of twenty fifth towards the ultimate score.

Final score = Assignment score + Unproctored programming exam score + Proctored Exam score
  • 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
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF ASSIGNMENT SCORE >=10/25 AND
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50. 
If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100. 

CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERS 

BELOW YOU CAN GET YOUR NPTEL Programming In Java Assignment 8 Answers 2022? :

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

1. Which of these is method for testing whether the specified element is a file or a directory?

a. IsFile()
b. isFile()
c. Isfile()
d. isfile()

Answer:- b
2. Which of the following is/are NOT Standard Stream(s)?

a. System.in
b. System.out
c. System.er
d. System.console

Answer:- d

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

NPTEL Programming In Java Assignment 7 Answers 2022
3. What will be the output of the Java code?

a. NPTEL
b. NPTELJULY/2022
c. NPTELJULY/2022
d. 2022

Answer:- d
4. What will be the output if the above program is executed?

a. It will give compile-time error
b. It will give run-time error
C. j
d. 106

Answer:- d
5. Which method is used to write a byte to the current output stream?

a. public void write(int b)throwvs IOException
b. public void write(bytel ] b}throws IOException
C. public vo1d flush(Othrows loException
d. public void close( )throws lOException

Answer:- b
6. Which method of RandomAccessFile clas reads a line from the file and returns it as a String ?

a. Writelnt().
b. readLine()
C. readnt()
d. WriteDouble()

Answer:- b

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

NPTEL Programming In Java Assignment 7 Answers 2022

7. Which of these class is not a member clas of java.io package?

a. File
b. PrintStream
c. StringReader
d. Stream

Answer:- d
8. Which of the followving is/are interface(S) of java.io package?

a. FileReader
b. FileWriter
c. DataOutput
d. Datalnput

Answer:- c, d
9. In which Java APIs the classes for handling all IO-streams are defined?

a. java.lang
b. java.util
C. java.i0
d. java.awt

Answer:- c

10. If the program is executed, then what will be the output from the execution?

a. length: 6
b. length: 5
c. length: 0
d. length:1

Answer:- b

NPTEL Programming In Java Assignment 8 Answers 2022

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.

Solution Code : – 

import java.util.*;
public class Question1{
public static void main (String[] args){
int i,n=0,sum=0;
Scanner inr = new Scanner(System.in);
for (i=0;i<3;i++)
{
n = inr.nextInt();
sum =sum+n;
}
System.out.println(sum);
}
}

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

Solution Code :-

import java.io.*;
public class Question2{
public static void main(String args[]){
try {
InputStreamReader r=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(r);
String number=br.readLine();
int x = Integer.parseInt(number);
System.out.println(x*x);
}
catch (Exception e){
System.out.println(“Please enter valid data”);
}

}
}

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

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.

Solution Code :-

import java.util.*;
public class Question3 {
public static void main(String[] args) {
try{
byte barr[]={‘N’,’P’,’T’,’E’,’L’,’-‘,’J’,’A’,’V’,’A’,’J’,’A’,’N’,’-‘,’N’,’O’,’C’,’C’,’S’,’E’};
Scanner inr = new Scanner(System.in);
int n = inr.nextInt();
String s2 = new String(barr,n,1);
System.out.println(barr[n]);
System.out.println(s2);
}
catch (Exception e){
System.out.println(“exception occur”);
}
}
}

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

Solution Code :-

import java.io.*;
import java.util.*;

public class Question4{
public static void main(String[] args) {
int c=0;
try{
InputStreamReader r=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(r);
String s1 = br.readLine();
for(int i=0;i<s1.length();i++){
char s2=s1.charAt(i);
if(s2==’e’ || s2==’E’|| s2==’a’ || s2==’A’ || s2==’i’ || s2==’I’ || s2==’o’ || s2==’O’ || s2==’u’ || s2==’U’)
{
c=c+1;
}
}
System.out.println(c);
}
catch (Exception e){
System.out.println(e);
}
}
}

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.

Solution Code :-

import java.util.*;
public class Question5 {
public static void main(String[] args) {
try{
String s1=”NPTELJAVA”;
Scanner inr = new Scanner(System.in);
int n = inr.nextInt();
char c=’a’;
//Replace the char in string “s1” with the char ‘a’ at index “n” and print the modified string
byte[] barr=s1.getBytes();

byte b1 = (byte) c;
barr[n]=b1;
System.out.println(new String(barr));
}
catch (Exception e){
System.out.println(“exception occur”);
}
}
}

Yhaa You have done it but next? if YOU Want to your Others NPTEL Programming In Java Assignment 8 Answers 2022

Related Posts

Leave a Reply

Your email address will not be published.

adplus-dvertising