i Which of the following macros can put a macro assembler into an infinite loop? MACRO MI,X MACRO M2,X IF EQ, X M1 X+1 .IF EQ,X M2 X ENDC ENDC IF NE, X IF NE, X WORD X WORD X+1 ENDC .ENDC ENDM ENDM Give an example call that does so.
Q: Write a C++ program that requests any number of input integers from user, sorts and displays the…
A: Write a C++ program that requests any number of input integers from user, sorts and displays the…
Q: 396 Chapter 8 ▼ The Preprocessor Exercises 1 A program that contains macros with arguments can be…
A: 1. Start 2. Define a macro PRN to print a string 3. Create a main function 4. Call the macro PRN…
Q: Write a program to calculate the net pay of an employee. Input the basic pay, pass basic pay to user…
A: #include<iostream.h>#include<conio.h> class Employee{ char emp_name[30]; int…
Q: Contiguous Memory Allocation Algorithms The program will read size of free memory partitions and…
A: import sys def firstfit(memory, process,out): out.write("start => ") for m in memory:…
Q: Problem 1 Ms. Susan Aparejo is a contemporary poet and wrote a poem on Artificial Intelligence in a…
A: """ Python version: 3.6 Python program to perform file handling """ def createFile():…
Q: Exercise 2: Please complete the script in exercise 1 by filling these four functions, system_info(),…
A: For each function stub perform the following steps: Remove the default comments and add meaningful…
Q: ONLINE COMPILER Task 2: (saudents should work on their own)-Refer to Example 3, Page 4 Write a C…
A: PROGRAM CODE: #include<stdio.h>void main(){ int marks; printf("Enter your marks (0-100):…
Q: [Question Description] Writer a program that read an interger and displays all its smallest factors…
A: Here in the question ask for a program which find smallest factor of number.
Q: Write a C++ program that will perform the following Algorithm: PART 1- Adder Program (without…
A: *As per the bartleby guidelines we are providing first question answer only please repost remaining…
Q: Scenario You are implementing a program at work and you need to use a package that you have never…
A: According to the information given:- We have to define the function which will take a package or…
Q: Create a Program Sort and display options on: a. Priority group that has the most vaccines…
A: In this program select one option a, b, c, or d After selecting the option you will get the…
Q: rogram language: Python Prompt: create a function for genres and rating_range ([3.1, 4, 4.5]),…
A: Task : Given the dataset. The task is to perform the given query on the dataset.
Q: For this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD,…
A: Below is the assembly code for decrypting an encrypted string using the given key:
Q: A company wants you to create a program that tests the speed of several search and sort algorithms.…
A: A company wants you to create a program that tests the speed of several search and sort algorithms.…
Q: Exercise 2 (Refer to Lecture 10 page 19) Please complete the script in exercise 1 by filling these…
A: We can use following instructions to complete the above functions. For system_info : uname For…
Q: evelop a computer-assisted instruction program to teach an elementary-school student multiplication.…
A: Given: Develop a computer-assisted instruction program to teach an elementary-school student…
Q: 2. Calculate Tax Values. You are part of a programming team developing point-of-scale terminal…
A: open the workbook XLMM_Sales Tax. XLS Press Alt + F11+0 to activate the VBE click the work book's…
Q: Design a complete C++ program that have features to manipulate the numeric values in arrays data…
A: Ask for the option from the menu. Then use switch case to perform the appropriate action from the…
Q: If we have 8, 9 and 6 in the cells D3, D4 and D5 respectively, what will this macro do? Sub test()…
A: This question comes from Programming Logic Section which is a paper of Computer Science. Let's…
Q: Create a function to match the specifications Use floating-point value division Write a program to…
A: Solution :
Q: 1. Write a C++ programme that can display 2-dimensional array (matrix) with its size and elements…
A: Write a C++ programme that can display 2-dimensional array (matrix) with its size and elements…
Q: Hello how to fix this issue? please help!
A: #include <stdio.h>int main(){ printf("Subcode: CE0002L\n"); printf("Sub Description:…
Q: Write a python program that calculates the average percent scores of your courses and your overall…
A: PROGRAM EXPLANATION: - The main_course file comprise of main function which takes input for the…
Q: Create a C++ program that will Read matrix A and matrix B in row major order and in column major…
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Develop an algorithm and Linux script to store 10 different module names in an array.
A: An algorithm and Linux script to store 10 different module names in an array is given below:-
Q: In the following program: if the initialized value of the break program is the address=…
A: The above is coded in C language.
Q: in matlab A script file can easily be converted into a function using which of the following?…
A: Create File Functions You may reuse sets of commands by saving them in programme files using both…
Q: Create a function named problem2. Create a list of 5 colleges/universities in New Jersey. Next, use…
A:
Q: C++ Use the PEP/8 Assembler to write a program to compute the 5th element of the Fibonacci sequence…
A:
Q: Create a program that will ask the user to input their name (string), age(int), score(double) using…
A: Define a class with data member name, age, score, year, month,date and function member as add and…
Q: PLS HELP IN MAKING TF-IDF IN PYTHON PROGRAMMING 1. a function that will load multiple (between 5 to…
A: Developing a Python implementation of the TF-IDF (Term Frequency-Inverse Document Frequency)…
Q: Write a program that uses a custom function named as you wish and the main function. In main, prompt…
A: A required Python program is as follows, File name: "program5_1.py" #Function to print name as many…
Q: A school is developing a program to keep track of information about students and their class…
A: Explanation: A programming-loop is an instruction of the computer that is used for the repetition…
Q: 18-Write a function called items_price that receives 2 lists as input .The first list contains n…
A: Algorithm of function items_price(a, b): 1. Find length of list a as length. 2. Initialize price to…
Q: Write a macro single charact parameters: t displayed anč
A: The following are the required instructions: mPrintChar MACRO char, num LOCAL arr1 .data arr1 BYTE…
Q: Create a program using a loop in C++ and ARM Assembly language that executes the following: The…
A: Program in c++: #include <iostream> using namespace std; int main() { int a=-30,b=96;…
Q: 3.a The function is named validity(). It receives 2 floating point parameters, min and max, from the…
A: Function Table:
Q: Using the Macro VBA tool, create a function that receives a sequence of characters larger than 1 and…
A: In VBA, A macro is a grouping of code that performs a series of tasks. It is also known as a…
Q: Write a scheduling program that implements one of these non-preemptive scheduling algo- rithms: •…
A: Below I have provided a program for the given question. Also, I have attached a screenshot of the…
Step by step
Solved in 2 steps with 1 images
- For this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD, CMPSB,CMPSW,CMPD,SCASB, SCASW, SCASD,STOSB, STOSW, STOSD, LODSB, LODSW, and LODSD. It is required that for each question write only one procedure that does the requested job. Only write the assembly part and avoid using directives. DO NOT USE IRVINE'S LIBRARY. Write a general-purpose program (only assembly code and no procedure call) that inserts a source string to the beginning of a target string. Sufficient space must exist in the target string to accommodate the new characters. Here is a sample call:.datatargetStr BYTE "Stanford",30 DUP(0)sourceStr BYTE "Kamran ",0.codeThe Problem: How do you create a macro that performs two statements.For example we wish to create a cleanup macro:#define CLEAN_RETURN \ close(in_fd);close(out_fd); return;But this code doesn't work if we put it in an if statement:if (done) CLEAN_RETURN;Expanding this we get:if (done) close(in_fd);close(out_fd); return;Let's add a little whitespace for clarity:if (done) close(in_fd);close(out_fd);return;This is not what we intended. One “solution” is to enclose the statementsin {}.#define CLEAN_RETURN \ { close(in_fd);close(out_fd); return; }Now our if statement expands to:if (done) { close(in_fd);close(out_fd); return; };This works. Sort of. The problem is if we try an if / else statement:if (done) CLEAN_RETURN;else not_done_yet();This gives us a syntax error when we try and compile it. Why?Let's look at the expanded code:if (done) { close(in_fd);close(out_fd); return; };else not_done_yet();There's an extra semicolon on the line. This didn't bother us when therewas no else, but now…Programming Exercises As mentioned before, you will be answering all the following questions in one single python file and the person running your file will be prompted to choose which one of these programming exercises they wish to run. A good approach to design this file is to have a main function for each of the questions (main1, main2, etc.). These functions will be called when the user chooses each of the questions (if the user chooses 1, mainl will be executed and so on). You can call different functions in each of your mains if you wish. Below are the programming exercises. The questions are in all levels, some of them are very easy, and some are more challenging. Start with the questions that are easier for you and then try to answer as many questions as possible. For grading, we will be looking at the codes, so even if you have not completely answered a question, make sure you still include your code in the submitted file as you may receive a partial grade for it. Note: all…
- Part 3: JavaScript - Program Outline, Startup Function, and Prompt We are going to use a function that we can consider an entry point into our running JavaScript. Below is an outline of the major elements in our JavaScript file. getRandomInt() function: generate a random integer startup() function: entry point function call to startup() function Below is your startup code: function getRandomInt(min, max) {}function startup() {}startup(); >> Add the above code components to your cis111-07.js JavaScript file below your multiline comment. >> Copy the getRandomInt function code from your previous assignment, or from this Stackoverflow article (Links to an external site.). Remember to add a single line comment above the getRandomInt function that documents the source of the code. Before attempting to use the prompt function in your code, you should try out the function in the console. >> Enter the following into the console to test displaying the prompt dialog. prompt();…1 Goals Use C++ to read data from a text file and create an array of numbers. Use the C++ 'fstream' library functions to open, read and close a text file. You can use the C++ 'iomanip' library to format your output and manage whitespace on your input. Graduate students must create and write the data to a new text file. 2 Your assignment is to create a program that does the following: a. You will need to create a new file (you can do this in the file system – make it plain text) and call it mydata.txt. b. Put a column of numbers in the text file to read later. Pay attention to type – make them all have decimal points. In repl.it, use the numbers in my file. c. Based on the examples in the slides (L3) and the textbook, write a C++ program, include 'iostream' and 'fstream'. You might need 'iomanip'. d. Your program should read the numbers from the file into an array and print the array to the console in reverse order using a for loop. e. Graduate Students must also print the output to a…3. Write a PYTHON function called midpoint quad.py with signature def midpoint quad (func, a, b, N) #quad = midpoint quad ( func, a, b, N) # comments return quad where func indicates the name of a function, a and b are the lower and upper limits of integration, and N is the number of points, not the number of intervals. Test your midpointquad routine by computing f2rdx = 1. Even if you use only one interval (i.e. N = 2) you should get the exact answer because the midpoint rule integrates linear functions exactly. Use your midpoint routine to estimate the integral of the Runge function, f(x) = 1/(1+x2), over the interval [-5, 5]. The exact answer is 2 arctan (5). Fill in the following table, using scientific notation for the error values so you can see the pattern. Midpoint Result Error N h 11 1.0 101 0.1 1001 0.01 10001 0.001 Estimate the order of accuracy (an integer power of h) by examining the behaviour of the error when h is divided by 10. (In previous problems, we have estimated…
- Write a C++ program to call three functions named1. Selection_sort()2. Insertion_sort()3. Merge_sort()Each function will take an array of 10 integers from user within the function andperform the particular sorting task.PYTHON Problem 5 print("Problem 5") Create a function named problem5. O Complete the following chart: 1 2 3 4 5 6 7 ● 8 Create a list of ten random numbers from 1 to 100. Sort the numbers and print them. Delete the lowest number. Delete the highest number. Print the list. index Function Definition (Copy/Paste) Function Call Terminal Output (Screenshot) 14 29 36 48 57 63 79 91 100 valueWrite a program to calculate the net pay of an employee. Input the basic pay, pass basic pay to user defined function PayCalculate(), calculate net pay and return to main function. Calculate the net pay of an employee should be stored in a file along with its complete detail such as emp_no, emp_name, emp-designation and next time if user want to view it can easily view it. House Rent is 45% of basic pay. Medical Allowance is 5% of basic pay if pay is greater than Rs.4000, it is 7% of basic pay if basic pay is less than or equal to Rs.4000. Conveyance Allowance is Rs.200 of basic pay if pay is greater than Rs.4000, it is Rs.435 of basic pay if basic pay is less than or equal to Rs.4000. Net pay is calculated by adding house rent, medical allowance ,conveyance allowance and basic pay.
- Suppose a python program mycode.py contains the following main guard. if name main ": # main function executes only if run as a script main() Select all correct answers that apply. This if statement will call the main () function when mycode.py is run directly in VS Code or from the terminal This if statement will not call the main () function when mycode.py is imported as a module by another program This if statement will not call the main () function when mycode.py is run directly in VS Code or from the terminal This if statement will call the main() function when mycode.py is imported as a module by another program | This if statement will always call the main () function either mycode.py is imported as a module or run as a single program None of these appliesFor this homework assignment you are not allowed to use::MOVSB, MOVSW, MOVSD, CMPSB,CMPSW,CMPD,SCASB, SCASW, SCASD,STOSB, STOSW, STOSD, LODSB, LODSW, and LODSD. It is required that for each question write only one procedure that does the requested job. Only write the assembly part and avoid using directives. DO NOT USE IRVINE'S LIBRARY.Write a general-purpose program (only assembly code and no procedure call) that corrects two extra successive mistakenly entered characters that happened twice in a string. For example, in “Excellent time tooo listen to muuusic” program should remove the extra double oo and uu. Here is a sample call:. datastr1 BYTE “Excellent time tooo listen to muuusic”,0.codeExercise: Write a program to compute the result of dividing two positive integers and the remainder using only addition and subtraction operations (no / or %). The program should execute as in the examples below. Input: two positive integers Output example: Enter two integers: 7 3 7/3 = 2+1/3 Enter two integers: 9 0 9/0 = undefined Enter two integers: 15 3 15/3 = 5 Algorithm: 1. Define a function with two integer input parameters called top and bot. Inside the function: A. Define integers quot and rem, initialized to 0 and top, respectively. B. Build a loop that executes as long as bot is less than or equal to rem with the following: 1) Add 1 to quot 2) subtract bot from rem C. After the loop, write top, bot, quot and rem to the standard output as shown in the example. 2. In main, read the integers to be divided (see example) 3. Call the function to compute and print the division.