UNIX/Linux Programming Answers

Questions: 170

Answers by our Experts: 135

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a shell script to compare two strings input by the user for equality.

Make a duplicate copy of a specified file through command-line using shell script Linux ubuntu

Write a shell script to find whether an input year is leap year or not

Write a C program to convert uppercase string to lowercase case string using strlwr() function.

Write a program to convert lowercase letter to uppercase struptr() function.

Write a C program to subtract two matrices using two dimensional array.

Sort {5, 1,12,-5, 16,2,12,14} using selection short

Problem Statement

You are to write a Linux elf64 assembly language program that performs the following tasks:

1. Prompts the user to enter a positive integer number (of value no more than 264-1.)

2. Prompts the user to enter a second positive integer number (of value no more than 264-1.)

3. Prints out the integer that is the greatest common divisor of the two entered numbers.


For those that don’t know, there is a famous algorithm (that is at least 2000 years old) for calculating this value. The greatest common divisor (GCD) algorithm goes as follows:

GCD (a, b):
 if (b==0) 
answer = a 
else if (a<a) 
answer = GCD (b, a )
else // (b>=a)
answer = GCD (b, a % b)

You should then create 8 new threads, each one representing a (uniquely numbered) plane; the main function should wait for all of the threads to complete and then exit. Each thread represents an airplane, and should repeatedly follow these steps: 1. board. Waits for 12 passengers to get on the plane. Between each available passenger boarding a random delay of between 0 and 2 seconds should be enforced. This can be accomplished by calling sleep(rand()%3) after each passenger boards. 2. The associated plane should then be shown taxi-ing to the runway. See the provided AirportAnimator class ! 3. The associate plane should then use the runway to take off, animating such (see the provided AirportAnimator class!) Of course, the plane should wait for exclusive access to the runway. 4. The plane should then go on tour. This basically just sleeps for between 15 and 45 seconds, and can be accomplished by calling sleep(15+rand()%31).


You should then create 8 new threads, each one representing a (uniquely numbered) plane; the

main function should wait for all of the threads to complete and then exit. Each thread

represents an airplane, and should repeatedly follow these steps:

1. board. Waits for 12 passengers to get on the plane. Between each available passenger

boarding a random delay of between 0 and 2 seconds should be enforced. This can be

accomplished by calling sleep(rand()%3) after each passenger boards.

2. The associated plane should then be shown taxi-ing to the runway. See the provided

AirportAnimator class !

3. The associate plane should then use the runway to take off, animating such (see the

provided AirportAnimator class!) Of course, the plane should wait for exclusive access

to the runway.

4. The plane should then go on tour. This basically just sleeps for between 15 and 45

seconds, and can be accomplished by calling sleep(15+rand()%31).




LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS