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
application that will perform a lot of overwrites and deletes of data and requires the latest information to be available anytim
o-na [289]

Answer:

RDS.

Explanation:

A corporation has implemented a software that conducts the number of information overwriting and deleting, which allows the newest details to be accessible whenever the information is examined. As a Software Engineer, they suggest RDS database technologies.

It is an AWS supported controlled SQL DB service that also reinforces the array type DB for the purpose to contain and maintain the information.

3 0
3 years ago
How would you maximize the use of outsourced programmers?
Lerok [7]

Answer:

the answer is: release them when the project is complete

Explanation:

8 0
2 years ago
Server virtualization in windows server 2012 r2 is based on a module called the
alexgriva [62]
<span>Server virtualization in windows server 2012 r2 is based on a module called the</span> hypervisor.
3 0
3 years ago
What happens when a user updates a record after a developer creates a Workflow Rule declaratively that updates a field on an obj
Sindrei [870]

Answer:

d. The trigger is fired more than once.

Explanation:

What would happen in this situation is that the  trigger would be fired more than once. This is because the trigger will be fired when the user updates the record. It will also be fired when the process builder is run.

If the trigger fires more than once, this can be problematic for the developer. Therefore, it is better if the trigger fires just once, as this is the time when the present changes can be placed.

5 0
3 years ago
Which of the following are some popular debugging techniques?
topjm [15]

Answer:

a fix any syntax bugs. I looked it up on the internet so you should be good good luck on your test

8 0
2 years ago
Other questions:
  • A security administrator is required to submit a new csr to a ca. what is the first step?
    11·1 answer
  • Create a query that will list all technician names, employee numbers, and year hired in order by year hired (Newest to Oldest).
    5·1 answer
  • What is AI and its necessary types?
    6·1 answer
  • A troubleshooter's ability to design and test hypotheses in order to solve a technology problem is based on ____.
    14·1 answer
  • When a user utilizes another computer to communicate with a third party, with the result that the third party cannot recognize t
    8·1 answer
  • ) Doyou know applets and Java Beans in Java? Please briefly state eachone with an example.
    10·1 answer
  • Use the pattern of syntax for Linux commands to view messages generated by the kernel during boot, and display the location of t
    8·1 answer
  • 50 POINTS!!!
    14·1 answer
  • Differentiate between perfect and imperfect market​
    14·1 answer
  • A type of attack where the adversary intercepts network packets, modifies them, and inserts them back into the network is called
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!