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
Give state diagrams of DFAs that recognize the following languages.
k0ka [10]

Answer:

Following is attached the solution of each part step-by-step. I hope it will help you!

Explanation:

6 0
3 years ago
ROE: what does this represent (in plain terms)? In what range would this number typically be? What type of person/position would
LuckyWell [14K]

Answer:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

Explanation:

<em>The ROE in plain terms is called  the return on equity (ROE) is a measure of inflow of profit in business in relation to the equity, also known as assets net worth  or assets of liabilities  ROE is a method  of how l  company generate earnings through investment </em>

<em>The ROE range number can be of any value or percentage example 15% upwards</em>

<em>The type of person or position with roles to play are usually a professional, such as an accountant, bookkeeper, or payroll processor, who completes ROEs on behalf of your clients in the organisation.</em>

4 0
3 years ago
In a flow chart, both the decision structure and the repetition structure use the diamond symbol to represent the condition that
leonid [27]

Answer:

Option A(True) is the correct answer for the above question.

Explanation:

  • The flowchart is used to give the solution of a problem through the diagram in a step by step processor. It helps the user to understand the solution easily. For diagram, it uses many types of symbols that are fixed for every sequence just like An oval symbol represents the start and end of the flowchart which is fixed for every flowchart.
  • So for the decisions in a flowchart, the diamond symbol is used which is to make the decisions and it has two sides-- one is true and the other is false.
  • The decisions are used also to represent the loop structure which is also called the repetition structure because the loop is controlled by the help of decisions so the diamond box is also used for the loop
  • The above question-statement says that the decisions-controlled is used for the loop and for the decisions which are true because it is also described above.
8 0
3 years ago
Matts has finished running some security automation scripts on three newly deployed Linux servers. After applying intrusion dete
gizmo_the_mogwai [7]

Answer: CPU

Explanation:

The management dashboard refers to the tool that's used in the presentation of the vital k management KPIs in a single place, which is efficiently managed in order to make faster and better decisions.

Based on the information given, after the application of intrusion detection, virus, and malware protection on the Linux images, he will notices an increase in CPU on his server management dashboard.

Therefore, the correct option is C.

5 0
2 years ago
Sharing a workbook enables multiple users to access the workbook. What are the benefits of using a shared workbook?
damaskus [11]

Answer:

Some of the benefits of sharing a workbook include:

A. Shared information between students (ie: Mary writes a note about (blank) in the workbook and John reads said note and receives addition information about (blank)).

B. ^adding onto this, discussion on interpretations of a passage (ie: John thinks (blank) means this and Mary thinks (blank) means other thing, through notes they can discuss the meaning of the text.

Hope this helps. =)

8 0
3 years ago
Other questions:
  • Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
    10·2 answers
  • What type of program would use to create a personal budget?
    14·1 answer
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • What information should be included in the closing paragraph of a thank-you letter? a. Mention skills that were omitted during t
    6·2 answers
  • A) A cable that is mainly used in the cable television network
    11·1 answer
  • (10 points) 5.12. Discuss how the following pairs of scheduling criteria conflict in certain settings. a. CPU utilization (effic
    9·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • Ranboo back story? (not homework i just wanna find some ppl who are interested in the same things) ft. the reddie meme
    9·2 answers
  • A desktop computer is a type of mobile device.<br><br> a. true<br> b. false
    5·1 answer
  • Which statement best describes the computers all around us?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!