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
Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
Kipish [7]

Answer:

The purpose of the Java compiler is to translate source code into instructions  public static void main(String[] args)  Arity is the number of arguments passed to a constructor or method or the number ... and objects, which are the focus of object-based programs.  Remove the 2 from between the square brackets to make.

Explanation:

5 0
2 years ago
9.6 Code Practice: Question 1
worty [1.4K]

Answer:

  1. import java.util.Random;
  2. import java.util.Arrays;
  3. public class Main {
  4.    public static void main(String[] args) {
  5.        int n = 10;
  6.        int [] myArray = new int[n];
  7.        buildArray(myArray, n);
  8.        System.out.println(Arrays.toString(myArray));
  9.    }
  10.    public static void buildArray(int[] arr, int n){
  11.        for(int i=0; i < arr.length; i++){
  12.            Random rand = new Random();
  13.            arr[i] = rand.nextInt(90) +10;
  14.        }
  15.    }
  16. }

Explanation:

Firstly, create a method buildArray that take two inputs, an array and an array size (Line 12). In the method, use random nextInt method to repeatedly generate a two digit random number within a for loop that will loop over array size number of times (Line 13-15). The expression rand.nextInt(90) + 10 will generate digits between 10 - 99.

In the main program, call the build array method by using an array and array size as input arguments (Line 8). At last, print the array after calling the buildArray method (Line 9).

8 0
2 years ago
Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName and whos
goblinko [34]

Answer:

The solution code is written in Python:

  1. name = input("Enter your name: ")
  2. name_components = name.split(" ")
  3. first_name = name_components[0]
  4. middle_name = name_components[1]
  5. last_name = name_components[2]
  6. print(last_name + ", " + first_name[0] + "." + middle_name[0])

Explanation:

Firstly, prompt user to enter name (Line 1).

Next, use the string <em>split()</em> method and use space " " as separator to split the input string into individual component, first name, middle name, last name and assign to variable <em>first_name, middle_name </em>and<em> last_name </em>(Line 5-7).

Display the output as required by the question.

6 0
2 years ago
Which characteristic of Cloud computing allows data centers to better manage hard drive failures and allocate computing resource
MrMuchimi

Answer:

When working with cloud computing, drive failures and need for usage and data is easily identifiable, so in short term, all of the things that show the user/s what needs to be done is the characteristic.

Explanation:

5 0
2 years ago
ACCOUNTING
ivann1987 [24]

last question is D

Hope this helps

7 0
2 years ago
Read 2 more answers
Other questions:
  • Which type of broadband internet access involves using cellular data networks? ​?
    13·1 answer
  • Judd puts password protection on all of his files, makes sure not to have any patient information open on his computer when he t
    12·2 answers
  • Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if
    13·1 answer
  • Your reputation and credibility will be immediately destroyed if your website contains?
    8·2 answers
  • Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value
    15·1 answer
  • Write a program named SortWords that includes a method named SortAndDisplayWords that accepts any number of words, sorts them in
    10·1 answer
  • XYZ Corp.’s facilities in Nashua, New Hampshire, are two office buildings 400 feet apart, each with its own LAN. To connect the
    9·1 answer
  • Remember that it is desirable for good block ciphers that a change in one input bit affects many output bits, a property that is
    9·1 answer
  • Doug grew up on a large farm in southwest Wisconsin. As a college graduation gift, Doug’s father gave him several hundred acres
    6·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!