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

Write an algorithm and draw flowchart to print 30 terms in the following sequence

Computers and Technology
1 answer:
valina [46]3 years ago
3 0

Answer:

/*

I don't know what language you're using, so I'll write it in javascript which is usually legible enough.

*/

console.log(buildSequence(30));

function buildSequence(maxVal){

   maxVal = Math.abs(maxVal);

   var n, list = [];

   for(n = 1; n < maxVal; n++){

       /*

        to check for odd numbers, we only need to know if the last bit

        is a 1 or 0:

       */

       if(n & 1){ // <-- note the binary &, as opposed to the logical &&

           list[list.length] = n;

       }else{

           list[list.length] = -n;

       }

   }

   return list.implode(',');

}

You might be interested in
What are threats to computer system
4vir4ik [10]
Breach..
bugs and viruses
hack
3 0
3 years ago
Read 2 more answers
_______ is the protocol suite for the current Internet.
Gala2k [10]
A? not very sure sorry
8 0
3 years ago
I have a message for anyone reading this
uysha [10]

Answer:zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Explanation:

4 0
3 years ago
You have just installed the microsoft windows 7 operating system on your pc. which web browser is bundled with windows 7 and is
kirill [66]
The web browser that is automatically installed with windows 7 is Internet Explorer.

Hope this helps.
6 0
3 years ago
Cuales son las intenciones de la tecnología para el desarrollo social y calidad de vida
Nuetrik [128]

Answer:

jgiofhkjufihojsfguisjkdghsufijk

Explanation:

eafijbuiaoehfkjhadufyhbjadnifujkhmadjnigjkmhadfngkjadhmfj

7 0
3 years ago
Other questions:
  • The /tmp directory is a temporary directory and will not exist on a system at all times. True or False?
    15·1 answer
  • _______ refers to the poitically, religiously, or ideologically motivated use of computers (or related technology) by an individ
    15·1 answer
  • Which of the following refers to a combination of hardware and software that ensures only authorized individuals gain entry into
    11·1 answer
  • Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation
    6·1 answer
  • Head-mounted displays often use organic light emitting diode,or technology.
    15·1 answer
  • A bluetooth device in ____ mode is part of the piconet but is in a low-power state.
    8·1 answer
  • While reviewing the Quick Access toolbar, Sarah notices that the Redo button is not there. This is because the Redo button only
    12·1 answer
  • What is an Algorithm? (might not be in the chapter text). Give an example.
    13·1 answer
  • An integrated file is one that includes information created in _____ Office application(s).
    15·1 answer
  • .NET
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!