We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS508 Assignment No 03 Fall 2019 Solution & Discussion Due Date: 16-01-2020

    Assignment No. 03Semester Fall 2019CS508 - Modern Programming Languages Total Marks: 20
Due Date:16 January 2020    InstructionsPlease read the following instructions carefully before solving & submitting assignment:It should be clear that your assignment will not get any credit if:The assignment is submitted after due date.The submitted assignment does not open or file is corrupt.The assignment is completely or partially copied from (other student, handouts or internet).Student ID is not mentioned in the assignment File or name of file is other than student ID.The assignment is not submitted in .rar format. 

 Submission detailsFollowing Files Must be submitted in a single .zip or .rar file.Code file(s) .java file only A .gif file which shows working of your Application (For Recording .gif a software named Screentogif is uploaded on LMS, or you can use any other gif recording tool as well)You are not required to submit the complete project, only copy these files from project folder. Please note if you submit doc or txt file you will be awarded 0 marks. Make sure to write your own VU ID in the assignment file(s) otherwise assignment will not be accepted.  If you do not submit any of the above mentioned file 50% marks per file will be deducted.ObjectiveThe objective of this assignment is to give hands on practice on Java programming language.
Lectures Covered: This assignment covers Lecture # 27 – 31    
Problem Statement:
You are required to create a multithreaded java console application which will read a text file and write processed output in another text file.The program will be able to read the text file provided named input.txt using a separate thread.Calculate the number of characters in the file as per your student id.Last number of your student id is the character your program will calculate from the given list below. Last Number in ID Character to calculate Last Number in ID Character to calculate    0 ! 5 &    1 @ 6 (    2 # 7 )    3 $ 8 _(Underscore)    4 % 9 =  Output the result on the screen.Create a new thread which will create an output file and store the result in that file.

Output.gif has been attached with this Assignment file please observe this file carefully your program’s output must be like this output file.  

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1798

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

CS508 Assignment 3 Solution Fall 2019 | cs508 assignment 3 solution

CS508 Assignment 3 Solution Fall 2019. solution cs508 assignment 3. fall 2019 cs508 assignment 3 solution.

CS508 Solution Assignment No 03

Below link 

CS508_Assignmnet_03_Solution_Fall_2019_vustudents.ning.com.pdf

does anyone know how to do this assignment ?
please we all are already struggling with final year project. this is really tough.

ni bni to btyen kis tra ki help chaheay

Thread class

package bc160400;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;


public class Threads {
public static void main(String[] args) {
BlockingQueue<Integer> queue=new ArrayBlockingQueue<Integer>(1024);
ReaderThread reader=new ReaderThread(queue) {};
WriterThread writer=new WriterThread(queue);
System.out.println("My ID is BC1XXXXXX and special charactor to read is ')'");
new Thread(reader).start();
new Thread(writer).start();




// TODO code application logic here
}
}

ReaderThread class

package bc160400;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;

/**
*
* @author Nasir
*/
public class ReaderThread implements Runnable {
protected BlockingQueue<Integer> blockingQueue;
public ReaderThread(BlockingQueue<Integer>blockingQueue){
this.blockingQueue=blockingQueue;

}
@Override
public void run(){
System.out.println("ReaderThread is started");
BufferedReader br=null;
try {
br=new BufferedReader(new FileReader(new File("inputFile.txt")));
int buffer=0;
char match=')';
while((buffer=br.read())!=-1){
if((char)buffer==match){
blockingQueue.put(buffer);

}
}
blockingQueue.put(0);
System.out.println("Read:Thread Ended");


} catch (FileNotFoundException e) {
e.printStackTrace();

}catch(IOException e){
e.printStackTrace();
}catch(InterruptedException e){
e.printStackTrace();
}finally{
try{
br.close();

}catch(IOException e){
e.printStackTrace();
}
}
}
}

WriterThread Class

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package bc160400;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.concurrent.BlockingQueue;

/**
*
* @author Nasir
*/
public class WriterThread implements Runnable{
protected BlockingQueue<Integer> blockingQueue;
public WriterThread(BlockingQueue<Integer>blockingQueue){
this.blockingQueue=blockingQueue;

}
@Override
public void run(){
System.out.println("WriterThread is started");
PrintWriter writer=null;
char match;
int no=0;
try {
writer =new PrintWriter(new File("outputFile.txt"));
while(true){
int buffer=blockingQueue.take();
match=(char)buffer;
no++;
if(buffer==(0)){
break;
}
writer.println(no);
System.out.println("'"+match+"'"+"Found So far:"+no);
}
System.out.println("WriterThread Ended");
System.out.println("Total Number of special Charactor:"+"')'"+"in the file are:"+(no-1));

} catch (FileNotFoundException e) {
e.printStackTrace();
}catch(InterruptedException e){

}finally{
writer.close();
}
}

}

Please change according to ur need against ur ID.

Pease run the file in netbean by defining project name. and make class of these class name.

Enjoy

netbean bhi downlaod ki jb open krta hn tou woh javase ka kehta hae

CS508 Assignment 3 Solution 16 January 2020

RSS

Latest Activity

+ ! Eugene Fitzherbert ! replied to + ! Eugene Fitzherbert !'s discussion یا الہی انتا ربی YA ALLAH YOU ARE MY LORD
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
2 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + replied to + + + Haniya + + +'s discussion ❤❤❤❤❤TO MA JANIIIIII , KOJIIII , CHRIL , PSYCHOO HAPPY BIRTHDAY❤❤❤❤❤
3 hours ago
+ ! ! ❥ρsүcнσ༄ ! ! + liked + + + Haniya + + +'s discussion ❤❤❤❤❤TO MA JANIIIIII , KOJIIII , CHRIL , PSYCHOO HAPPY BIRTHDAY❤❤❤❤❤
3 hours ago
Arham Aziz replied to + ! ! ! ! ! ! ! ! ђคlєє๓ค !'s discussion to my jaaaaaaanu psycho happiest birthday jniii
4 hours ago
+ + + Haniya + + + replied to A.B !!!AWAN!!!'s discussion HAPPY BIRTHDAY CCP SYCHO ESHA
4 hours ago
+ + + Haniya + + + liked + + + Haniya + + +'s discussion ❤❤❤❤❤TO MA JANIIIIII , KOJIIII , CHRIL , PSYCHOO HAPPY BIRTHDAY❤❤❤❤❤
4 hours ago
+ + + Haniya + + + replied to + + + Haniya + + +'s discussion ❤❤❤❤❤TO MA JANIIIIII , KOJIIII , CHRIL , PSYCHOO HAPPY BIRTHDAY❤❤❤❤❤
4 hours ago

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.