Perform the following tasks on your lab machine 1 Create a list with the following numbers

Perform the following tasks on your lab machine: 1. Create a list with the following numbers (100, 300, 500, 2300, 2500) using the range function and answer the following: a. Print the length of the list b. Print the elements in the list such that each element appears in a separate line c. Print the average of all the items in the list d. Replace the maximum element of the list with the average value of the list e. Insert a new element at index 7. The value of the new element is the nth root of the value that is located in the middle of the list. Take n from the user. f. Write a for loop to print the last 3 elements in the list in reverse order g. Divide the list into two new lists where the first 3 elements will be in list X and the remaining elements will be in list Y. Print both lists. 2. Create two empty dictionaries dict1 and dict2: a. Create dict1. dict1 has two keys: 'car type' and 'size'. The value of each field is obtained from the user. b. Create dict2. dict2 has three keys: 'engine', 'origin', and 'date of release'. The value of each field is obtained from the user. The value of "date of release" is a dictionary {'day': value, 'month': value, 'year': value]. c. Add another field 'color' to dict1 and initialize it with your favorite color. d. Using the values stored in dict1 and dict2, print the following statement: "The car type is considered a size car. It has an engine CC engine. It is released on day/month/year". e. Merge both dictionaries into one dictionary called dict. f. Use the keys() method to print the following sentence: "The keys of dict2 are: engine, origin, and date of release".

Perform the following tasks on your lab machine: 1. Create a list with the following numbers (100, 300, 500, 2300, 2500) using the range function and answer the following: a. Print the length of the list b. Print the elements in the list such that each element appears in a separate line c. Print the average of all the items in the list d. Replace the maximum element of the list with the average value of the list e. Insert a new element at index 7. The value of the new element is t

Read More

3 Tuple Comprehension a Create a tuple with numbers from 1 to 10 b Create a new tuple that

3. Tuple Comprehension: a. Create a tuple with numbers from 1 to 10. b. Create a new tuple that contains the squares of each number in the original tuple using tuple comprehension. c. Print the original and new tuple. 4. Dictionary and List: a. Create a dictionary of items and their prices. b. Create a shopping list as a list of tuples, where each tuple contains an item and the quantity you want to buy. c. Calculate the total cost of your shopping list. d. Print out the items and quantities in your shopping list along with their total cost. 5. Given the following two lists, print the elements from the color list whose index is listed in the favorite list: color = [Red, Green, White, Black, Pink, Yellow] favorite = [1, 4, 3]

3. Tuple Comprehension: a. Create a tuple with numbers from 1 to 10. b. Create a new tuple that contains the squares of each number in the original tuple using tuple comprehension. c. Print the original and new tuple. 4. Dictionary and List: a. Create a dictionary of items and their prices. b. Create a shopping list as a list of tuples, where each tuple contains an item and the quantity you want to buy. c. Calculate the total cost of your shopping list. d. Print out the items and quantities in

Read More

Please in MIPS AssemblyIn this Project we will add a few more helpful subprograms to below

# Please in MIPS AssemblyIn this Project, we will add a few more helpful subprograms to below file.Notes: assume your subprograms already have inputs in the ‘a’ register(s) ($a0…$a3) and should store output(s) in the ‘v’ register(s) ($v0, $v1).Notes: no need to get user input or print output values, other subprograms in utils.asm can be used to do that.Notes: don’t ‘exit’ at the end of your subprogram, you need to return to the calling program using a jump operation NOR – take two input par

Read More

1 Create a TypeScript program that repeats the values 1 to 100 with the following loop

1. Create a TypeScript program that repeats the values 1 to 100, with the following loop operation: a. The first 10 loops display odd values (1, 3, 5, ..., 19). b. The second 10 repetitions display even values (2, 4, 6, ..., 20). c. And so on until we get to 100 repetitions. d. Each multiple of 10 displays the number of numbers displayed. e. Example output: Quantity: 25 2nd 10 repetitions: 12 14 16 18 20 Quantity: 80 3rd 10 repetitions: 21 23 ... 2nd 10 repetitions: 12, 14, 16, 18, 20 | Quantity: 80 3rd 10 repetitions: 21, 23, ...

1. Create a TypeScript program that repeats the values 1 to 100, with the following loop operation: a. The first 10 loops display odd values (1, 3, 5, …, 19). b. The second 10 repetitions display even values (2, 4, 6, …, 20). c. And so on until we get to 100 repetitions. d. Each multiple of 10 displays the number of numbers displayed. e. Example output: Quantity: 25 2nd 10 repetitions: 12 14 16 18 20 Quantity: 80 3rd 10 repetitions: 2

Read More

1 Write a program in MARIE assembly language to perform following code segment Test your code

