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
4vir4ik [10]
3 years ago
7

wo non-negative integers x and y are equal if either: Both are 0, or x-1 and y-1 are equal Write a function named equals that re

cursively determines whether two parameters (both containing integer values) are equal and returns True or False.
Computers and Technology
1 answer:
Mrac [35]3 years ago
3 0

Answer:

Using python programming language.

Explanation:

#to define the function write as below

def equal():

    #to get the two integers from the user

#The user is asked for input in the code below.

x = int(input("Enter the value for X"))

y= int(input("Enter the value for y"))

if x==0 and y==0:

    print("both numbers are ", "0")

elif: x==1 and y==1:  #This test if both x and y are 1

    print("true")

elif: x==y: #this line test if both values are equal

    print("true")

else:

    print("False")

equal()  #end of the function

You might be interested in
Students who finish their homework after school are meeting a. intrapersonal and short-term goals b. normative and short-term go
3241004551 [841]

Answer: a. intrapersonal and short-term goals

Explanation:

Intrapersonal goals are those that we set for ourselves in our minds to accomplish. The students that are finishing their homework after school most probably set that goal in their minds and so meeting it would mean meeting their intrapersonal goals.

Homework is not a long term project but rather a short one that is usually meant to be completed within days. Completing it is therefore a short term goal.

The students who finish their homework after school are therefore accomplishing both their intrapersonal and short-term goals.

6 0
3 years ago
Read 2 more answers
Which of these is NOT one of the three parts to the event-handling mechanism in Java?
Tamiku [17]

Answer:Event action

Explanation:Event-handling mechanism is the technique through which the  the management of any event is Java is controlled and coordinated. The event handler code is used for the managing of the mechanism and execution.

Event action is not a part of the event handling mechanism in the java because no such step comes under the code of event handler and rest other option are present in java event handler.

5 0
2 years ago
Simple geometry can compute the height of an object from the the object's shadow length and shadow angle using the formula: tan(
agasfer [191]

Answer:

The program to this question can be given as:

Program:

#include <stdio.h>  //include header files

#include<math.h>

int main()    //main method  

{        

   double treeHeight = 0.0;         //declare variables

and assign value

   double shadowLength = 0.0;  

   double angleElevation =  0.11693706;

   // (0.11693706 radians = 6.7 degrees) convert number into angle.      

   shadowLength = 17.5;  

treeHeight = shadowLength * tan(angleElevation);   //convert number into angle

   printf("Tree height: %lf\n", treeHeight);   //print value.

   return 0;  

}

Output:

Tree height: 2.055778

Explanation:

In the above C language program firstly we include the headers. In this header file, we include a (math.h) header file this file helps to use the math function. Then we declare the main method in the main method we declare the variable that is given in the question that are treeHeight, shadowLength , angleElevation. All the variable datatype is double because it stores the floating-point value. Then we apply the formula that is  treeHeight = shadowLength * tan(angleElevation). In this formula, the treeHeight variable holds the value. Then we print the variable value for print the double value we use the lf(that is long float).

7 0
3 years ago
The _______ is a small program run by a computer when first powered on. its primary function is to stabilize the machine and dev
tigry1 [53]
Hello <span>TheCelloAlex1645 </span>

Answer: <span>The BIOS is a small program run by a computer when first powered on. its primary function is to stabilize the machine and devices on the motherboard so that the operating system can be loaded and take control of the computer.


Hope this helps
-Chris</span>
3 0
3 years ago
Phoebe has to give a presentation about recycling. Where should she look while presenting?
Naddika [18.5K]
Well, I think that maybe the answer is B or C. She shouldn't only look at her presentation while she is presenting it, that doesn't look professional, and you want to look at the people you are talking to.
6 0
3 years ago
Read 2 more answers
Other questions:
  • How do type declaration statements for simple variables affect the readability of a language, considering that some languages do
    10·1 answer
  • Tower defense is included under which genre of game
    15·2 answers
  • The Freemont Automobile Factory has discovered that the longer a worker has been on the job, the more parts the worker can produ
    11·1 answer
  • What is being measured using kbps, mbps, and gbps?
    7·1 answer
  • If userA wants to send a secure message to userB using an asymmetric cryptographic algorithm, which key does userB use to decryp
    11·1 answer
  • ______________ is only one of the marketing mix tools that acompany uses to achieve its marketing objectives.
    7·1 answer
  • What type of hard drive is in original xbox?
    6·1 answer
  • What is a Slide Master? A. the placeholder used to insert objects B. the sequence of slides in a presentation C. the default des
    14·1 answer
  • What best determines whether a borrower's interest rate on an adjustable rato loan goes up or down?
    13·2 answers
  • TO Cloud
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!