answer.
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
liubo4ka [24]
2 years ago
8

Which of the following is true with regard to defensive programming? Preconditions should never be visible to callers. Program c

ode frequently assumes that input will be valid and that algorithms will behave as expected. You should never guard assumptions. Information hiding dictates that we never document assumptions.
Computers and Technology
1 answer:
Firlakuza [10]2 years ago
8 0

Answer:

The correct point about defensive programming is that the "program code frequently assumes that input will be valid and that algorithms will behave as expected".

Explanation:

You might be interested in
Please answer this a due tomorrow!!!
dem82 [27]

Answer:  

4-Well first of all for the "VR" problem it could be a problem, because people could forget about there actual life and not be able to much of anything when needed.

1-the first one you are going to have to answer.

2-If you have different files then you aren't stumbling through multiple different links and could have trouble with finding what is needed.

3-the third one you are going to have to answer.

5-If I were you I would help them the best way you could so they can actually know how to do their job.

5 0
1 year ago
Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
juin [17]

The answer is B: Yahoo! mail

Donna is able to install Yahoo! mail as an app on her portable devices like phones and tablets and be able to organize her Google mails, Outlook, and yahoo accounts. The beauty of it is that you are able to sign in with any account (non-Yahoo emails). anywhere and at any time. It also provides 1000 GB of free secure cloud storage.



6 0
2 years ago
Read 2 more answers
When a visitor clicks the submit button on a form, the ______ of each form element is sent?
Bond [772]

In data presentation of computing systems and applications, when a user click the submit button on the form, the name-value pair of each form is sent because it is an open-ended data structure that allows future extension without altering existing code or data.

6 0
2 years ago
Read 2 more answers
Suppose your company has decided that it needs to make certain busy servers faster. Processes in the workload spend 60% of their
vekshin1

Answer:

CPU need 50% much faster

disk need 100% much faster

Explanation:

given data

workload spend time CPU  = 60%

workload spend time I/O = 40%

achieve overall system speedup = 25%

to find out

How much faster does CPU need and How much faster does the disk need

solution

we apply here Amdahl’s law for the overall speed of a computer that is express as

S = \frac{1}{(1-f)+ \frac{f}{k} }      .............................1

here f is fraction of work i.e 0.6 and S is overall speed  i.e 100% + 25% = 125 % and k is speed up of component

so put all value in equation 1 we get

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.6)+ \frac{0.6}{k} }  

solve we get

k = 1.5

so we can say  CPU need 50% much faster

and

when f = 0.4 and S = 125 %

put the value in equation 1

S = \frac{1}{(1-f)+ \frac{f}{k} }  

1.25 = \frac{1}{(1-0.4)+ \frac{0.4}{k} }  

solve we get

k = 2

so here disk need 100% much faster

7 0
2 years ago
Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to meet you." becomes:
vodomira [7]

Answer:

Here is the complete function:

void MakeSentenceExcited(char* sentenceText) {  // function that takes the text as parameter and replaces any period by an exclamation point in that text

int size = strlen(sentenceText);  //returns the length of sentenceText string and assigns it to size variable

char * ptr;  // character type pointer ptr

ptr = sentenceText;  // ptr points to the sentenceText string

for (int i=0; i<size; i++){  //iterates through the sentenceText string using i as an index

    if (sentenceText[i]=='.'){  // if the character at i-th index of sentenceText is a period

        sentenceText[i]='!'; } } } //places exclamation mark when it finds a period at i-th index of sentenceText

Explanation:

The program works as follows:

Suppose we have the string:

sentenceText = "Hello. I'm Miley. Nice to meet you."

The MakeSentenceExcited method takes this sentenceText as parameter

int size = strlen(sentenceText) this returns the length of sentenceText

The size of sentenceText is 35 as this string contains 35 characters

size =  35

Then a pointer ptr is declared which is set to point to sentenceText

for (int i=0; i<size; i++) loop works as follows:    

1st iteration:

i=0

i<size is true because i=0 and size = 35 so 0<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[0]=='.')

The first element of sentenceText is H

H is not a period sign so the statement inside if statement does not execute and value of i increments to 1. Now i = 1

2nd iteration:

i=1

i<size is true because i=1 and size = 35 so 1<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[1]=='.')

This is the second element of sentenceText i.e. e

e is not a period sign so the statement inside if statement does not execute and value of i increments to 1. Now i = 2

So at each iteration the if condition checks if the character at i-th index of string sentenceText is a period.

Now lets see a case where the element at i-th index is a period:

6th iteration:

i=5

i<size is true because i=5 and size = 35 so 5<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[5]=='.')

This is the character at 5th index of sentenceText i.e. "."

So the if condition evaluates to true and the statement inside if part executes:

sentenceText[i]='!'; statement becomes:

sentenceText[5]='!'; this means that the character at 5th position of sentenceText string is assigned an exclamation mark.

So from above 6 iterations the result is:

Hello!

This loop continues to execute until all the characters of sentenceText are checked and when the value of i gets greater than or equal to the length of sentenceText then the loop breaks.

The screenshot of the program along with its output is attached.

6 0
1 year ago
Other questions:
  • Julie bought a house for $315,000 and has a $285,000 mortgage. she claims she has $315,000 in equity. is she correct? if not, ho
    12·2 answers
  • Let's assume that the smallest possible message is 64 bytes (including the 33-byte overhead). if we use 100base-t, how long (in
    10·1 answer
  • Witch printer covers a large range of colors than any other printer does
    15·2 answers
  • Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
    15·2 answers
  • Mrs. Johnson is here today to receive an intercostal nerve block to mitigate the debilitating pain of her malignancy. Her cancer
    13·1 answer
  • Write the printItem() method for the base class. Sample output for below program:
    8·1 answer
  • Write a class with a constructor that accepts a String object as its argument. The class should have a method that returns the n
    13·1 answer
  • 15) The codes for class Hotel has been defined in two separate files Hotel.h, and Hotel.cpp. Which of the following statements i
    12·1 answer
  • The Company management has asked that you compare the OSSTMM and the PTES to determine which methodology to select for internal
    13·1 answer
  • Exercise 3: Function Write a function named word_count that accepts a string as its parameter and returns the number of words in
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!