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
Cryptography has requirements include:
Nastasia [14]

Answer:A i think

Explanation:

5 0
3 years ago
How to burn mp3 on dvd
ki77a [65]
Look up on google a software that can do it for you. Doing it through a pre-made software is about the only way to do it most computers won't allow you to.

7 0
3 years ago
Read 2 more answers
What are the two main components on the motherboard?
Advocard [28]
<span>A chipset which forms an interface between the CPU's front-side bus, main memory, and peripheral buses. Non-volatile memory chips (usually Flash ROM in modern motherboards) containing the system's firmware or BIOS. A clock generator which produces the system clock signal to synchronize the various components.</span>
6 0
2 years ago
Read 2 more answers
The answer for this question?
Debora [2.8K]
It will flow from 2 to 1
6 0
3 years ago
Wice each lunar month, all year long, these tides occur. Whenever the Moon, Earth and Sun are aligned, the gravitational pull of
DENIUS [597]
E)   none of those   Adds; Spring
8 0
3 years ago
Other questions:
  • Which partitioning method must you use for a 4-tb hard drive?
    13·1 answer
  • How many apostrophes or quotation marks in a row should you use to begin and end a multi-line string?
    14·2 answers
  • A ________ is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood t
    6·1 answer
  • Please Do Solve it guys...
    6·1 answer
  • Question 5 (1 point)
    5·1 answer
  • Multiple Choice
    8·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
  • write ms-dos command to list all the files and folders of EIGHT sub directory of C: drive in ascending order according to file n
    5·1 answer
  • 1. If an android phone is out of date or outdated and it requires an update. Explain the steps how I can update this phone.
    15·2 answers
  • What technology does kroger’s edge technology and amazon’s just walk out technology leverage?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!