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
Is monitor is a television​
mylen [45]

Answer:

No, a monitor only shows what a different device tells them too however, a tv can be connected to nothing and show tv shows

3 0
3 years ago
The first electric, general-purpose computer, ENIAC, was programmed by calculating algorithms on paper entering code directly in
JulsSmile [24]

Complete Question:

The first electric, general-purpose computer, ENIAC, was programmed by?

Group of answer choices.

A. Calculating algorithms on paper.

B. Entering code directly into the computer.

C. Flipping switches by hand.

D. Using MS-DOS as the operating system.

Answer:

C. Flipping switches by hand.

Explanation:

The first electric, general-purpose computer, ENIAC, was programmed by flipping switches by hand.

ENIAC is an acronym for Electronic Numerical Integrator and Computer, it was developed in 1945 by John Mauchly and J. Presber Eckert. ENIAC was used for solving numerical problems or calculation-related tasks by the process of reprogramming.

In order to give the ENIAC a series of machine instructions to follow in the execution of a task, the programmers had to undergo the cumbersome procedure of connecting, removing, reconnecting cables and flipping switches by hand because data couldn't be stored in memory.

4 0
3 years ago
WHAT DOES THE SCRATCH CODE BELOW DO?
Vinil7 [7]
I think it’s b vertically
7 0
3 years ago
A startup disk cannot be detected when booting a computer. The disk's pressence is reported by the system firmware, But Windows
olasank [31]

Answer:

Bootrec.exe

Explanation:

The process of turning on a computer system is called booting. When a computer system boots, it runs the post test and loads into memory, the information or program needed to run the operating system, and then locates the operating system from the boot manager record in the disk partitions. When the disk is failed to be recorded, or the boot manager or sector is corrupt or lost, the bootrec.exe command is used in the command prompt to correct these problems.

8 0
3 years ago
I need help with this line of code:
Usimov [2.4K]

Answer:

remove everything after superhero

Explanation:

newhero==superhero and test it

7 0
3 years ago
Other questions:
  • You arrive to an intersection with traffic
    12·1 answer
  • Which of the following statements is TRUE?
    11·2 answers
  • A cloud data storage company develops a proprietary system of hardware and software, trains its systems analysts on the technolo
    11·1 answer
  • What is the most common concern with using variable frequency drives?
    6·1 answer
  • What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user prog
    11·1 answer
  • The roman structure that features heavy use of arches and columns is the _______.
    6·1 answer
  • If you need to write a function that will compute the cost of some candy, where each piece costs 25 cents, which would be an app
    5·1 answer
  • What is a computer?
    9·2 answers
  • Which kind of blocks is used to hold values​
    7·1 answer
  • Hurry please I’ll give Brainliest if you are right
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!