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
sesenic [268]
2 years ago
10

Write a Bare Bones program that takes as input two variables X and Y. (Again, assume these values are set before your program be

gins to execute.) Your program should place a 0 in the variable Z if the variable X is less than or equal to Y, and your program should place a 1 in the variable Z if the variable X is greater than Y.
Computers and Technology
2 answers:
Sauron [17]2 years ago
5 0

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter first number");

       int X = in.nextInt();

       System.out.println("Enter second number");

       int Y = in.nextInt();

       int Z;

       if(X <= Y){

           Z = 0;

       }

       else if(X >= Y){

           Z = 1;

       }

   }

}

Explanation:

  • The program is implemented in Java
  • In order to set the values for X and Y, The Scanner class is used to receive and store the values in the variables (Although the questions says you should assume these values are set)
  • The if conditional statement is used to assign values (either 0 or 1) to variable Z as required by the question.
ratelena [41]2 years ago
3 0

Answer:

#The program sets Z to 0 if the X <= Y. otherwise sets Z to 1 , if the X > Y.

clear Z; # sets Z to 0

clear U; # sets U to 0

clear V; # sets v to 0

clear T; # sets T to 0

while Y not 0 # repeat until Y times

# process to decrement Y by 1

while Y not 0

incr U;

decr Y;

decr U;

while U not 0

incr Y;

decr U;

#process to decrement X by 1

while X not 0

incr V

decr X;

while V not 0

decr V;

while V not 0

incr T;

decr V;

while T not 0

incr X

decr T

#end of main while loop

#after running the main while loop, X will be positive and non - zero number, # #if X > Y. otherwise X and Y will be zero.

#process to increment Z by 1, if X is positive and non - zero number

while X not 0

while X not 0

decr X;

incr Z;

#end of while

Explanation:

The program is totakes in as input two variables X and Y.

The main function of the program is to return or place a 0 in the variable Z if the variable X is less than or equal to Y, and place a 1 in the variable Z if the variable X is greater than Y.

When these conditions are met, end program.

You might be interested in
This network passes data most of the time, but sometimes for reasons unknown to the junior network engineer in charge of monitor
Kaylis [27]

Answer:

The characteristic that is violated is Availability.

Explanation:

  • The network is passing data at mostly, it means performance is good. Junior network engineer is doing his job well then there is minimum chance of network failure or lack of manageability.
  • The scalability; range of computing capabilties can be managed by the engineer.
  • However, sometimes the core router might get crashed due to unavailability of the network that is not under the control of the engineer.

8 0
3 years ago
Collins and quillian explained the results of priming experiments by introducing the concept of _____ into their network model.
insens350 [35]
<span>Spreading Activation This is a model of working memory, which can be otherwise called here and now memory in lay man's term, that tries to clarify how the mind forms related thoughts, particularly semantic or verbal ideas. The spreading enactment show is one way intellectual clinicians clarify the preparing impact, which is the noticeable wonder that a man can all the more rapidly review data about a subject once a related idea has been presented. As indicated by this model, semantic long haul memory comprises of a huge, interrelated system of ideas. At the point when a man is given any idea, the ideas most firmly associated with it are initiated in that individual's psyche, getting ready or "preparing" him or her to review data identified with any of them</span>
4 0
3 years ago
A government agency is getting rid of older workstations. The agency will donate these workstations, along with other excess com
Basile [38]

Answer:

The answer is "Using the DoD 5220.22-M method and  Degauss media with a magnet".

Explanation:

The "DoD Standard" is a term used during the data sanitizing industry and refers to DoD 5220.22-M. The simplest ways are being used to help eliminate the previously stored data, by deleting hard disc storage facilities with the same data wherever that used a sequence of all zeros.

The sparging eliminates statistics to entirely delete the gravitational flux from electronic media. Hard drives as well as other data storage devices, for example, computer tapes, retain magnetic data. It could no longer be seen as storage after a disk is degaussed.

6 0
2 years ago
Is a ROUTER required for Internet Connectivity ?<br> Yes<br> No
Kazeer [188]

no it is not but u will need a ethernet cord

5 0
2 years ago
Consider the following line of code: if (x &lt; 12 || (r – 3 &gt; 12)) Write three valid mutants of this ground string (based on
Nata [24]

Answer:

See explaination

Explanation:

Mutation Testing:

Mutation Testing is a type of software testing where we mutate (change) certain statements in the source code and check if the test cases are able to find the errors. It is a type of White Box Testing which is mainly used for Unit Testing. The changes in the mutant program are kept extremely small, so it does not affect the overall objective of the program.

We say a mutant is valid if it is syntactically correct. We say a mutant is useful if, in addition to being valid, its behavior differs from the behavior of the original program for no more than a small subset of program test cases.

VALID MUTANTS

1. if (x < 12 && (r – 3 > 12)) LOR

2. if (x < 12 || (r – 3 < 12)) ROR

3. if (x < 12 || (x – 3 < 12)) IVR

INVALID MUTANTS

1. if (x < 12 ||(r – 3 > 12) UPR

2. if (x < 12 (r – 3 < 12)) MLO

3. (x < 12 || (x – 3 < 12)) CSM

Note:

LOR: LOGICAL OPERATOR REPLACEMENT

ROR: RELATIONAL OPERATOR REPLACEMENT

IVR: INVALID VARIABLE REPLACEMENT

UPR: UNBALENCED PARANTHISIS REPLACEMENT

MLO: MISSING LOGICAL OPERATOR REPLACEMENT

CSM: CONTROL OPERATOR MISSING REPLACEMEN

4 0
3 years ago
Other questions:
  • Privileged instructions 1) generate an interrupt so they can execute before non-privileged instructions. 2) are valid only when
    5·1 answer
  • To gain one pound of fat, how many extra calories would you need to consume?
    12·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
  • Properly defined the primary part of a CPU​
    5·1 answer
  • In which type of land contract does the seller earn interest on the difference between what the seller owes on an existing loan
    14·1 answer
  • Which of the following best define grit
    13·1 answer
  • If you want to learn more about a command, point to its button and wait for the ____ to appear.
    13·1 answer
  • )What is proceduralabstraction, and why is it important inComputer Science
    14·1 answer
  • Which type of approach grew out of the development of computers, where even complex behavior such as learning, remembering, cate
    5·1 answer
  • Where are my files shortcut in documents folder.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!