Operating System sample questions and solutions

1. True or False. Explain briefly if false: a) In CPU scheduling, process starvation is possible in the FCFS technique. b) In Round-Robin CPU scheduling, the average turnaround time increases with the increase of time quantum.   a) false. Unless processes take infinite amount of time to execute (which isn’t true), a process will eventually […]

Read More

Java Program to calculate the Angle in degrees between the hour and minute hand of a clock

import java.util.Scanner; /** * * @author Vincent Amedekah */ public class TimeAngle { public static void main(String[] args) { String time = null; String timeArray[]; int hr,min; double hrAngle, minAngle,diffAngle; Scanner scan = new Scanner(System.in); System.out.print(“Enter the time:”); time = scan.nextLine(); timeArray = time.split(“:”); hr = Integer.parseInt(timeArray[0]); min = Integer.parseInt(timeArray[1]); hr = hr % 12; […]

Read More