import java.io.*;
public class fixedpartitionbestfit{
public static void main(String args[]) throws IOException{
BufferedReader br= new BufferedREader(new InputStreamReader(System.in));
int memory_block(0)= 99999;
int initial_memory_waste= 0;
int job_size= 0;
int subscript= 0;
int counter= 1;
System.out.print("Enter job_size:");
job_size= Integer.parseInt(br.readLine());
do{
if(job_size>memory_size(countter)){
counter= counter+1;
}else
memory_waste= memory_size(counter)-job_size;
if(initial_memory_waste>memory_waste){
subscript=counter;
initial_memory_waste=memory_waste;
counter=counter+1;
System.out.println("Memory_waste: "+memory_waste);
}
if(subscript= 0){
//put job in waiting queue
}else
//load job into memory_size(subscript)
//adjust free or busy memory lists
System.out.println("Subscript: "+subscript);
//fetch next job
//determine job's requested memory size
if(job_size>size of the largest partition){
//reject the job
System.out.println("Sorry! It is mismatch.");
memory_block(0)= 99999;
}else
subscript= 0;
counter= 1;
}while
(counter<=number of partitions in memory);
if(job_size>memory_partition_size(counter)){
counter=counter+1;
}else
if(memory_partition_size(counter)="free"){
//load job into memory_partition(counter)
//change memory_partition_status(counter) to "busy"
memory_block(0)= 99999;
}else
counter=counter+1;
System.out.println();
}
}
check my code for the java program fixed partition best-fitjava program
Page 1 of 1
2 Replies - 1669 Views - Last Post: 01 March 2009 - 04:33 AM
#1
check my code for the java program fixed partition best-fit
Posted 01 March 2009 - 04:13 AM
Replies To: check my code for the java program fixed partition best-fit
#2
Re: check my code for the java program fixed partition best-fit
Posted 01 March 2009 - 04:22 AM
@liz_cuesta, please paste your code within code tags
and please specify any errors you are getting, and the specific part that you are facing difficulties or stuck in, in addition please tell us more what your program is supposed to do, thanks
#3
Re: check my code for the java program fixed partition best-fit
Posted 01 March 2009 - 04:33 AM
ayman_mastermind, on 1 Mar, 2009 - 03:22 AM, said:
@liz_cuesta, please paste your code within code tags
and please specify any errors you are getting, and the specific part that you are facing difficulties or stuck in, in addition please tell us more what your program is supposed to do, thanks 
when i try to compile my program, it says that process complete but it doesn't run. my program is about fixed partition, best-fit with deallocation wherein we need to display the table and how jobs are allocated in the free storage. the deadlin of my project will be tomorrow so i need to finish it now. thank you and God Bless. Thanks for reading my post and sparing your time.
Attached File(s)
-
swu_os_1_.txt (1.62K)
Number of downloads: 71
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|