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
Thepotemich [5.8K]
3 years ago
13

The following program is supposed to display a message indicating if the integer entered by the user is even or odd. What is wro

ng with the program?
num = int(input("Enter an integer: "))
print("The integer is", evenOdd(num))
def evenOdd(n) :
if n % 2 == 0 :
return "even"
return "odd"
A. The function definition must appear before the function is called.
B. The input and print statements must reside in a function named main.
C. The variable num and the parameter variable n must have the same name.
D. An else clause must be added to the if statement.
Computers and Technology
1 answer:
Lapatulllka [165]3 years ago
6 0

Answer:

A. The function definition must appear before the function is called

Explanation:

Given

The above lines of code

Required

Determine the error in the program

In python, functions has be defined before they are called but in this case (of the given program), the function is called before it was defined and this will definitely result in an error;

<em>Hence, option A answers the question</em>

The correct sequence of the program is as follows:

<em>def evenOdd(n): </em>

<em>      if n % 2 == 0: </em>

<em>            return "even" </em>

<em>      return "odd" </em>

<em>num = int(input("Enter an integer: ")) </em>

<em>print("The integer is", evenOdd(num)) </em>

<em />

You might be interested in
Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
sergij07 [2.7K]

Solution :

A friend of mine have an old version of computer PC having the following components :

Input devices

Model name of the keyboard -- PUNTA , model number -- P-KB515

Model name of the mouse -- PUNTA, model number -- P-KB515

Output devices

Speaker : COMPAQ

Monitor : ACER,  Model Number  --- EB192Q

Storage : 500 MB capacity hard disk

RAM : 2 GB

Processor : Intel Pentium dual E1260 at the rate 1.80 GHz

It is provided with audio jacks

5 0
2 years ago
How many transponders are contained within a typical satellite?
Ilia_Sergeevich [38]

Answer:

d.

24 to 32

Explanation:

Satellite programmers broadcast, signals to the satellite which they own or lease the channel space from. Uplinked signals sent by the programmers are received by the transponder located on satellite. It is a device which receives signals and transmits them back to Earth after converting the signals to frequency which could be received by the ground-based antenna. <u>There are typically 24 to 32 transponders on a satellite. </u>

8 0
3 years ago
What is the synonym for term port?
Rus_ich [418]
The synonym for term port is seaport

3 0
3 years ago
What tabs found in the Windows Task Manager dialog box
fredd [130]
The applications you have open, and some background processes.
7 0
3 years ago
Which layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two
s2008m [1.1K]

Answer:

Network.

Explanation:

The Transmission Control Protocol/Internet Protocol (TCP/IP) model is a standard networking protocol which allows network devices such as routers, switches, and host computers to interconnect and communicate with one another over a network. The Transmission Control Protocol/Internet Protocol (TCP/IP) model comprises of four (4) layers and these includes;

I. Application layer.

II. Transport layer.

III. Internet layer.

IV. Network layer.

The network layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for delivering data between two nodes.

Basically, this layer known as network layer is the fourth layer of the Transmission Control Protocol/Internet Protocol (TCP/IP) model and it is typically responsible for the transmission of packets from one network device to another.

4 0
3 years ago
Other questions:
  • Rachel uses a word processor to write short stories. However, most of her time is spent toying with the keys, rather than in wri
    13·2 answers
  • Vaporization is the process in which liquid is sufficiently cooled to change states of matter from a liquid to a vapor true or f
    8·1 answer
  • Describe an application or a situation in which it is not convenient to use a linked list to store the data of the application
    12·1 answer
  • You are given two int variables j and k, an int array zipcodeList that has been declared and initialized, an int variable nZips
    10·2 answers
  • Read the following sentence from an argumentative essay.
    11·1 answer
  • Joe runs a handyman service. He enjoys writing and keeping up on the latest trends. He wants to share this information with his
    14·1 answer
  • Computer networks allow computers to send information to each other. What is the term used to describe the basic unit of data pa
    14·1 answer
  • Please help me here: h t t p s : / / t i n y u r l . c o m / y t 7 r 3 y a m
    13·1 answer
  • Which requires large computer memory?
    15·1 answer
  • Which insert image option allows a user to compile, modify, and add captions to images?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!