Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please complete in JAVA only PROBLEM: CHMOD is a command in the UNIX computer system. It is the command used for giving users permissions to
Please complete in JAVA only
PROBLEM: CHMOD is a command in the UNIX computer system. It is the command used for giving users permissions to access and change files and directories. There are 3 classes of users. They are the owner, the group and others. The permissions given are: read(r, write(w) and execute(x). The argument of the CHMOD command is a 3-character octal number (ex. 526). When each digit of that number is converted to binary, the binary digits are paired to represent read, write and execute in that order. 526 would convert to 101 010 110 The first binary conversion gives the user permissions. The second gives the group permissions. The third gives the permissions. So here, the owner has read and execute permissions and that is represented by r-x. The group has only write permission given by -w-. The others class has read and write permissions as shown by rw Putting all of the above together CHMOD 526 101 010 110- others INPUT: There will be 5 lines of input. Lines 1 and 2 will eaclh contain 3 octal digits. Lines 3 and 4 will each contain three 3- digit binary numbers. Line 5 will contain three 3-character stings OUTPUT: For each line of input print the other two equivalent forms of the CHMOD result. Print a space between each grouping as shown bclow. SAMPLE INPUT 1. 5, 2, 6 SAMPLE OUTPUT 1. 101 010 110 and r-x- 2. 7,3, 0 2. 111 011 000 and rwx 3 100, 001, 101 4. 010, 011, 100 3, 415 and r--x r-x 4. 234 and-w--wx r- 5. r-x, rw-, rwx 5. 567 and 101 110 111 TEST INPUT 1.7, 2, 1 TEST OUTPUT 1. 111 010 001 and rwx 2. 011 100 110 and -wx 3. 517 and r-x --x 4. 165 and-x rw-r 5. 725 and 111 010 2.3, 4, 6 r- rW- 3. 101, 001, 111 4.001, 110, 101 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started