What the following program does? 4 Marks START: LDA 2050H MOV B. A LDA 2051H CMP B JC OTHER STA 2052H JMP END OTHER: STA 2053H END: HLT Select one: a. If (2051) > (2050) store (2051) into (2052) b. If (2050) = (2051) do nothing C.All the options given here d. None of the options given here e. If (2051) < (2050) store (2051) into (2053)
Q: Let A = {{0, g}. g. {y}. {o}. o}. 1. |A| = 5 2. Which of the following statements are true? There…
A: 1. 5 2. A. {y} ∈ A is True. B. {o,g} ∈ A is True C. {o} ∈ A is True. D. {g} ∈ A is False E. o ∈ A…
Q: Let A = {a, q}, B = {3,8,9). ▸ Question 1 Question 2 Which of the following statements are true?…
A: Given sets are, A={ a, q} and B={3, 8, 9} A×B contains the sets of elements in which first element…
Q: How many times will the following function call itself if 5 is passed as the argument? void…
A: Given C# Function void showMessage(int n){ if (n > 0) { Console.WriteLine("Good…
Q: For the expression, c = (a!=b)?d:e; e will be assigned to c if: O a is greater than b O a is less…
A: Solution The given scenario has a ternary operator. The ternary operator checks a test condition and…
Q: Example Implementation (input in red): Loading word list from file... 55900 words loaded. Welcome to…
A: ANSWER: I have done code and furthermore I have joined code just as code screen capture. Code: def…
Q: In this challenge. we're getting started with conditional statements. Check out the Tutorial tab for…
A: I have written C++ code for following question:
Q: Given the following statement: int v = rand() % 26 + 25; What is the range of v? O a. [0, 26] O b.…
A: The function rand() generates the random number. Here we have divided the random number by 26 and…
Q: 344614.2214230.qx3zqy7 2 def double_pennies (num_pennies, num_days): total_pennies - e 4 5 * Your…
A: def double_pennies(num_pennies, num_days): total_pennies = 0 total_pennies = num_pennies if…
Q: Let t0 be a specific value of t. Find t0 such that the statement is true: P(t ≥ t0) = 0.005 where df…
A: Dear Student, To find it's answer we need to refer to t-table . Here given that, P(t ≥ t0) = alpha =…
Q: Write a program to find the sum of the following sequence .S=3 X^4/6!+5 X^6/10!+7 X^8/14!+ ---
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: y user-created passwords are simple and easy to guess. Write a program that takes a simple password…
A: Here no language is mentioned so I have given C++ code to modify the password given below.
Q: After the execution of the following program the content of MYREG is : MYREG EQU 40H MOVLB 4H…
A: The given program :- MYREG EQU 40H MOVLB 4H MOVLW 0H MOVWF MYREG, 1
Q: In [13]: def isAbundant (x) ""Returns whether or not the given number x is abundant. A number is…
A: Here is the python3 code: See below step for code.
Q: Example Implementation (input in red): Loading word list from file... 55900 words loaded. Welcome to…
A: Program Plan: Define load_word() function that loads the word from the text file. Define…
Q: need flowchart for this: #include #include char…
A: Below is the flowchart:
Q: The game of Pig is a simple two-player dice game in which the first player to reach 100 or more…
A: This is required code to perform above problem statement. See below step for code and output:
Q: Let p be the statement "I celebrate" and q be the statement "Bangladesh wins". [Hint: The following…
A: Here in this question we have given a conditional statement .and we have asked that which is…
Q: rite a program to find the result of the following equation : a? + b? X = ah + 1
A: GIVEN: Find the result of the given equation using a program NOTE: As the programming language is…
Q: Typing the following code a = 8; b = 5; %3D %3D if (a>b) p=9; end fprintf('p=%d\n°,p); a, b, p are…
A: The, answer has given below:
Q: The value of R after executing the following program, where M-15, L-8 is: Private Sub Commandi_Click…
A: given the program and values- M=15, L=8
Q: Analyze the code below: bscs = "The final exam in PROG 1" s1 = bscs [4:14] s2 = bscs [10:14] +…
A: According to the information given:- We have to choose the correct option to satisfy the statement.
Q: After the execution of the following program the content of MYREG is: MYREG EQU 40H. MOVLB 4H MOVLW…
A: These instruction are used in PIC ARCHITECTURE.A chip used in computer so as to operate . Below is…
Q: Q/lf 72 = mark is an integer variable and grade is a symbolic variable then the output to be printed…
A: The if-else-if ladder statement executes one condition from multiple statements. Exceution happens…
Q: Write a program that takes five students' quizzes in a course. Consider each student has given ten…
A: Best student will score highest average (sum of all quizes divided by the number of quizes) Worst…
Q: Example Implementation (input in red): Loading word list from file... 55900 words loaded. Welcome to…
A:
Q: Let A = {4, {4, 5}, {5},Ø}. ANswer each of the following questions. 1) |A| = 5 2) Which of the…
A: Here in this question we have given a set A and based on this we have asked to answer true or false…
Q: 1/ A Cuii number is the one whose digit sum is 17. Find out KthCuii number. K is an integer given as…
A: As per our company guidelines we are not supposed to answer more than one question per post and…
Q: QUESTION 9 Suppose sl and s2 are two strings. Which of the following statements or expressions are…
A: We consider the s1 is the one of the string and S2 is the another string Suppose s1 and s2 are two…
Q: 1. Write a program to show the following sentences: I am a student. I love China.…
A: 1) As Coding language is not mentiones i am providing the code in c++: #include…
Q: Task 03 Write a program which stores a large number in AX, stores another smaller number in BX. Now…
A: the program is given below:-
Q: Q17: Given that A and B are real variables with values 1.5, and 2.5 respectively, and C is integer…
A: 17. ) given, A = 1.5 B = 2.5 C = 3. so, NOT( A < 0 ) AND ( B/C <= 0 ) = NOT( 1.5…
Q: 7. Write a program that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 *…
A: NOTE :- As per our Guidelines we only give one question solution at a time. Answer :- ( 7 ).…
Q: Q.7: How many multipliers of 3 are there between 1 and 100? Write a program to find that.
A: C++ code: #include<iostream>using namespace std; // Returns count of all numbers which are…
Q: # EX 5 DEBUG THIS CODE TO MAKE IT WORK hello = "Hello World" noun = "David" numberof_friends = "2"…
A: In this problem, we need to debug the code and fix the changes so this code is properly working. I…
Q: C) ||$\vec{a} \vec{b} \vec{c} |\vec{r} [$ D) $\frac{\mid[\vec{a} \vec{b} \vec{c} |\vec{r}|}{5}$…
A: LaTeX is widely used in science and programming has become an important aspect in several fields of…
Q: Write a program to calculate: 1+x+x?/2!+x³/3!+*.*+x"/n! Hints: you can re-use the function Factorial…
A: Algorithm: Step-1: Start Step-2: Take input x and n from user Step-3: Call function sum with…
Q: A company is hiring university grads. Write a program in which the HR enters the total number of…
A: A company is hiring university grads. Write a C++ program in which the HR enters the total number of…
Q: 9. consider the following code: int numCredit 75; string studentYear; if (numCredit > 90)…
A: If else is conditional statement which executes if statement based on true condition otherwise else…
Q: What answers do you get for below queries for given program. Program : vegetarian(jose).…
A: The Program below is written in Prolog as required
Q: How many times the above statement will be executed? Write down the Big-O for the above statement?…
A: As per guidelines, we are supposed to answer only one question. Kindly repost the another question…
Q: Let p be the statement "I celebrate" and q be the statement "Bangladesh wins". [Hint: The following…
A: - The question wants to know the contrapositive of the provided statement. - We have the statement…
Q: aこ5 b=2 2 a t b Prink ("o tb-", a) will l Pfint
A:
Q: 1. Consider the code fragment: Which of the following is equivalent to the given code fragment? *…
A: As given, we need to find out the equivalent code to the given code fragment. Given code -…
Q: 2. docs.google.com Q In the following segment of C++ when we enter a value for f we get a value for…
A: Option1: When f=2: 1st if condition is false because 81 is not less than 7 2nd if condition(i.e next…
Q: 10. What will the following print out? - 3; int num System.out.println("Song titles with numbers…
A: To do: what is output from the given
Q: Q2. write a loan Calculator progroms that Computer both eund total Payment for a grven loai…
A: A program is mainly designed in order to achieve certain objectives. Generally, programs are written…
Q: Suppose we add $100 to a checking account in year 1, $200 in year 2, $300 in year 3, and so on. The…
A: #include <iostream>using namespace std; int main(){ double balance = 0; int year = 0;…
Q: def countdown (n): # what is the conditional statement that sho uld go here to achieve the printout…
A: Option-1) Given Code: When we use option-1 in given code as: def countdown(n): if…
Q: One of the following is not true O a. When a parent forks a child, parent might give the child part…
A: The answer is given below.
Q: tes thild attends The Days Per Week 1 2 3 Age in Years 30.00 60.00 88.00 5 26.00 52.00 115.00 70.00…
A: Programming instructions: Include necessary header files. Declare functions. In the main, Declare…
Step by step
Solved in 2 steps
- Java code Ever wondered how change is disbursed to customers in certain stores? In country X the following notes exists 200,100,50,20,10 and following coins: 5, 1, 50c, 10c, 5c. For the sake of this exercises let us only consider change below 50 see below example: Sample run 1: Enter item name: Apples Enter QTY of Apples: 2 Enter price per item N$: 3.25 Amount tendered N$: 50 Your change is: N$ 43.50 Disbursed as follows: 2 x N$20; 0 x N$10; 0 x N$5; 3 x N$1; 1 x 50c; 0 x 10c; 0 x 5c [Hint: make use of % and / operators to determine the values needed]Question 12 kana .Which of the following statements is false? The re module's findall function finds every matching substring in a string and returns a list of the matching substrings. The following code extracts all phone numbers of the form ###-###-#### from a string:contact = 'Wally White, Home: 555-555-1234, Work: 555-555-4321're.findall(r'\d{3}-\d{3}-\d{4}', contact) The re module's finditer function works like findall, but returns a greedy iterable of match objects. For large numbers of matches, using finditer can save memory because it returns one match at a time, whereas findall returns all the matches at once. Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this lineWrite a VB program to ask user to assign a value to “i” to find the answer for the following three cases. 1. Case 1. Assume i = 1 and HowMuch = 0IF i < 5 THENHowMuch = HowMuch + 1ELSEIF i = 5 THENHowMuch = HowMuch - 5ELSEHowMuch = HowMuch + 3END IFDISPLAY HowMuch2. Case 2. Assume i = 5 and HowMuch = 0IF i < 5 THENHowMuch = HowMuch + 1ELSEIF i = 5 THENHowMuch = HowMuch - 5ELSEHowMuch = HowMuch + 3END IFDISPLAY HowMuch3. Case 3. Assume i = 6 and HowMuch = 0IF i < 5 THENHowMuch = HowMuch + 1ELSEIF i = 5 THENHowMuch = HowMuch - 5ELSEHowMuch = HowMuch + 3END IFDISPLAY HowMuch
- Assume that a, b, c are numbers.Return 'increasing' if they are in increasing order, 'decreasing' if they are in decreasing order, 'both' if they are both increasing and decreasing, and 'neither' otherwise.Here, 'increasing' means that each value is at least as largeas its predecessor. Similarly for decreasing.The sequence 3, 4, 4 is increasing. whereasthe sequence 4, 4, 4 is both increasing and decreasing.For example,lenient(3, 4, 5) returns 'increasing'lenient(3, 4, 4) returns 'increasing'lenient(4, 4, 4) returns 'both'lenient(4, 3, 2) returns 'decreasing'lenient(4, 3, 3) returns 'decreasing'lenient(4, 2, 3) returns 'neither'Implement the ff. decision table using a nested if statement. Assumethat the grade point average is within the range 0.0 through 4.0 GRADE POINT AVERAGE TRANSCRIPT MESSAGE 0.0 – 0.99 Failed semester – registration suspended1.0 – 1.99 On probation for next semester2.0 – 2.99 ( no message )3.0 – 3.49 Dean’s list for semester3.5 – 4.00 Highest honors for semesterA 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend offered help to create a program they can use. The program contains 3 options, 1st option is for Permutation, 2nd option is Combination and 3rd is for terminating the system. For option 1, Permutation, they uses the following formula: nPr = ; where r must not be greater than n. It should not proceed if this condition is not met. For 2nd option, Combination, they uses the formula : nCr = ; where r must not be greater than n as well. For the 3rd option, the program owner’s information shall be displayed, like name, subject code and account number, before the program terminates.
- plz solve it asap ????????: Write a program for a game that consists of two players. The rule of the game is that player 1 inputs a random number from 1-100. Player 2 will input 5 numbers. If the summation of those numbers is equal to the number OR less than or greater than the number by 3 (+3 or -3), then player 2 wins. Otherwise, player 1 wins. Test Case 1 Input Player 1, enter a number: 50 Player 2, enter a number: 10 Player 2, enter a number: 10 Player 2, enter a number: 20 Player 2, enter a number: 5 Player 2, enter a number: 7 Output Player 2 wins Explanation: The summation of 10,10,20,5 and 7 is 52 which is greater than 50 by 2. According to the rule, player 2 wins. Test Case 2 Input Player 1, enter a number: 50 Player 2, enter a number: 10 Player 2, enter a number: 10 Player 2, enter a number: 20 Player 2, enter a number: 5 Player 2, enter a number: 1 Output Player 1 wins Explanation: The summation of 10,10,20,5 and 1 is 46 which is less than 50 and also doesn’t…Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }Write a program to calculate total ordering cost. Jacob is a retailer for ice. Normally a bag of ice costs $2.5, but the price varies with the amount that he purchases. The following table shows the discount that Jacob receives. Order Volume Discount Rate >= 200 bags 25% off 120 - 199 bags 20% off 60 - 119 bags 15% off 40 -59 bags 10% off 20 – 39 bags 5.5% off 0-19 bags No discount (1) Inyourprogram,definevariableswithmeaningfulnamestoacceptuserinputonordervolume, and calculate total ordering cost based on the order volume inputted. Use if-else statements to handle the calculations for different order volumes as shown in the above table. (2) Yourprogramshouldprintoutuserordervolume,discountrate,andtotalorderingcostinconsole (similar to the following sample outputs)
- This is a JAVA programming assignment. Program a GeneticAlgorithm to find an integer number between 0 and 31 that maximizes the function f (x) = x2.The initial procedure is given as below.• Population size: 6• Crossover probability: 100%• Mutation probability: 5%• Terminating criteria:o When your program produces an average of candidates is equal to or greater than29, then you can accept it as a terminating condition.• Fitness function:o You can use the function itself (f (x) = x2)as your fitness function.1. For the 1st generation, you need to print the process and result of selection, crossover, andmutation operation.you need to print the corresponding integer values and bits (binary values)of selection, crossover, and mutation operation. You also need to decide andprint the crossover point and the mutation point.2. From the 2nd generation, you do not have to print all results of selection, crossover,mutation operations. You can just print the result of each generation. Please provide…Complete the function below that takes in three integers (a,b,c) and returns the number of integers between a and b (inclusive of the endpoints) that are divisible by c. Make sure it tests a and b for divisibility by c! In [ ]: defhow_many_divisible(a,b,c):counter=0# YOUR CODE HEREraiseNotImplementedError()returncounter In [ ]: assert how_many_divisible(10,20,5) == 3 assert how_many_divisible(30,77,7) == 7 PYTHON jYPYTERHere is the code i have written so far, please finish it #include <stdio.h>#include <cstack.c> int i=-1;int nextstate=0;cstack top; init_cstack(&top);while(1) switch{ case 0: i++; if (is_open(my_input[i])) nextstate= 1; else if (is_close(my_input[i])) nextstate= 2; else if (my_input[i] == '\0') nextstate= 3; else nextstate= 4; break; case 1: if(!is_cfull()){ cpush(&top, my_input[i]); nextstate= 0; } else{ printf("Error! Stack is full\n"); exit(0); } break; case 2: if (!is_cempty(top)){ if(is_brother(cpop(&top), my_input[i])){ nextstate= 0; } else{ printf("Error! Delimiter do not match\n"); return FALSE; } } else{ printf("No open delimiter to compare to\n"); return FALSE; } break; case 3: if…