;the task is to print out the result no matter how many digits ; it should work on Emu8086 ;the code should be in assembly language ; add comments to your code org 100h .data F db 0 num1 db 0 num2 db 0 op db 0 result db 0 msg db 0dh,0ah,"Error" .code mov ax,@data mov ds,ax LL1: call get1 cmp ax,0 je print cmp F,0 je LL1 LL2: call get2 cmp ax,0 je print cmp F,1 je LL2 Solve: cmp op,'+' je addition mov bl, num1 sub bl,num2 mov result,bl jmp printresult addition: mov bl, num1 add bl,num2 mov result,bl printresult: ;Task: add code to print result jmp done print: mov cx,7 mov si,0 screen: mov dl,msg[si] mov ah,2 int 21h inc si loop screen done: ret get1 proc mov ah,1 int 21h cmp al,'+' je L4 cmp al,'-' je L5 sub al,30h cmp al,0 jb L2 cmp al,9 ja L2 mov cx,10 mov bh,0 L3: add bh,num1 loop L3 add bh,al mov num1,bh ret L4: mov op,'+' mov F,1 ret L5: mov op,'-' mov F,1 ret L2: mov ax,0 ret endp get2 proc mov ah,1 int 21h cmp al,'=' je L41 sub al,30h cmp al,0 jb L21 cmp al,9 ja L21 mov cx,10 mov bh,0 L31: add bh,num2 loop L31 add bh,al mov num2,bh ret L41: mov F,2 ret L21: mov ax,0 ret endp
In: Computer Science
Solve the following Double Linked List sort: use int. array = {8, 3, 12, 9, 6, 2} and provide visualization development to the solution.
In: Computer Science
Compare and Contrast PDLC (Program Development Life Cycle) and SDLC (System Development Life Cycle) as well as Application Programmers and Web Programmers and also Application and Website. Please answer. Thank you
In: Computer Science
Write a boolean function named isMember that takes two
arguments: an array of type
char and a value. It should return true if the value is found in
the array, or false if the
value is not found in the array.
PLEASE WRITE FULL PROGRAM IN C++ AND USE RECURSION AND DO NOT USE LOOPS
In: Computer Science
IN C++
Rather than clutter up the source code with blocks of essentially the same calculations or blocks of code controlled by IF then…else logic, we can move these blocks of code into one location that can be called from anywhere and anytime during the application’s execution, the “function”.
Functions can be passed “arguments”, one or more data values and return zero or one value to the calling routine Functions can call other separate functions or even themselves recursively.
If the divisor, n2, is zero, display a message, “Cannot divide by zero” in the function, default n2 to 1, return the dividend and display it in the main.
Example Output:
1 of 2 - Enter First Number: 12.34
2 of 2 - Enter Second Number: 8.4
1 - Add (12.34 + 8.4)
2 - Subtract (12.34 - 8.4)
3 - Multiplication (12.34 X 8.4)
4 - Divide (12.34 / 8.4)
5 – ALL
6 – Change Values
7 - Quit
Enter an Option (1 to 7): 3
12.34 X 8.4 = 103.656
Hit Any Key to continue...
1 - Add (2.4 + -3.4)
2 - Subtract (2.4 - -3.4)
3 - Multiplication (2.4 X -3.4)
4 - Divide (2.4 / -3.4)
5 - ALL
6 - Quit
Enter an Option (1 to 7): 5
2.4 + -3.4 = -1
2.4 - -3.4 = 5.8
-3.4 - 2.4 = -5.8
2.4 X -3.4 = -8.16
2.4 / -3.4 = -0.705882
Hit Any Key to continue...
In: Computer Science
Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes. How would the same concepts apply to data structures and how we tend to define and think of ADTs?
In: Computer Science
develop the Binary search with swap count: Use sorted data from insertion sort (part A) Permutations, Insertion Sort – implement algorithms Permutations (Johnson Trotter): {1, 2, 3, 4, 5}; Insertion Sort: {45, 24, 16, 92, 71, 69, 28} develop count of # data “insertions” and develop # of key compares against the following: 16, 77, 24, 92, 44
In: Computer Science
Must be in C#
Create an application that determines the total due on purchases including sales tax and shipping charges. Allow the user to input any number of item prices. Use a do-while loop such that in the first iteration, you ask the user to enter the price for an item. Keep a counter variable to track the number of items the user has entered by incrementing its value at every iteration. As the last statement for the do{} construct, ask the user if they wish to enter more item prices. Re-execute the do-while loop if the user enters “yes”.
Shipping charges are determined based on the number of items purchased using the following chart (if necessary, use if/else statements for making this decision).
Fewer than 3 items $3.50
3 to 6 items $5.00
7 to 10 items $7.00
11 to 15 items $9.00
More than 15 items $10.00
In addition to the above, if the total purchase (before adding sales tax) is $100.00 or more, then provide free shipping. If the user is $10.00 or less away from reaching a total purchase of $100.00, then display a message prompting the user that they are “that many” dollars away from free shipping. This should be implemented in a way that allows the user to continue entering items if they are close to free shipping.
Sales tax of 7.75% is charged against the total purchase. Display an itemized summary to the user with the following information. Total purchase charge, number of items purchased, sales tax amount, shipping charge, and the grand total. Use proper format specifiers if necessary.
In: Computer Science
LastNameFirstNameWeek4.java Purpose: This program will take an order on a local beverage parlor. This beverage parlor offers a limited set of drinks by a glass. Any day of the week (except Mondays when they are closed) they offer three possible alternatives: “Juice”, “Milk”, or “Soda”. Additionally only Fridays, Saturdays and Sundays, the beverage parlor serve also “Beer” and “Wine”. The program should ask the users for her/his beverage choices and produce a summary of the order in the end. To do so, the program will initially get the name of a day in a week (Monday, Tuesday, Wednesday, etc.) from the user. If the day is Monday, the program should print “Sorry. This establishment is closed on Mondays. Your order includes nothing.” And the program will stop. If the day is Tuesday, Wednesday or Thursday, the program will ask the user: “Which beverages would you like to drink?: juice, milk, or soda?" and receive the answer. If the day is Friday, Saturday or Sunday, the program would ask to the user: "Which beverages would you like to drink?: juice, milk, soda, beer, or wine?" and get an answer. After every new beverage order, the program will ask if the user wants to order something else. If the user wants to order something else, the requesting process is repeated within a loop, but the day given at the beginning of the session will remain. Every time the user selects one of the beverages, a corresponding counter for each of these meals should be updated (adding 1 to it). When the user indicates s/he does not want to order more, the program will print the total order with the correct count of each beverage that was ordered and stop. If a beverage was not ordered, its name must not appear in the final list. Notice that responses from the user may be entered in any combination of uppercase or lowercase letters. The best will be to read all responses using the next() method of the Scanner, convert these responses to uppercase letters with the toUpperCase() method of the String class, and use this uppercase version of the response to do comparisons with the choices (also in upper case). Your output should be similar to the samples shown below. Do not change the order of the questions neither the messages that are displayed. Sample 1 Which day are you visiting the Restaurant (Monday, Tuesday, Wednesday, etc.)?Tuesday Which beverages would you like to drink?: juice, milk, or soda?milk Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, or soda?soda Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, or soda?juice Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, or soda?water This is an Invalid order. Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, or soda?milk Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, or soda?soda Do you want to add anything else to the order? (y/n) n Your order includes: 1 juice(s) 2 milk(s) 2 soda(s) Sample 2 Which day are you visiting the Restaurant (Monday, Tuesday, Wednesday, etc.)?Sunday Which beverages would you like to drink?: juice, milk, soda, beer, or wine?beer Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?wine Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?soda Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?beer Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?wine Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?milk Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?water This is an Invalid order. Do you want to add anything else to the order? (y/n) y Which beverages would you like to drink?: juice, milk, soda, beer, or wine?beer Do you want to add anything else to the order? (y/n) n Your order includes: 1 milk(s) 1 soda(s) 3 beer(s) 2 wine(s) Sample 3 Which day are you visiting the Restaurant (Monday, Tuesday, Wednesday, etc.)?Monday Sorry. This establishment is closed on Mondays Your order includes nothing. Sample 4 Which day are you visiting the Restaurant (Monday, Tuesday, Wednesday, etc.)?asasdadads Invalid day. Your order includes nothing.
In: Computer Science
Give a brief review on the evolution in computer generations. A common application of the fifth generation is the Expert system. Describe how it can be applied in the medical field.
In: Computer Science
Difference between array and list? Explain in your own words.
In: Computer Science
Difference between stacks and queues? Explain in your own words.
In: Computer Science
First, the Python program prompts user to enter user information (name, email, and phone number). Then it displays a menu called “Fish Information” that has the following fish type:
1. Cat Fish 2. Red Fish 3. Any other fish
Let user choose the fish type that he/she got and input the length of the fish. Then the program will determine what should be done with this particular fish. Based on the following criteria:
Criteria: Length:
FISHTYPE - Cat Fish <10: "throw back" >=10 through <=25: "keep" >25: "tag"
FISHTYPE – Red Fish <15: "throw back" >=15 through <=30: "keep" >30: "tag"
FISHTYPE – any other fish <10: "throw back" >=20: "keep"
Let the user to enter as many times they want using loops and save all the input data using List.
At the end, the program will display the user’s information and all the fish information.
In: Computer Science
A company has three salespeople (1 to 3) who sell five different products (1 to 5). Once a day, each saleperson passes in a slip for each type of product sold. Each slip contains the following: a) The salesperson number b) The product number c) The total dollar value of that product sold that day Thus, each salesperson passes in between 0 and 5 sales slips per day. Assume that the information from all of the slips for last month is available. You are required to write a C# program that will read all the information for last month’s sales and summarize the total sales by salesperson and by product. All sales data should be stored in a two-dimensional array sales. After processing all the information for last month, display the results in tabular format, with each column representing a particular salesperson and each row representing a particular product. Cross-total each row to get the total sales of each product for last month. Cross-total each column to get the total sales by salesperson for last month. You tabular output should include these cross-totals to the right of the totaled rows and below the totaled columns.
A sample output is as follows:
Enter sales person number (-1 to end): 1
Enter product number: 100
Enter sales amount: 1000
Invalid input!
Enter sales person number (-1 to end): 1
Enter product number: 1
Enter sales amount: 100
Enter sales person number (-1 to end): 1
Enter product number: 3
Enter sales amount: 200
Enter sales person number (-1 to end): 1
Enter product number: 5
Enter sales amount: 300
Enter sales person number (-1 to end): 2
Enter product number: 2
Enter sales amount: 400
Enter sales person number (-1 to end): 2
Enter product number: 4
Enter sales amount: 500
Enter sales person number (-1 to end): 3
Enter product number: 1
Enter sales amount: 600
Enter sales person number (-1 to end): 3
Enter product number: 2
Enter sales amount: 700
Enter sales person number (-1 to end): 3
Enter product number: 3
Enter sales amount: 800
Enter sales person number (-1 to end): -1
Product Salesperson 1 Salesperson 2 Salesperson 3 Total
1 $100.00 $0.00 $600.00 $700.00
2 $0.00 $400.00 $700.00 $1,100.00
3 $200.00 $0.00 $800.00 $1,000.00
4 $0.00 $500.00 $0.00 $500.00
5 $300.00 $0.00 $0.00 $300.00
Total $600.00 $900.00 $2,100.00
In: Computer Science
What structure would you select if a customer came and said, I want to have a program where I would be updating the data (I would be putting more data in) and later I want to retrieve in their initial order (I want to get them out in the order they were inserted). What would the most sufficient structure to do that? Explain in your own words.
In: Computer Science