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 do you call the spreadsheet cell that is in effect and has a heavier black border around it?
valina [46]
The right answer is A<span>.Active cell </span>
4 0
3 years ago
Read 2 more answers
1.is there a digital way to mark your favorite website in the internet?Expound your thoughts.
charle [14.2K]

Yes, there is a way to mark your favourite website on the internet by adding it to bookmark

Explanation:

No, I didn't find it difficult to create a bookmark.

It was easy you just have to click on the bookmark button

5 0
3 years ago
What is TLB for? Why TLB? Given the following number, what is theeffective memory access time?
vodomira [7]

Answer:

A lookaside buffer translation (TLB) is a memory cache that reduces the time it takes to access a user memory place. TLB includes the most lately used page table entries.

TLB is used to overcome the issue of sizes at the time of paging. Page Table Entry (PTE) is used for framing the memory ,but it uses two references one for finding  the frame number and the other for the address specified by frame number.

<u>Formula for finding effective memory access time-</u>

Effective Memory Access Time = (TLB access_time+Memory Access Time)*hit ratio + (TLB access_time+2*Memory Access Time)*(miss ratio)

Given in question,

Hit ratio = 0.90

Memory Access Time = 150ns

TLB access time= 5ns

Effective Memory Access Time = (TLB access_time+Memory Access Time)*hit ratio + (TLB access_time+2*Memory Access Time)*(miss ratio)

                            =(5+150) * 0.90 + (5+2*150)*(1-0.90)

                             =155 * 0.90 + (305*0.1)

                             =139.5 + 30.5

                             = 170ns

8 0
3 years ago
Backing up data on a computer means
aleksklad [387]

Answer: when you back data up you are copying it and then moving the copy to another storage device

6 0
3 years ago
Read 2 more answers
Kiko loves to surf the internet and check on different websites. One day he received an email from unknown source. When he opens
Angelina_Jolie [31]

He experienced phishing

Phishing is a method of trying to gather personal information using deceptive e-mails and websites.

Here are some measures to avoid phishing. You can pick up the one you liked the most

  • Always check the spelling of the URLs in email links before you click or enter sensitive information
  • Watch out for URL redirects, where you're subtly sent to a different website with identical design
  • If you receive an email from a source you know but it seems suspicious, contact that source with a new email, rather than just hitting reply.
  • Don't post personal data, like your birthday, vacation plans, or your address or phone number, publicly on social media
5 0
3 years ago
Other questions:
  • kelly wants to buy a new operating system for a laptop. under which category will it be in online store?
    5·1 answer
  • Jake and Sarah have an assignment of writing the history of American independence as a team. They divided their work in hait and
    7·2 answers
  • To change the caption for a field in a query, click the field in the design grid, click the ____ button on the Design tab, click
    14·1 answer
  • Scripts based on other sources, such as short stories, novels, or biographies, are known as _____.
    12·1 answer
  • C++
    8·1 answer
  • The small company where you work needs to implement a second server for its accounting system, but does not have the funds to pu
    11·1 answer
  • Solesbee v. Balkcom (1950) was one of two cases that challenged the constitutionality of capital punishment prior to 1968. What
    10·1 answer
  • Describe how being a global citizen in the world of advanced technology can be beneficial to your success in meeting your person
    13·1 answer
  • PLZZZZ HELP!!!
    12·2 answers
  • Please help me on this it’s due now
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!