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
Graphic images can be stored in a variety of formats including ____.
Marrrta [24]
Graphic images can be stored in a variety of formats including JPEG and GIF. Hope this helped!
5 0
3 years ago
A network system administrator would typically be responsible for which of the following duties?
EleoNora [17]

Answer:

A) Maintaining the shared connections between offices

Explanation:

Plz mark brainliest

3 0
3 years ago
Read 2 more answers
Which approach is ideal for ensuring that a Webpage is maintained and does not appear neglected to users?
Greeley [361]

Answer:

D

Explanation:

I think putting hyperlink in essential pages is a good idea as it may guide a user

8 0
3 years ago
Which TWO are examples of the internet reducing the use of paper?
storchak [24]

Answer:

Using word documents instead of paper can save lots of paper especially, when lots of people are doing that already. Using emails can reduce the amounts of letters being sent to people.

7 0
2 years ago
Where can a user find out more information about a hardware or network failure that occurred on that particular pc?
dolphi86 [110]
In *nix the logs are usually in /var/log . They're usually restricted to privelidged access. In Windows, the Event Logs
7 0
3 years ago
Other questions:
  • 3. Of the following pieces of information in a document, for which would you most likely insert a mail merge field? A. First nam
    13·2 answers
  • What is the most powerful gpu or known as the graphics card in the world?
    8·2 answers
  • A security policy is a
    11·1 answer
  • 2. Use inheritance to create a hierarchy of Exception classes -- EndOfSentenceException, PunctuationException, and CommaExceptio
    6·1 answer
  • The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision.
    7·1 answer
  • Determine the number of cache sets (S), tag bits (t), set index bits (s), and block offset bits (b) for a 40964096-byte cache us
    15·1 answer
  • Differentiate Between register and Memory location (
    13·1 answer
  • 6. At age 17, what was Minhaj's definition of the American Dream?
    8·1 answer
  • A _____ is the viewing area for a web page, which is much smaller on a phone than on a traditional desktop.
    7·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!