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]
3 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]3 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]3 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
When you are printing handouts, which of these can you do?
erik [133]

Answer:

all of these

Explanation:

As we know that, at the time of presentation we need to print copy of handouts for the audience of the presentation.

All three steps are necessary because.

A. There may be huge number of audience, so to save paper we place more than one slides per page

B. The flow of presentation must be same on handouts as on your presentation slides.

C. There should be a copy of handout for every person who is sitting in your presentation

5 0
3 years ago
What is property in educational technology
Maslowich
1. It is based on scientific and technological advancements.
2. It is more a practical discipline and less a theoretical one.
3. It is a fast growing modern discipline.
4. It makes use of the research findings of psychology, sociology, engineering, sciences and social psychology etc., and applies the same to the field of education.
5. It brings pupils, teachers and technical means together in an effective way.
6. It is the science of techniques and methods. It locates the problems in the field of education, remedies them and ultimately aims at improving the education system.
7. It is bound to improve the teacher, the learner and the teaching learning process.
3 0
3 years ago
Which of the following items is an example of a common device for digital distribution?
docker41 [41]

Answer:

cell phone and television

Explanation:

they have computers inside of them so they are digital

4 0
3 years ago
Setting a starting value for a variable is called _____________.
Dmitry_Shevchenko [17]

Setting a starting value for a variable is called:

  • Initializing
<h3></h3><h3>What is Initializing?</h3>

Initializing is the act of assigning a value to a given piece of information classified as a variable.

Most times in programming, the starting value of 0 is often assigned to the first value. So, the correct answer is, Initializing.

Learn more about initializing here:

brainly.com/question/27230187

#SPJ11

6 0
2 years ago
Read 2 more answers
Exercise 1-12 <br> This information is for Windsor, Inc. For the year ended December 31, 2017
Agata [3.3K]

Answer:

Please check the attachment.

Explanation:

Net change in cash, is the net increase in the cash from previous year which is 11900 here, and since the cash in hand is 17200, the net increment is 17200-11900 = 5300 from past year.

And the Cash forecast depends upon cash in hand, and which is 17200, and this is while disregarding future profit.

Rest of the details are in the file attached.

Download xlsx
8 0
3 years ago
Other questions:
  • Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
    5·1 answer
  • Ryan is the operations manager for a national financial company. His company is in the process of creating a customer handbook.
    13·1 answer
  • After merging two arrays is complete you need to
    11·1 answer
  • What is the differnce between ''P4 and 4P''
    12·2 answers
  • Software that helps users to communicate with family, friends and business colleagues by posting personal information, status up
    13·2 answers
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • Why does every image on brainly look like this too me?? it started today
    15·2 answers
  • Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout &lt;&lt; fixed
    7·1 answer
  • Write the functions of F1 to F12 on the keyboard​
    5·2 answers
  • There is a surplus of scientific researchers for a vaccine. This means the demand for this career has
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!