NPTEL Programming In Java Assignment 7 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 7 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 7 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.
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.
- 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
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50.Â
CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERSÂ
BELOW YOU CAN GET YOUR NPTEL Programming In Java Assignment 7 Answers 2022? :
NPTEL Programming In Java Assignment 7 Answers 2022
Q1.
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”);
}
}
}
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 Programming In JAVA Assignments Answers Then Follow US HERE and Join Telegram.