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
dusya [7]
3 years ago
7

1. Create an optimized function "print s(n,s)" that prints the given argument s (representing a string) k times. k represents th

e number of iterations of the inner loop. The print statement that prints s is in the inner loop of the function (a) Initial conditions: i = 1, j = 1, i <= n, and j <= i (b) i and j increments: i = i + 1 and j = j ∗ 2 (c) input as arguments in the function: n (an integer representing the size of the input), and s (the string) (d) output: print s k times (e) example: n=5, s="hello CSC510-01 class", given these conditions, the function "print s(n,s)" will print s 11 times
Computers and Technology
1 answer:
lukranit [14]3 years ago
3 0

Answer:

The program in C is as follows:

void prints(char arr[], int n){

   int count =0;

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

   for(int j=1;j<=i; j=j*2){

   count++;    }    }  

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

       printf("%s ",arr);

   }

}

Explanation:

This defines the method

void prints(char arr[], int n){

This declares and initializes count variable to 0

   int count =0;

This creates the outer loop

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

This creates the inner loop

   for(int j=1;j<=i; j=j*2){

This increments count by 1

   count++;    }    }  

This iterates through count

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

And print the string in count times. If count is 3, the string will be printed 3 times.

       printf("%s ",arr);

   }

}

See attachment for complete program that includes the main method

Download txt
You might be interested in
What are the fundamental activities that are common to all software processes?
erica [24]

Answer:

There are some fundamental activities that are common to all software processes:

•Software specification. In this activity the functionality of the software and constraints on its operation must be defined.

•Software design and implementation. ...

•Software validation. ...

•Software evolution

7 0
3 years ago
Analog footage can be digitized using video _____ equipment.â
Zepler [3.9K]

Analog footage can be digitized using video capture equipment. <span>
<span>Someone can shoot a footage with an analog camera which will be stored on a tape, and if you need to convert it into a digital format you will need a computer's video capture to save that as a digital output source.</span></span>

7 0
3 years ago
_____ refers to a computing environment where software and storage are provided as an Internet service and accessed with a Web b
vampirchik [111]

Answer:

Cloud Computing.

Explanation:

Cloud computing refers to an environment that is computing oriented where the storage and the software are provided as a service of internet and they are accessed with a web browser.There is no direct active management by the user.It is available to many user over the internet.

Hence we conclude that the answer to this question is Cloud Computing.

4 0
4 years ago
a password to a certain database consists of digits that cannot be repeated. if the password is known to consist of at least 8 d
BaLLatris [955]

Answer:

\frac{10!}{2}mins

Explanation:

12 seconds to try one combination will be equivalent to  \frac{1}{12}\times 60 = \frac{1}{5} \ mins

Password contain at least 8 digit i.e. password can contain 8, 9, 10 digit.

Password cannot contain more than 10 digit because it will give room for repetition which it is clearly stated that digit cannot be repeated.

Possible digit that can be used: 9,8,7,6,5,4,3,2,1,0.

Total number of passwords combination possible for each position in 8 digit.

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3. Total number of passwords combination possible in 8 digit is equivalent to \frac{10!}{2}.

Total number of passwords combination possible for each position in 9 digit.  

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3, 9th position = 2. Total number of passwords combination possible in 9 digit is equivalent to \frac{10!}{1}.

Total number of passwords combination possible for each position in 10 digit.

1st position = 10, 2nd position = 9, 3rd position = 8, 4th position = 7, 5th position = 6, 6th position = 5, 7th position = 4, 8th position = 3, 9th position = 2, 10th position = 1.  Total number of passwords combination possible in 10 digit is equivalent to 10!.

Adding them up and multiplying by  \frac{1}{5} \ mins  to get the total number of time needed to guarantee access to database =  [\frac{10!}{2}\times\ \frac{10!}{1} \times 10!] \frac{1}{5}\ mins = \frac{10!}{2}

7 0
4 years ago
Using _________ feature of macOS, you can have separate sets of open program windows for the desktop. It is a handy way to organ
Vika [28.1K]

Answer:

Spaces feature of mac OS,

Explanation:

Spaces feature of mac OS -

It is the very first thing the user sees as soon the person starts his or her desktop of Mac .

It is one of the most amazing and loved feature of Mac , as it enables the user to open a complete set of open program windows foe the desktop .

The feature is very efficient in organizing various project all together but with different work space , so as to avoid any confusion ,

It is one of the excellent method of multitasking .

Hence , from the given information of the question , the correct answer is spaces feature of Mac OS

8 0
3 years ago
Other questions:
  • Consider the following list.
    5·1 answer
  • Jim works the parts counter for a busy car dealership. When answering the phone, Jim often has trouble answering the customer's
    6·1 answer
  • What is a Qwerty?<br> A) It's a Computer<br> B) It's a keyboard <br> C) A type of frog
    11·2 answers
  • Which of the following cannot be copyrighted? a. books b. inventions c. videos d. music
    7·1 answer
  • Describe how an attacker can use whois databases and the nslookup tool to perform reconnaissance on an institution before launch
    8·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • Heya! I’m quite lonely, so here are some points. I want to play some mc with others but the only version I’m able to play is edu
    11·2 answers
  • Computer is a major source of informarion why​
    8·1 answer
  • Will give brainliest
    14·1 answer
  • Service-oriented architecture includes "reuse." Which of the following is a description of why a business finds it useful? Using
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!