a function return the minimum distance between indices of an array that have adjacent values,the function should return -1 if the minimum distance is greater then 100,000,000. the function should return -2 if no adjacentindices exist
DressingRooms class
• Define a class with a constructor that takes number of rooms as a parameter.
• The default constructor will use three rooms as the default.
• Use a semaphore object.
• Provide a method to wait and access next available room.
Customer class
• Constructor is included with a number of clothing items parameter.
• Use a random number when the number of items is not
Scenario class
• Accept the number of rooms and customers as parameters
• Create the rooms.
• Create the customers.
• Keep track of results.
Scenario00
Define a test using these parameters:
• 10 customers
Scenario01
Define a test using these parameters:
• 20 customers
Scenario02
Define a test using these parameters:
• 20 customers
A program that scan a number n and then output the sum of the powers from 1 to n. Thus, if the input is 4, the output should be 288:
1¹ + 2² + 3³ + 4^4 1 + 4 + 27 + 256 = 288
Write a program that accepts a number and outputs its equivalent in words.
Ex. Enter a number: 1380 Output: One Thousand Three Hundred Eighty
Note: The maximum input number is 3000
Solution 1: if / else if / else conditional statement
Solution 2: switch / case conditional statement
C program you wrote to do division in constant time
1. The label for the dividend is dividend
1. 4 bytes of space should be made for the dividend
2. The label for the divisor is divisor
1. 4 bytes of space should be made for the divisor
3. Place the quotient in EAX
4. Place the remainder in EDX
5. Don't forget that if you want to shift by a variable amount the shift amount must be placed
in CL. Your assembly code won't work if you try to place it in any other register.
6. AFTER the last line of code that you wish to be executed in your program please place the
label done.
1. Make sure that there is an instruction after the done line and a new line after that
instruction. If you don't your output won't match mine.S
7. IT IS OF VITAL IMPORTANCE THAT YOU NAME YOUR LABELS AS
SPECIFIED AND MAKE THE APPROPRIATE AMOUNT OF SPACE FOR EACH
VARIABLE! I will be using gdb to test your code and if your labels do not match then the
tests will fail.
Write a C# console program to display a multiplication table.
Prompt the user to supply a table number in the range 1 to 20.
Validate that the value given is in the range 1 to 20.
Display the table for values from 1 to 12. For example, if the eight times table is
requested, the display should be as follows:
1 times 8 = 8
2 times 8 = 16
3 times 8 = 24
…
up to:
12 times 8 = 96