<prompt> Andika programu ya Java ambayo huiga kipanga ratiba cha msingi cha CPU kwa kutumia algoriti ya kuratibu ya Round Robin. Programu inapaswa kukubali orodha ya michakato iliyo na nyakati za kuwasili, nyakati za mlipuko, na vipaumbele, na kutoa mpangilio ambao inatekelezwa, pamoja na wastani wa muda wa kusubiri na muda wa kurejesha.  <response>: Hapa kuna programu ya Java ambayo inaiga kipanga ratiba cha msingi cha CPU kwa kutumia algorithm ya kupanga Round Robin: javaagiza java.util.;mchakato wa darasa int id, arrivalTime, burstTime, kipaumbele; int iliyobakiBurstTime; Public Processint id, int arrivalTime, int burstTime, int kipaumbele this.id id; this.arrivalTime arrivalTime; this.burstTime burstTime; hiki.kipaumbele kipaumbele; this.remainingBurstTime burstTime; darasa la umma RoundRobinScheduler utupu tuli wa umma String args Kichanganuzi cha kichanganuzi Kichanganuzi kipya System.in; System.out.printIngiza idadi ya michakato: ; int numProcesses scanner.nextInt; List processList new ArrayList; kwa int i 0; i Orodha ya mchakato, int timeQuantum int currentTime 0; int kukamilikaMichakato 0; int totalWaitingTime 0; int totalTurnaroundTime 0; Foleni readyQueue new LinkedList; wakati completedProcesses processList.size Ongeza michakato iliyofika kwenye foleni iliyo tayari kwa mchakato wa mchakato: processList ikiwa process.arrivalTime currentTime !readyQueue.containsmchakato readyQueue.ongezamchakato; Tekeleza mchakato wa kwanza kwenye foleni iliyo tayari ikiwa !readyQueue.isEmpty Mchakato wa sasaMchakato readyQueue.poll; System.out.printlnMchakato wa kutekeleza currentProcess.id; int timeSlice Math.mintimeQuantum, currentProcess.remainingBurstTime; currentTime timeSlice; currentProcess.remainingBurstTime - timeSlice; Angalia ikiwa mchakato umekamilika ikiwa currentProcess.remainingBurstTime 0 kukamilikaMichakato; totalWaitingTime currentTime - currentProcess.arrivalTime - currentProcess.burstTime; totalTurnaroundTime currentTime - currentProcess.arrivalTime; nyengine Ongeza mchakato nyuma kwenye foleni iliyo tayari readyQueue.ongezacurrentProcess; nyengine sasaSaa; mara mbili wastaniWaitingTime mara mbili totalWaitingTime processList.size; mara mbili wastaniTurnaroundTime mara mbili totalTurnaroundTime processList.size; System.out.printfWastani wa muda wa kusubiri: .2fn, WaitingTime wastani; System.out.printfWastani wa muda wa kugeuza: .2fn, wastani waTurnaroundTime; Mpango huu unakubali orodha ya michakato iliyo na nyakati za kuwasili, nyakati za kupasuka na vipaumbele. Kisha huiga algoriti ya kuratibu ya Round Robin kwa kutumia quantum ya muda maalum na kutoa mpangilio ambao michakato inatekelezwa, pamoja na wastani wa muda wa kusubiri na muda wa kurejesha.Tafadhali kumbuka kuwa msimbo huu haushughulikii uthibitishaji wowote wa ingizo au kushughulikia hitilafu, kwa hivyo hakikisha kuwa unatoa ingizo halali unapoendesha programu. 