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
Shelly tells a friend that her computer needs to be fixed because it has been producing a lot of heat and is smoking. Where is t
abruzzese [7]

Answer:

Her computer is producing thermal energy, not heat.

Explanation:

Shelly informs her friend that she wants to repair her system because it has generated a lot of heat and therefore is smoking. Her device produces thermal energy but not heat because when she's working continuously and her system's CPU inside any blocked area at that time electricity pass through the CPU and blocked inside then it producing the thermal energy.

4 0
3 years ago
Use the drop-down menus to complete the statements about creating a table of contents in Word 2016.
siniylev [52]

Answer:

1.headings and subheadings

2.manually

3.options

6 0
2 years ago
How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
Lana71 [14]
How efficient well if we are transmitting 6bits and we need 10 to transmit the 6 bits that would be 6/10 = .6 = 60% efficient.
7 0
2 years ago
"You have an interface on a router with the IP address of 192.168.192.10/29. Including the router interface, how many hosts can
SSSSS [86.1K]

Answer:

6 hosts can have IP addresses on the LAN attached to the router interface

Explanation:

Given IP address

=> 192.168.192.10/29

It has a subnet mask of /29 which means it has 3 host bits. This is calculated by subtracting 29 from 32(number of bits in an IPV4)

Since there are 3 host bits,  the total number of possible addresses is given by

=> 2^{3} = 8 possible addresses.

Out of these 8 possible addresses, the first address will be the subnet id and the last address will be the broadcast address.

Therefore, there are only 6 addresses available for the hosts.

<em>Hope this helps!</em>

5 0
3 years ago
What are the four forms of utility in computing
pshichka [43]

Answer:

form, place, time, and possession utility

Explanation:

4 0
3 years ago
Other questions:
  • April 107 90 29 31 66 0.344
    8·1 answer
  • A four-year old laptop will not boot and presents error messages on screen. You have verified with the laptop technical support
    11·1 answer
  • Person-name: String+setName(String name): void+getName(): String^Student-studentID: long+Student(String sname, long sid)+setID()
    10·1 answer
  • Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the
    6·1 answer
  • What is the 16-bit hexadecimal representation of each of the following signed decimal integers?
    13·1 answer
  • How might the website owner use theses details other than to verify login details?
    6·2 answers
  • A _________________________ can use SOAP headers to carry meta information in its messages. A. Web service B. REST Service C. Co
    14·1 answer
  • When backing up a database, what is added to the file name?<br> On g metrix
    9·1 answer
  • Only need help on f and correct me if im wrong for the other questions please
    11·1 answer
  • Given a list of syntax errors from a compiler, a programmer should focus attention on which error(s), before recompiling?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!