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
Give ways on how to effectively save.​
sp2606 [1]

Answer:

Explanation:

say goodbye to debt. Monthly debt payments are the biggest money suck when it comes to saving. ...

Cut down on groceries. ...

Cancel automatic subscriptions and memberships.

4 0
3 years ago
What happens when variables in programming are not properly initialized? answers?
Romashka-Z-Leto [24]
Errors in compilation happen, or it runs but then doesn't recognize the input. Also you can't transform into other types of variables.
6 0
3 years ago
Which Tab contains the paragraph attributes?
alexgriva [62]

Answer:

b insert

Explanation:

7 0
3 years ago
The batteries on electric vehicles are recharged using electricity from either a wall socket or dedicated charging unit.
yuradex [85]

Answer:

true

Explanation:

7 0
3 years ago
As Jason walks down the street, a large raven starts squawking at him and flapping its wings. Jason thinks to himself ‘That bird
UNO [17]

Answer:

Answer to the following question is anthropomorphism.

Explanation:

Anthropomorphism is considered as the error in the following context of the scientific reductionism. Anthropomorphize is the source of an error that needs to reconsider.

Anthropomorphism is an attribute of the human qualities, emotions, thoughts, motivation, intentions, and characteristics to the non-living beings or the nonhuman beings, things or objects.

8 0
3 years ago
Other questions:
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • Which education and qualifications are most helpful for Law Enforcement Services careers? Check all that apply.
    15·1 answer
  • Working together, printer A and printer B would finish the task in 24 minutes. Printer A alone would finish the task in 60 minut
    8·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    7·1 answer
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • (1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term e
    10·1 answer
  • Suppose a webpage contains a single text field. We want to make the page such that a user can immediately start typing in the te
    11·1 answer
  • 1. Which of the following is not true about high-level programming language s? (a) Easy to read and write (b) Popular among prog
    12·1 answer
  • Please help me plss! PLS​
    8·2 answers
  • In high-tech fields, industry standards rarely change.<br> True <br> False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!