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
muminat
2 years ago
12

A user may enter some text and the number of times (up to a maximum of 10) to repeat it. Display the text repeated that many tim

es with no space in between. For example, if the user types in Hey and 3, the display would be HeyHeyHey. If the user provides no text or provides a number greater than 10, display only an error message.
Computers and Technology
1 answer:
DerKrebs [107]2 years ago
6 0

The command that would be given to execute a code that asks for input and runs it repeatedly until it has satisfied the condition is a do-while loop.

<h3>What is a Do While Statement?</h3>

This is a conditional statement that is used in programming to run a set of code and check the conditions set and commands to execute and finally terminates when the conditions are satisfied.

Therefore, based on the fact that a loop would be used, and the displayed text would be repeated many times, the do-while loop would be used for this program.

Read more about do-while statements here:

brainly.com/question/13089591

#SPJ1

You might be interested in
A program is considered portable if it . . . can be rewritten in a different programming language without losing its meaning. ca
Semenov [28]

Answer:

Can be executed on multiple platforms.

Explanation:

A program is portable if it is not platform dependent. In other words, if the program is not tightly coupled to a particular platform, then it is said to be portable. Portable programs can run on multiple platforms without having to do much work. By platform, we essentially mean the operating system and hardware configuration of the machine's CPU.

Examples of portable programs are those written in;

i. Java

ii. C++

iii. C

8 0
3 years ago
Which leader of the Jamestown colony am I?
faltersainse [42]
I am not completely sure, but I believe that the leader of the Jamestown colony described in this paragraph is John Rolfe.
7 0
3 years ago
Read 2 more answers
Drivers dealing with strong emotions may take risks they otherwise would not. <br> true false
grigory [225]

This is true because some people may be going through rough times and when they aren't they probably won't feel the same way as they do when they go through tough times.

7 0
3 years ago
circular_prime A number is called a circular prime if all rotations of its digits form a prime. For example, the number 197 is a
Lilit [14]

Answer:

function out=circular_primes(no)

prim=primes(no);% find the all prime number till the given number

pr=0;

nos=[];

po=[];

for p=1:length(prim)

   n=prim(p); % picking up each prime no one by one

   n=num2str(n);% change into string for rotation of no

   d=length(n); % length of string

   if d>1          % take nos greater than 10 beacuase below 10 no need for rotation

       for h=1:d

           a=n(1);

           for r=1:d % for rotation right to left

               if r==d  5 % for the last element of string

                   n(d)=a;

               else

               n(r)=n(r+1); %shifting

               end

           end

           

       s=str2num(n); % string to number

       nos=[nos,s]; % store rotated elements in array

       end

       if nos(end)==no   %if given no is also a circular prime we need smaller

           break;

       end

       for gr=1:length(nos) % checking rotated nos are prime or not

           p1=isprime(nos(gr));

           po=[po,p1];    %storing logical result in array

       end

           if sum(po(:))==length(nos) %if all are prime the length and sum are must be equal

               

               pr=pr+1;

               out=pr;

           else

               out=pr;

           end

       po=[];

       nos=[];

   else  

       s=str2num(n); %numbers less than 10

       f=isprime(s);

       if f==1

           pr=pr+1;

           out=pr;

       else

           out=pr;

       end

   end

       

      end

end

Explanation:

3 0
3 years ago
Mika forgot to put in the function name in his function header for the code below. What would be the best function
kondaur [170]

Answer:

I think it's A, def drawDiamond():

Explanation:

5 0
3 years ago
Other questions:
  • To check whether your writing is clear , you can
    15·2 answers
  • What language used orthogonality as a primary design criterion?
    8·1 answer
  • In Word, blue underlining indicates which of these problems?
    12·1 answer
  • Your wireless network has been breached and it seems as though the attacker has modified a portion of your data that is used wit
    12·1 answer
  • Match the following technologies with their applications.
    11·1 answer
  • If you decide you want to meet someone you met online, what should you do first? A. Tell your best friend. B. Call the person yo
    12·1 answer
  • in python Write a program that prompts the user to enter a hex character and displays its corresponding decimal integer python
    14·1 answer
  • What is the importance of knowing the concept of programming?
    8·1 answer
  • When dividing it’s total debt by total equity what’s a company trying to measure
    9·1 answer
  • Determine which program you would recommend each of the customers should use. There are multiple correct answers so please inclu
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!