The values of $t0 and $t1 are 0xAAFFFFFF and 0x000EF000 respectively. Write a MIPS code that swaps bits 26 to 31 of $t0 with bits 11 to 16 of $t1.
given an integer N write program which reads N inputs and prints the product of the given integers
2 3 7
B. Create a program using Python programming language that counts election vote for a president. Your program should display first the list of people who are running for president, after which your program should ask the user for his/her vote (based on number). There should be a total of 20 voters. After entering the votes of 20 voters, your program should display the winner including the number
29 / 29
of votes. It should also display the second, third until last place including the number of votes they have. Used for loop and if, elif, else statement on your program. Apply iter() and next() methods on your program. Use list in storing the votes. Observed correct variab le names.
A .Using Python programming language, create a program that allows the user to compute for his/her fare using the information below;
0-5km = P20.00
6-10km = P30.00
11-15km = P40.00
The bus only travels within the province, so the distance does not exceed from 15 kilometers. Your program should ask the user for distance travelled, and your program will compute and display the fare.
Use the If, elif, else statement on your program. Select appropriate data type and create appropriate variable names for your program.
The function accepts two positive integers ‘r’ and ‘unit’ and a positive integer array ‘arr’ of size ‘n’ as its argument ‘r’ represents the number of rats present in an area, ‘unit’ is the amount of food each rat consumes and each ith element of array ‘arr’ represents the amount of food present in ‘i+1’ house number, where 0 <= i
Using function:
a. sort a list using bubble sort algorithm (ascending and descending order). you have
to take choice from the user. also the list should be user defined
b. search an item using binary search algorithm
a. Critically explain why you would consider the concept of using methods in your program again running a couple of if-else statements.
b. Declare a method with three arguments all of the type int. The method should return the greatest of the three arguments, however, if any two or all three are the same, your method should return that value.
c. Embed your method in a complete program that requests for three variables all of the types int and displays the conditions explained in “b” above.
Write a program that prints integers that are multiples of 5 in the range of 5 to 50. Name the program as follows: multiples_while.cpp. while loop program
Try to write pseudocode and create a flowchart for a program that calculates the average of three grades and prints the average.
The word GOOD should be printed only if the average is more than 80.