1. Write a program in MARIE assembly language to perform the following code segment. Test your code thoroughly using the MARIE simulator with values of X=10, X=20, and X=30. What is the value stored in X and Y by the end of execution? Include comments for each line of instruction in your program (12 points). X=10 Y=0 while X!=0 do Y=X X=X-1 endwhile while X!=0 do Y=X X=X-1 endwhile 2. Consider the following program in MARIE assembly language. Complete the table detailing the RTN for the next 3 instructions only that will be executed including the content of registers PC, IR, MAR, MBR, and AC in hexadecimal. Note the first instruction LOAD X is already filled. Note also that the SKIPCOND instruction has no operands, therefore you can complete Fetch, decode and execute cycles only. Explain in one statement what this program is doing (14 points). ORG 000 LOAD X ; AC = X Repeat, ADD One ; AC = X + 1 SKIPCOND 000 ; if AC < 0 then PC = PC + 1 (skip) JUMP End ; Go to End STORE X ; X = AC JUMP Repeat ; Go to Repeat End, STORE X ; Stop (end of program) This program is incrementing the value of X by 1 repeatedly until the value in AC becomes negative. 3. Assume a main memory has the following hex values in the first two bytes: Byte 0: 8F Byte 1: 0F What is the actual decimal value stored in these bytes, assuming they are in 16-bit 2's complement representation and the machine is using: a) Big endian memory b) Little endian memory (4 points) a) In big endian memory, the byte order is reversed. So, the actual decimal value stored in these bytes would be -7. b) In little endian memory, the byte order remains the same. So, the actual decimal value stored in these bytes would be 36655. 4. Consider the assembly program (in MARIE) below and the corresponding memory address for each instruction. Show the symbol table that will be constructed by the assembler after the first pass including the translated program, then fill in the final machine code produced by the assembler after the second pass. Fill in the given tables using HEX numbers for instructions and addresses. (10 points) [Symbol Table] LOAD 0100 ADD 0101 STORE 0110 SUBT 0111 JUMP 1000 Dec1 0001 [First Pass] 0100 LOAD X ; Load value at address X to AC 0101 ADD Y ; Add value at address Y to AC 0110 STORE Z ; Store value in AC to address Z 0111 SUBT X ; Subtract value at address X from AC 1000 JUMP Z ; Jump to address Z [Second Pass] 0100 1005 ; Load X 0101 5006 ; Add Y 0110 210B ; Store Z 0111 1015 ; Subtract X 1000 4010 ; Jump Z

1. Write a program in MARIE assembly language to perform the following code segment. Test your code thoroughly using the MARIE simulator with values of X=10, X=20, and X=30. What is the value stored in X and Y by the end of execution? Include comments for each line of instruction in your program (12 points). X=10 Y=0 while X!=0 do Y=X X=X-1 endwhile while X!=0 do Y=X X=X-1 endwhile 2. Consider the following program in MARIE assembly language. Complete the table detailing the RTN

Read More

Wordle is a popular online word game Wordle There are instructions given at the official site for

Wordle is a popular online word game called Wordle. There are instructions given at the official site for Wordle, but essentially, it is a word guessing game. In this game, each guess is marked by indicating which letters of your guess match a secret answer. A Green mark indicates that you have found a correct letter in the correct position in the secret word. A Yellow mark indicates that you have found a correct letter but in an incorrect position relative to the secret word. A Grey mark indicates that the given letter does not appear in the secret word at all. Be careful of duplicate letters: a letter that is guessed twice may be marked once as Green or Yellow and once as Grey if there is only a single occurrence of that letter in the secret word. In particular, Green markings take priority over Yellow markings, and Yellow markings have a priority in the guess, reading from Left to Right. Given the datatypes dataCheck = GreenYellowGrey deriving (Eq, Show, Read), typeMarking = [(Char, Check)], write a function markGuess :: String -> String -> Marking that takes the secret word to be guessed and a guess of the same length. The function should return a marking according to the Wordle rules. The order of the returned marking matters and should satisfy map fst (markGuess secret guess) == guess. An example marking showing the marking priorities is markGuess "aaabb" "bbxxb" should return [(b, Yellow), (b, Grey), (x, Grey), (x, Grey), (b, Green)]. The final 'b' in the guess is marked Green because it is correctly placed in the secret word. The first 'b' in the guess is marked Yellow because there is a second occurrence of 'b' in the secret word in a different position. The second 'b' in the guess is marked Grey because there is no third occurrence of 'b' in the secret word. Note that your solution should work with strings of any length but should report an error where the two given strings are of different lengths. Hint: A reasonable strategy is to write a helper function that finds the characters marked Green first. Then feed the result of that helper function into another helper function that finds the Yellow markings.

Wordle is a popular online word game called Wordle. There are instructions given at the official site for Wordle, but essentially, it is a word guessing game. In this game, each guess is marked by indicating which letters of your guess match a secret answer. A Green mark indicates that you have found a correct letter in the correct position in the secret word. A Yellow mark indicates that you have found a correct letter but in an incorrect position relative to the secret word. A Grey mark indica

Read More

1 This program uses a loop to display a 2 table showing the numbers 1 through 10 3 and

Python please 6. See program 4-13. Using similar code, write a program for the multiplicatin table of 7 starting with 1 and ending with 34. That is the table should look like this:7 times 1 is 77 times 2 is 14....... 7 times 34 is ...Submit the program nd the output. Look at the flowchart for program 4-8.7. program 14 has the code that looks likefor kph in range (..., ..., ...) . The third argument is the increment. consider the following code:for x in range (10, 100, 5): print(x)What do you expect? write the program, run it and tell me if you got what you expected. submit the program and the output and a statement about your expectations. 17. turtle graphics can be used to design some very nice patterns using loops. Write programs 4-32, 4-33, and 4-34. Run them and make sure that you understood the programs. Now, I want you to write a new program using loops and turtle to produce a nice pattern as one of these three. Write this program and submit the program and output. The design you produce should be completely different from the three in the textbook. Do your best. Take it as a challenge and do it. You will not lose points if you do not do this problem.18. This problem you need to do. Write a turtle program using loops to produce a 10 by 10 grid of horizontal and vertical lines. I am sure you can understand a grid. Submit the program and the output.

Python please 6. See program 4-13. Using similar code, write a program for the multiplicatin table of 7 starting with 1 and ending with 34. That is the table should look like this:7 times 1 is 77 times 2 is 14……. 7 times 34 is …Submit the program nd the output. Look at the flowchart for program 4-8.7. program 14 has the code that looks likefor kph in range (…, …, …) . The third argument is the increment. consider the following code:for x in range (10, 100, 5): print(x)What do

Read More