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
Your ASP.NET page contains a page-level variable of Customer type. You want to preserve the value of this variable across page p
alina1380 [7]

Answer:

Option c is the correct answer for the above question.

Explanation:

View states are a mechanism that is used in c# programming language, It is used on only one page on which the user or programmer is working currently. It does not hold the records when the control goes to the other page.

The above question also wants which is described above. Hence option c is the correct answer while the other is not because:-

  • Option a states about the query string which is not any technique to hold the record.
  • Option b states about cookies which are used to hold the record of all page.
  • Option d states about the session which is used to hold any record and can be accessed on any page.
8 0
4 years ago
Describe the operation of IPv6 Neighbor Discovery. ​
max2010maxim [7]
Can you give me the link to an article about this so i may help?
6 0
3 years ago
What type of tests is suitable for automated testing?
Shtirlitz [24]
Layering test
input-output test
UI regression test
unit test
integration test
code analysis
production logging and monitoring

8 0
3 years ago
How can social media give you knowledge
cupoosta [38]
Social Media can you knowledge by most users on Social Media spreading their own knowledge.
5 0
3 years ago
What is the name of the place where students access all of their course information? Student handbook. Learning management syste
ehidna [41]
The syllabus is where students can find their course information.
3 0
3 years ago
Other questions:
  • Give two reasons why cloud computing could be harmful to an organization.<br> (No choices!)
    15·1 answer
  • Suppose you want to click up- and down-arrows on a "control" to change the value of the product price in cell C7. What form cont
    10·1 answer
  • Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
    14·2 answers
  • When you receive five job offers what does it mean
    9·1 answer
  • If you hear that an airplane crashes into the Empire State Building, and you immediately think of the 9/11 terrorist attack on t
    9·1 answer
  • You should structure the first before you search for a relevant picture.
    8·1 answer
  • The introduction of an academic paper must include a:
    12·2 answers
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • Which Operating System is used most often in households?
    6·2 answers
  • What is the purpose of system software?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!