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
Goryan [66]
3 years ago
11

Write a function named "higher_lower" that takes an int as a parameter and returns "higher" if 14 is greater than the input and

"lower" if 14 is less than the input, and "correct" if 14 is equal to the input.
Computers and Technology
1 answer:
Butoxors [25]3 years ago
4 0

Answer:

Following are the program in python language for the above question:

Explanation:

Program :

def higher_lower(value): #function definition.

   if(value<14): #if condition for 14 is greator than the input.

      return "higher"

   elif(value==14): #else if condition for 14 is equal to the input.

       return "correct"

   else:# else condition.

       return "lower"  

return_value = higher_lower(int(input("Enter the integer value: "))) #take the value from the user and call the function.

print(return_value)# print the returned value.

Output :

  • If the user gives the input as 4, it will prints higher.
  • If the user gives the input 15, it will prints lower.

Code Explanation:

  • The above code is in python language, In which the first line will instruct the user, take the input and pass to the function after converting it into an integer.
  • Then the first line of the function is used to check the value is less than 14 or not.
  • Then the else if condition checks that the value is equal to 14 or not.
  • Then the else condition will be true if the value is greater than 14.
You might be interested in
In this lab, you will create a programmer-defined class and then use it in a Java program. The program should create two Rectang
prohojiy [21]

Answer:

class Rectangle{

//private attributes of length and width

private double givenLength;

private double givenWidth;

// constructor to initialize the length and width

public Rectangle(double length, double width){

 givenLength = length;

 givenWidth = width;

}

// setter method to set the givenlength

public void setGivenLength(double length){

 givenLength = length;

}

// setter method to set the givenWidth

public void setGivenWidth(double width){

 givenWidth = width;

}

// getter method to return the givenLength

public double getGivenLength(){

 return givenLength;

}

// getter method to return the givenWidth

public double getGivenWidth(){

 return givenWidth;

}

// method to calculate area of rectangle using A = L * B

public void calculateArea(){

 System.out.println("The area of the rectangle is: " + getGivenLength() * getGivenWidth());

}

// method to calculate perimeter of rectangle using P = 2 * (L + B)

public void calculatePerimeter(){

 System.out.println("The perimeter of the rectangle is: " + 2 * (getGivenLength() + getGivenWidth()));

}

}

public class MyRectangleClassProgram{

public static void main(String args[]){

//rectangle1 object is created

Rectangle rectangle1 = new Rectangle(10.0, 5.0);

//rectangle2 object is created

Rectangle rectangle2 = new Rectangle(7.0, 3.0);

//area for rectangle1 is calculated

rectangle1.calculateArea();

//perimeter for rectangle1 is calculated

rectangle1.calculatePerimeter();

//area for rectangle2 is calculated

rectangle2.calculateArea();

//perimeter for rectangle2 is calculated

rectangle2.calculatePerimeter();

}

}

Explanation:

Two file is attached: Rectangle.java and MyRectangleClassProgram.java

Download java
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> java </span>
7 0
3 years ago
A major concern about ESP claims is that proponents explain both the positive and negative findings. By explaining the negative
4vir4ik [10]

Answer: Falsifiability

Explanation: Falsifiability is the term that is defined as the evaluation of any particular hypothesis or theory to be proven wrong .This feature gives the access that the theory can be tested and have more accurate claims .

The ESP(Extrasensory perception) theory  can also have feature of being falsifiable because the experiments and test lead to the issue that the negative effects of the theory are not certain which might occur due to simple observation of effects.

5 0
3 years ago
You are attempting to print a document from your workstation to the network printer in your office. The print job failed when yo
Helen [10]

Answer:

An Incident

Explanation:

an incident is an unplanned interruption to a service

6 0
2 years ago
What doyou mean by process model and project model?
vlabodo [156]

Answer:

A process model is a narrative of each type of process. These models consist of processes that are inherently similar and are categorized accordingly; a logical set of actions executed in a comprehensible framework.

A project model is concise and visual, it depicts how a project will be implemented. They are specifically tailored according to each project, describing each of its functional aspects. Decision gates and partitions are important aspects and need to be exemplified throughout the project.

4 0
2 years ago
Gigano Mobiles, a smartphone manufacturer, is going to release its new flagship device next month. The Chief Executive Officer (
ser-zykov [4K]

Answer:

trhrt

Explanation:

rhshnbbfsfhnsdfbhddbh

7 0
3 years ago
Other questions:
  • We have to calculate the percentage of marks obtained in three subjects (each out of 100) by student A and in four subjects (eac
    11·1 answer
  • Peter has recently bought a media player and a digital camera. He wants to buy a memory card for these devices. Which memory dev
    12·2 answers
  • Generate the requested sets using only set builder notation and the provided sets. Some problems may require you to build one or
    15·1 answer
  • What is the function of the capsid? it allows a virus to live independently. it is composed of genetic material. it destroys the
    12·2 answers
  • Do you think boot-camp-style treatment centers can help young. People kick smartphones addictions?
    14·2 answers
  • Cisco has created a proprietary layer 2 protocol used to manage VLAN configuration between switches called:________a. VLAN Confi
    11·1 answer
  • Select the education and qualifications that are most helpful for business analysis careers. Check all that apply
    11·2 answers
  • A company is deploying NAFDs in its office to improve employee productivity when dealing with paperwork. Which of the following
    11·1 answer
  • Consider the following declaration:
    11·1 answer
  • Write a Java program that will be able to generate the sample table below.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!