Related questions
Create an HLA Assembly language program that prompts for three integers from the user. Create and call a function that determines if the sum of all three values is even and then sets DX to one if the sum is even; otherwise, set DX to zero. In order to receive full credit, after returning back to the caller, your function should not change the value of any register other than DX. Implement the function whose signature is:
procedure sumIsEven( value1 : int8; value2 : int8; value3 : int8 ); @nodisplay; @noframe;
Here are some example program dialogues to guide your efforts:
Provide a value: 3
Provide a value: 8
Provide a value: 12
sumIsEven returned false!
Provide a value: 8
Provide a value: 3
Provide a value: 3
sumIsEven returned true!
Step by stepSolved in 5 steps
- I am having some issues with my code when I run it. The instruction for the hw was as follows: For this C++ hw Create a function called time2Greeting. It takes a time (in military time) and returns a string with the right greeting. Good Morning 4AM to before noon. Good Afternoon Noon to before 5PM Good Evening from 5PM to 11PM What are you doing up at this hour? between 11 and 4AM For illegal values, say: That is not a valid time. Example: What is your name? John What time is it? 1315 Good afternoon, John. My code: #include <iostream> #include <string> using namespace std; //method to compute the greeting at a certain time string time2greeting(int time) { //create a string to hold greatings string greeting; //if time is between 11PM and 4AM if (time > 2259 || time < 400) //set the greating " What are you doing up," greeting = "What are you doing up, "; //if time is between from 5PM to 11PM else if (time > 1659) //set the greeting "good evening" greeting =...arrow_forwardcode in python program please Write a function that takes one integer parameter, makes sure it is an integer, prints sum of every two digits and return the sum of digits from the number entered by the user up to 1, using recursion.Sample input: 4 Sample output: 4+たす3 =わ 77+たす2 =わ 99+たす1 =わ 10arrow_forwardWrite a Python programs to do frequency counting of the sum of two dice. Your function should accept an integer nn parameter to run nn trials (i.e., multiple rollings of the two dice); You can use the Python function randrange(1, 7) to simulate the roll of one die; After running the nn trials, your function should return the sum of two dice that occurs most frequently. Please implement the following: sim_dice(n) Estimate the most probable sum of rolling two regular 6-faced dice repeatedly, using frequency counting. The function definition has already been started, below. It has one parameter, the number of rolls to perform on the two dice that you will frequency count. The return value will be the most common sum, and the frequency of that sum (e.g. the dice sum of 7 happens 142 times). main() The only purpose of this function is to call sim_dice(1000) and print the returned value of the most frequently occurring sum. You are required to use this starter code as part...arrow_forward
- Using python programming a screenshot will be helpful #2arrow_forwardPlease use python idle program and take a screenshot of the executable codearrow_forwardWrite a function print_shampoo_instructions with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N: Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.". Sample output with input: 2 1: Lather and rinse. 2: Lather and rinse. Done. Hint: Define and use a loop variable. Learn how our autograder works 461710.3116374.qx3zqy7 1 234 3 | Your solution goes here ITT 5 user_cycles = int(input()) 6 print_shampoo_instructions(user_cycles) 1 pas All t pasarrow_forward
- Using Pythonarrow_forwardFirst write a function f to generate and return a random number between 0 to 100 In the main function, you keep calling function f until the returned value is less than 10 Then you should print out how many times the function f has been called. Note that every time f will only return a single random number, and the declaration of f is as follows: int f() For instance, if f returns 23, 89, 10, 1, then your program should print 4 on the screen. C++ language Hint 1. You can implement the function using different methods, like the static variable Hint 2. You can use the modular operator to shrink the generated random value, i.e., random() % 101 will guarantee the result is between 0 and 100.arrow_forwardMy Birthday Function Write a well-documented Python program, hmwk4Q4.py, that simulates a single trial of a person walking into a room on N people and determining if their birthday matches any of the other N people in the room. Design a function myBirthday (N) that returns True if a match is found, or False if no match is found. Import the python random number module into your program. On a single trial, with a user input 200 people, you may not find someone with your birthday. If you manually rerun the simulation ten times, your code, however, should see that approximately four (4.22 exactly) times there is a match to your birthday.arrow_forward
- Define a function named display_banner() which prints a banner as shown in the example below: For example: Test Result display_banner() WORD GUESSING GAME Answer: (penalty regime: 0 %) 1 Precheck Checkarrow_forwardWrite a function print_shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than 4, print "Too many.". Else, print "N : Lather and rinse." num_cycles times, where N is the cycle number, followed by "Done.".Sample output with input: 2 1: Lather and rinse. 2: Lather and rinse. Done. Hint: Define and use a loop variable. I am getting the correct output,but i can't get rid of the white space between the number and the ':' 1 : Lather and rinse. 2 : Lather and rinse. Done.arrow_forwardPlease answer. This is pythonarrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education