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
solmaris [256]
3 years ago
12

Create a static method called fillArray, which takes an integer array as an input parameter, along with an integer initial value

. It should then fill the array with values starting from the initial value, and counting up by 1s. For example, if the data array has length 5, and if the initialValue is 3, then after execution the array should hold this sequence: 3 4 5 6 7. public static void fillArray (int[] data, int initialValue) {
Computers and Technology
1 answer:
JulijaS [17]3 years ago
3 0

Answer:

public class print{

   

   public static void fillArray(int[] arr, int initialValue){

       

       int n = arr.length;

      for(int i=0;i<n;i++){

          arr[i] = initialValue++;

      }

       for(int i=0;i<n;i++){

           System.out.print(arr[i]+" ");

      }

       

   }

    public static void main(String []args){

       

        int[] array = new int[5];

        int initialValue =3;

       

        fillArray(array,initialValue);

       

    }

}

Explanation:

Create the function with two parameter first is array and second is integer.

Then, declare the variable and store the size of array.

Take the for and fill the array from the incremented value of initialValue  by 1 at every run of loop.

After loop, print the element of the array.

Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.

You might be interested in
Which elements are visible when a user opens a new PowerPoint presentation?
Mariulka [41]

Answer:

The only element visible is the presentation itself.

Explanation:

All of the other options, such as presenter's assistance, is hidden away from the projector, presentation device, etc. You are the only one that can see the window that shows what slide is next, presenter's notes, etc. <u>In other words, whatever you want the audience to see, that is only what they will see and nothing else.</u>

3 0
2 years ago
Read 2 more answers
Which of the following is not a basic role of a webmaster
Natalija [7]
Out of the following, the only one that I see is not the basic role of a webmaster is replying to customers questions about the web site! Usually they have a specific job for that; like customer service etc. Hopefully that helps.
5 0
3 years ago
In 2-5 paragraphs, describe the points that Kendra needs to consider when choosing a telecommunications technology to meet her n
never [62]

Answer:

For marketing requirements, various communication mediums like digital communication medium, as well as non digital traditional communication medium can be used. Some like Blogs, Article directories, forums etc. can be used.

However, the AI, ML, DL and the traditional statistical analysis from Data Science can also be used. You need to install on your blog the chat-bots, And through the Chat-bots we can make a data set, that is in fact automatically generated, and contains email, phone numbers, addresses etc, and this data base can be used to run the Amazon Sage-makers. and a lot of meaningful information can be achieved through the prepared data-set through the Sage-maker.

Thus, you can find out quite easily what is good.

Sage maker, Chat bots and Blog technology is quite cost effective as well.

Explanation:

The above details covers all the requirements.

7 0
2 years ago
Program:
Mkey [24]

Answer:

See explaination

Explanation:

#method to print menu & handle user choice

def print_menu(input_str):

#printing menu

print('MENU')

print('c - Number of non-whitespace characters')

print('w - Number of words')

print('f - Fix capitalization')

print('r - Replace punctuation')

print('s - Shorten spaces')

print('q - Quit\n')

#getting choice

choice=input('Choose an option: ').lower()

#identifying choice

if choice=='c':

#displaying number of non white space chars in input_str

print('Number of non-whitespace characters:',get_num_of_non_WS_characters(input_str))

elif choice=='w':

#displaying number of words in input_str

print('Number of words:',get_num_of_words(input_str))

elif choice=='f':

#fixing capitalization and getting updated string and count of values capitalized

input_str,count=fix_capilization(input_str)

#displaying results

print('Number of letters capitalized:',count)

print('Edited text:',input_str)

elif choice=='r':

#replacing punctuation, displaying updated text

input_str=replace_punctuation(input_str)

print('Edited text:', input_str)

elif choice=='s':

#shortening spaces and displaying updated text

input_str = shorten_space(input_str)

print('Edited text:', input_str)

#returning choice and input_str

return choice,input_str

#returns the number of non white space chars in input_str

def get_num_of_non_WS_characters(input_str):

count=0

#looping through each character in input_str

for i in input_str:

if not i.isspace():

#i is not a space

count+=1

return count

#returns the number of words in input_str

def get_num_of_words(input_str):

#splitting words into list of tokens by space

words=input_str.split(' ')

count=0

#counting all non empty strings in words list

for i in words:

if len(i)>0:

count+=1

return count

#method to fix capitalization and return updated string and count of letters updated

def fix_capilization(input_str):

count=0

beginning=True #starting letter should be capitalized

result=''

for i in input_str:

if beginning and i.isalpha():

#start of a sentence and i is alphabetic

if i.islower():

#converting i to upper case, incrementing count

i=i.upper()

count+=1

result+=i

#not start of a sentence

beginning=False

elif i in '?.!':

#i is either ? or . or !, next letter should be capitalized

beginning=True

result+=i

else:

#any other character

result+=i

return result,count

#method to replace exclamation and semicolons with period and comma respectively

def replace_punctuation(input_str,exclamationCount =0,semicolonCount=0):

result=''

for i in input_str:

if i=='!':

i='.'

exclamationCount+=1

elif i==';':

i=','

semicolonCount+=1

result+=i

print('Punctuation replaced')

#displaying replaced values counts

print('exclamationCount:',exclamationCount)

print('semicolonCount:',semicolonCount)

return result

#removes all double or more spaces in input_str

def shorten_space(input_str):

input_str=input_str.strip()

result=''

prev=None

for i in input_str:

if prev==None:

result+=i

elif i==' ':

if prev != ' ':

result+=i

else:

result+=i

prev=i

return result

if __name__ == '__main__':

#getting input, printing it

input_str=input('Enter a sample text:\n')

print('\nYou entered:',input_str)

choice=' '

#looping until choice becomes q

while choice!='q':

choice,input_str=print_menu(input_str)

7 0
3 years ago
Default color html ​
Marrrta [24]

Answer:

black for font...

and

white for bg color

Explanation:

i think this is enough for ur question...

3 0
3 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • Janet is testing the effectiveness of four different plant foods. She plants four identical seeds in four identical pots, supply
    6·2 answers
  • Which of the following is NOT a fixed expense?
    6·1 answer
  • What items do you keep in a data base
    5·1 answer
  • When one user could perform a query to determine which recordings had a track length of four minutes or more, and another user c
    9·1 answer
  • Given an initialized String variable outfile, write a statement that declares a PrintWriter reference variable named output and
    12·1 answer
  • In our discussion of Computer Hardware, we talked about three essential hardware components that are there inside every computer
    14·1 answer
  • How to create an app on app store please its not a joke, if someone knows tell me how
    15·1 answer
  • Which of the following is true about binary search. A. It uses binary numbers in its algorithm B. It is slower than sequential s
    13·1 answer
  • I dont know how to put the negative sigh on my computer
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!