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
Gennadij [26K]
3 years ago
13

Write the definition of a void function that takes as input an integer and outputs two times the number if it is even; otherwise

it outputs five times the number.
Computers and Technology
1 answer:
KatRina [158]3 years ago
6 0

Answer:

Written in C++

void number(int n){

if(n%2 == 0)

cout<<2 * n;

else

cout<<5 * n;

}

Explanation:

The programming language is not stated.

However, I answered using C++

This line defines the function as void

void number(int n){

This line checks if the number is even

if(n%2 == 0)

If yes, it doubles the number and prints the output

cout<<2 * n;

If otherwise,

else

It multiplies the number by 5 and prints the output

cout<<5 * n;

}

To call the function from main, use:

number(n);

Note than n must be declared as integer

See attachment

Download cpp
You might be interested in
On Microsoft teams, how do teachers know that you are on a different page?
emmasim [6.3K]

Answer:

they can view if you left the page on the teacher side of the website

Explanation:

i have made a page just for this

6 0
3 years ago
Read 2 more answers
in a deisgn project, what two types of graphics or images is the digital artist respondsible for creating?
Inga [223]
Vector and raster images
7 0
3 years ago
Is mayonnaise technically an instrument?
stich3 [128]
No it doesn’t count as an instrument
7 0
3 years ago
What is the cause of electronic signals on electronics?
max2010maxim [7]

Explanation:

Electric devices, such as lights and household appliances, change electric current to other forms of energy. For example, an electric stove changes electric current to thermal energy. ... A message encoded this way is called an electronic signal, and the use of electric current for this purpose is called electronics

MARK ME AS A BRAIN LIST

8 0
3 years ago
Yuri is a skilled computer security expert who attempts to break into the systems belonging to his clients. He has permission fr
Tatiana [17]

Answer:

b) White-hat hacker

Explanation:

This is also called an ethical hacker. Unlike the other options, a white-hat hacker is a person specialized on computational security which offers services to organizations to test how safe they are from informatic attacks (viruses, theft of information, etc). This is carried out  based on a agreement between the whihte-hat hacker and the client via a contract.  

8 0
3 years ago
Other questions:
  • Consider the latency model for static congestion windows. If the server receives an acknowledgement for the first data segment i
    5·1 answer
  • What type of malicious procedure involves using sniffing tools to capture network communications to intercept confidential infor
    7·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • Page No.
    10·1 answer
  • What is it called when two different files generate the same hashing result?
    15·1 answer
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • Please tell fast plzzzzzzzz​
    9·2 answers
  • What is computer system ?​
    9·2 answers
  • You have installed a new sound card in your system, closed the computer case, and turned on the computer. Windows boots and you
    10·1 answer
  • If you have two folders open on your desktop and you want to move a file from one folder to the other, simply ________ the file
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!