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
What is the significance of the scientific method?
Gnom [1K]
Hello there! The significance of the scientific method is that it ensures accuracy and it ensures that the experiment was done in the right order.

The scientific method is a widely accepted way of revising and rechecking the work of scientists to see if:

1. The answers match up

2. The experiment was performed correctly

3. The results are accurate

Through the scientific method, the probability is very high that things will not go wrong. The significance of this is that if the scientific method is not applied to an experiment, nobody knows the results. If nobody knows the results, there are many possible unintended consequences that could happen. Hope this helps!
6 0
1 year ago
A=1/2h(a+b) solve for h
devlian [24]

A=1/2h(a+b)

1/2 can be said as 0.5

so

A=0.5h(a+b)

0.5h is being multiplied with (a+b), taking this expression of left hand side gives

A/0.5(a+b)=h

OR

h=A/0.5(a+b)

This is the final answer

8 0
3 years ago
If you anticipate running a particular query often, you can improve overall performance by saving the query in a special file ca
mestny [16]

If you anticipate running a particular query often, you can improve overall performance by saving the query in a special file called a(n)  stored procedure.

<h3>What is meant by stored procedure?</h3>

An application that uses a relational database management system can access a subroutine known as a stored procedure. These processes are kept in the data dictionary of the database. Access control and data validation are two applications for stored processes.

A stored procedure is a collection of SQL statements that have been given a name and are kept together in a relational database management system (RDBMS) so they may be used and shared by various programs.

If you expect to run a certain query frequently, putting it in a special file known as a(n) stored procedure can enhance overall speed.

To learn more about stored procedure refer to:

brainly.com/question/13692678

#SPJ4

3 0
2 years ago
Which area of study involves microeconomWhich area of study involves microeconomics? A. a nation's ability to meet consumer dema
AysviL [449]

Answer:

The correct answer is C. Consumer behavior and preferences.

Explanation:

hope it will help :)

6 0
3 years ago
What are the types of action involving data base?
Alexeev081 [22]

Answer: The DBMS is a software system that explains the four types of actions, which are defining, constructing, manipulating, and sharing databases among various users and applications.

3 0
3 years ago
Other questions:
  • Privileged instructions 1) generate an interrupt so they can execute before non-privileged instructions. 2) are valid only when
    5·1 answer
  • In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
    6·1 answer
  • This is not an appropriate business use for a wiki. editing corporate documents getting customer feedback project management pub
    11·1 answer
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • What is gender bias?
    9·1 answer
  • Identify a characteristic of electronic meeting systems.
    10·1 answer
  • I need some asap pls
    9·2 answers
  • Camila wanted to increase the readability of her company newsletter. To do this, she added _____.
    7·2 answers
  • Why did Elena Gilbert Turn her humanity off when she was sired to Damon? (In The Vampire Diaries)
    14·1 answer
  • true Or False 1. Computer Time is located in Start Menu, b. Ms Word is developed by Adobe Corporation c. Ms-Excel is Presentatio
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!