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
miss Akunina [59]
3 years ago
11

​Case-Based Critical Thinking Questions​Case 9-1Melissa, a computer science engineering student, is learning the basics of progr

amming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months-March, April, and May-from a calendar.​Melissa wants to insert abbreviations of spring months into the monthName array. Which of the following methods should she use?
A. ​monthName.reverse(5, 3, "Mar", "Apr", "May");B. ​monthName.sort(2, 3, "Mar", "Apr", "May");C. ​monthName.join(5, 3, "Mar", "Apr", "May");D. ​monthName.splice(2, 3, "Mar", "Apr", "May");
Computers and Technology
1 answer:
Sunny_sXe [5.5K]3 years ago
4 0

Answer:

Option D:  monthName.splice(2, 3, "Mar", "Apr", "May");

Explanation:

splice is a JavaScript array method which can be used to insert or remove item(s).

It has general syntax:  splice( i, n , item1, item2, item3, .... , itemX)

  • i : index position of the array where the item should be inserted or removed
  • n: number of item(s) should be removed starting from index-i
  • item1,item2,....itemX :  item(s) to be inserted

If we have an original monthName array with elements:

["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

monthName.splice(2, 3, "Mar", "Apr", "May")  will

  • remove 3 items from index position-2 ("March", "April" and "May")
  • and insert three new items, "Mar", "Apr" and "May".

New array:

["January", "February", "Mar", "Apr", "May", "June", "July", "August", "September", "October", "November", "December"]

You might be interested in
A process is: An activity of a function that is performed for some specific business reason A single piece of data within a syst
ankoles [38]

Answer:

An activity of a function that is performed for some specific business reason.

Explanation:

A set of actions to achieve a particular task is called process.

<u>Definition</u>

Process is the actions happening while something is happening or being done.

<u>Example </u>

1. Process is the steps taken by someone to clean a kitchen.

2. Collection of action items to be decided on by government committees.

7 0
3 years ago
Write a function called which_vowels_present that takes a single string parameter. Complete the function to return a list of str
romanna [79]

Answer:

import java.util.ArrayList;

import java.util.List;

public class Vowels {

   public static void main(String[] args) {

   String word = "I am David from Nigeria";

       System.out.println(which_vowels_present(word));

   }

   public static List which_vowels_present(String enteredWord){

       List<Character>list = new ArrayList<>();

       String word = enteredWord.toLowerCase();

       for (int i =0; i<word.length(); i++){

           if (word.charAt(i) == 'a' || word.charAt(i) == 'e' || word.charAt(i) == 'i'

                   || word.charAt(i) == 'o' || word.charAt(i) == 'u') {

               list.add(word.charAt(i));

           }

       }

       return list;

   }

}

Explanation:

  • Using Java programming Language
  • Import java.util.ArrayList; and java.util.List
  • Create the method which_vowels_present which accepts a string parameter
  • Within the method create a list object
  • Use a for loop to iterate the string. within the for loop use an if statement to check individual characters of the string if any is a vowel, add it to the list
  • return the list
  • In the main method, create a test string, call the method and pass the string as parameter

5 0
3 years ago
Which of the following are all involved in the evaluation of the presentation of a speech?
ikadub [295]

Answer:

C.

Explanation:

The elements involved in the evaluation of the presentation of a speech includes visual aids, vocal technique, and body language.

Adding vivid pictures in the presentation makes it graphic and proficient. The visual aids in presentation also provides the succinct and clear meaning of the message to the reader.

The vocal technique is another element that adds value in presentation. A speaker's confidence is reflected through his/her tone. It is the speaker's voice that becomes an influential tool that draws the audience's attention.

Body language, like vocal technique, helps in effective delivering of the speech. Body language is a non-verbal form of communicatin that communicates a lot to the audience than one can imagine.

Therefore, option C is correct.

6 0
3 years ago
What can be controlled through IoT? Choose four answers.
Maru [420]

<em>The answer is: </em>

<em> </em>

<em>Door locks, light switches, security cameras and desktops (even laptops too) </em>

<em> </em>

<em>When we say Internet of Things, it is basically all objects that can be connected to internet (objects that are parts of our daily lives) can be included in this phrase or quote). There are technologies pertaining to common household items such as locks, switches and cameras that can be controlled through the use of phones and internet. These things collect and stores data such as names, fingerprints, pictures and scans that are used for verification and authentication purposes. </em>

<em> </em>

<em />

5 0
3 years ago
Function Name: d2x Parameters: int, int Returns: string Description: Write function, d2x, that takes as input a nonnegative inte
Marina CMI [18]

Answer:

I am writing a Python program. Let me know if you want the program in some other programming language.

#definition of function d2x which takes two parameters v: which is a non #negative integer and x which is an integer between 2 and 9. this method #returns string of digits that represents the base-x representation of v

def d2x(v,x):

   remainder = v%x  

   if v<=1:

       return str(v)

   else:

       return str(d2x(v//x,x)) + str(remainder)

 

v= int(input("Enter a non negative integer: "))

x= int(input("Enter an integer between 2 and 9: "))

print(d2x(v,x))

Explanation:

I will explain the code line by line.

def d2x(v,x) This is the definition of function d2x which takes two parameters v: which is a non negative integer and x which is an integer between 2 and 9. This method returns string of digits that represents the base-x representation of v.

Now lets take an example to understand the working of this function.

Suppose the value of v = 10 and x = 2.

remainder = v%x  takes the mod of v and x which returns the remainder of the division of v by x. So v%x = 10 % 2 = 0. So remainder = 0.

if v<=1 This if condition checks if the value of v is less than or equal to 1. This is false because v=10 and 10 is greater than 1. If v is 1 or less than return str(v)  will return the value of v as it is i.e. 10.

Since the IF condition is false so the else part will execute which has the following statement: return str(d2x(v//x,x)) + str(remainder)

This calls the d2x function recursively. Here v is divided by x successively until the quotient of v divided by x is 0. On each successive division, the remainder is the new most significant digit. In v//x, the double slash is called floor division or integer division which we use as both v and x are integers. So using recursion the above statement becomes:

str(d2x(v//x,x)) + str(remainder)

str(d2x(10//2,2) + str(0)

d2x(5,2) + (0)

Now d2x will again be called recursively to perform the division and this successive division continues until quotient of v divided by x is 0. Here str() method is used returns the result in the form of string.  So v%x is the number which is added to the end of resultant number. v//x is the recursive portion which keeps using the answer of the previous binary number. This means 10 in base 2 calls convert(5,2), then adds 0 at the end. So when v//x=5 and v%x=0 So the answer is 1010.

At the end v= int(input("Enter a non negative integer: "))

x= int(input("Enter an integer between 2 and 9: "))  these two statement wills take integer input from user and print(d2x(v,x)) calls d2x method and print the result.

6 0
3 years ago
Other questions:
  • You have been asked to implement enterprise software for a manufacturer of kitchen appliances. What is the first step you should
    11·1 answer
  • How do myths impact today’s society.(A
    14·2 answers
  • What is the multiple source test
    15·1 answer
  • 1. Empty tags do not have ___________.
    14·1 answer
  • What are some things you can do to clean up your digital footprint.
    9·1 answer
  • Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
    7·1 answer
  • What is the minimum number of bits needed to store the decimal value 200?
    12·1 answer
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • Let f(w) = 2w^3 - 5. Let z = 2. What is f(z)?​
    6·1 answer
  • What type of attack occurs when the threat actor snoops and intercepts the digital data transmitted by the computer and resends
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!