1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
juin [17]
3 years ago
6

Assume that the variables v, w, x, y, and z are stored in memory locations 200, 201, 202, 203, and 204, respectively.

Computers and Technology
1 answer:
d1i1m1o1n [39]3 years ago
8 0

Answer and Explanation:

A. To translate the above algorithm to machine language, we first assign have to perform the first part of the operation which is x-y and set the value to the v variable. The x, y and v values are stored in memory location 202, 203 and 200 respectively.

The z value in the memory location 204 is then added to the v value in memory location 200. The first code sequence is stored in memory location 50 and the second code sequence to achieve x+y-z stored in v is stored in memory location 51(as asummed in question)

B. In the second algorithm, we add value in w which is in memory location 201 to value in x in memory location 202 and assign the result to v in memory location 200. The same is done for y+z in memory locations 203 and 204 respectively with result stored in w. We then subtract the values in v in memory location 200 from w and assign the value to v in memory location 200

C. in the first memory location 50, the code sequence v compared to w is stored. If v(stored in memory location 201)is greater than or equal to w(in memory location 202), it moves to address 54 and assigns the y value to x in memory locations 203 and 202 respectively else it assigns z valuein memory 204 to x value in 202 and jumps to next instruction

D. In this algorithm, it first compares y and z in memory locations 203 and 204 respectively in the first code sequence memory 50. In 51, it checks to see if the condition is satisfied and if it is, it jumps to address 53 and adds y and w in their various memory locations and stores it in memory 203 in y otherwise it moves to address 57. Now to get y+w+z, It then adds y +w in memory location 203 in y to z in memory location 204 and then stores the result in y. Subsequently it adds the z value to v and stores the result in v and moves to address 50 where it compares a new set of value as in a loop in the algorithm which continues till the "while" condition can no longer be satisfied.

You might be interested in
In C complete the following:
Crazy boy [7]

Answer:

#include <stdio.h>

void printValues ( unsigned char *ptr, int count) // count is no of cells

{

 for(int i=0; i<count; i++) {

   printf("%d ", ptr[i]);

 }

}

int main ( )

{

 unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;

 printValues( data, sizeof(data)/sizeof(data[0]) );

}

Explanation:

Remember that the sizeof() mechanism fails if a pointer to the data is passed to a function. That's why the count variable is needed in the first place.

3 0
3 years ago
Complete the do-while loop to output every number form 0 to countLimit using printVal. Assume the user will only input a positiv
elena-s [515]

Answer:

PART ONE

  1. import java.util.Scanner;
  2. public class CountToLimit {
  3.    public static void main(String[] args) {
  4.        Scanner scnr = new Scanner(System.in);
  5.        int countLimit = 0;
  6.        int printVal = 0;
  7.        // Get user input
  8.        System.out.println("Enter Count Limit");
  9.        countLimit = scnr.nextInt();
  10.        do {
  11.            System.out.print(printVal + " ");
  12.            printVal = printVal + 1;
  13.        } while ( printVal<=countLimit );
  14.        System.out.println("");
  15.        return;
  16.    }
  17. }

PART TWO

  1. import java.util.Scanner;
  2. public class NumberPrompt {
  3.    public static void main (String [] args) {
  4.        Scanner scnr = new Scanner(System.in);
  5.        System.out.print("Your number < 100: ");
  6.       int  userInput = scnr.nextInt();
  7.      do {
  8.           System.out.print("Your number < 100: ");
  9.           userInput = scnr.nextInt();
  10.       }while (userInput>=100);
  11.        System.out.println("Your number < 100 is: " + userInput);
  12.        return;
  13.    }
  14. }

Explanation:

In Part one of the question, The condition for the do...while loop had to be stated this is stated on line 14

In part 2, A do....while loop that will repeatedly prompt user to enter a number less than 100 is created. from line 7 to line 10

7 0
2 years ago
Suppose you are using a Mac to read your e-mail messages, and you receive an
Gekata [30.6K]

Answer:

D

Explanation:

4 0
3 years ago
Read 2 more answers
what's the best mouse for fast clicking ? I play a lot of fps and a lot of pvp games I need a mouse that I can click fast with a
kondaur [170]
Alenware hp dell logtech, and i know others
7 0
3 years ago
Two different applications that make use of the barcode
jeyben [28]
Library books and items bought in stores are 2 different applications that make use of barcodes.
8 0
3 years ago
Other questions:
  • What is a critique of the feature detector model of object recognition?​?
    8·1 answer
  • A directional antenna issues wireless signals along a(n) ____ direction.
    9·1 answer
  • You install an M.2 SSD card in an M.2 slot on a motherboard. When you boot up your system, you discover the DVD drive no longer
    15·1 answer
  • Which of the following is designed to help an organization continue to operate during and after a disruption?
    12·1 answer
  • What is the maximum number of communication paths for a team of twenty people?
    5·1 answer
  • The frequencies licensed by telecommunication firms to provide wireless service is known as _____.
    13·1 answer
  • What does the following code segment do?
    13·1 answer
  • Your secondary servers have not been able to contact your primary server to synchronize information. How long will the secondary
    12·1 answer
  • Please help I’ll give 10 points
    6·1 answer
  • Tom wants to find a number so that the sum of the digits of a two-digit number is 7. When reversing the digits, the number shoul
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!