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
Pepsi [2]
3 years ago
6

Assign True to the variable is_ascending if the list numbers is in ascending order (that is, if each element of the list is grea

ter than or equal to the previous element in the list). Otherwise, assign False with is_ascending.
Computers and Technology
1 answer:
koban [17]3 years ago
5 0

Answer:

The question seem incomplete as the list is not given and the programming language is not stated;

To answer this question, I'll answer this question using Python programming language and the program will allow user input.

Input will stop until user enters 0

<em>The program is as follows</em>

newlist = []

print("Input into the list; Press 0 to stop")

userinput = int(input("User Input:"))

while not userinput == 0:

     newlist.append(userinput)

     userinput = int(input("User Input:"))

is_ascending = "True"

i = 1

while i < len(newlist):  

     if(newlist[i] < newlist[i - 1]):  

           is_ascending = "False"

     i += 1

print(newlist)

print(is_ascending)

Explanation:

This line declares an empty list

newlist = []

This line prompts gives instruction to user on how to stop input

print("Input into the list; Press 0 to stop")

This line prompts user for input

userinput = int(input("User Input:"))

This next three lines takes input from the user until the user enters 0

<em>while not userinput == 0:</em>

<em>      newlist.append(userinput)</em>

<em>      userinput = int(input("User Input:"))</em>

The next line initialized "True" to variable is_ascending

is_ascending = "True"

The next 5 line iterates from the index element of the list till the last to check if the list is sorted

<em>i = 1</em>

<em>while i < len(newlist):  </em>

<em>      if(newlist[i] < newlist[i - 1]):  </em>

<em>            is_ascending = "False"</em>

     i += 1

The next line prints the list

print(newlist)

The next line prints the value of is_ascending

print(is_ascending)

You might be interested in
Which best describes a career that would rely on both and employer and the federal government for funding? Electro-Mechanical Te
Dmitrij [34]

Answer:

<u>University Research Professor</u>

Explanation:

A university Professor can identify a research in his/her area of study and prepare a proposal for funding.This could be a research that will impact the nation thus a proposal could be presented to the federal government for funding. Additionally, the Professor can present the same proposal to the university research department to request funding of the project.The University which employed the Professor will now fund that project research and make it public to members of the community about the research that the University is undertaking with the professor as the leader of the research.

8 0
3 years ago
Why should a linked list node be separate from the element stored on the list?
Daniel [21]

Explanation:

A linked list node should be separated from the element stored in the list because it is not reasonable to assume that the each object that we may want insert in the collection can be architectured to cooperate with the collection implementation.

Also the details of the implementation are to kept distinct from the user of that collection , including the elements that the user wants to add to his collection.

8 0
3 years ago
Which of the following best describes a hacktivist? Select one: a. An individual who attempts to destroy the infrastructure comp
brilliants [131]

Answer: (B) An individual who hacks computers or Web sites in an attempt to promote a political ideology

Explanation:

 Hacktivist is the defined as an individual that basically hacks the various types of web sites and computer system for promoting the various political ideologies. The hacktivists is the method which include the DDOS attacks (Distributed denial of services).

It basically causes various website and the email with the congestion of traffic with the computer virus and by the data stealing. The denial of services attacks typically considered federal crime and illegal in united state.  

4 0
4 years ago
It’s illegal to hack into a system without authorization, but is it ethical for a gray-hat to hack into a system if the intent i
oksian1 [2.3K]

Answer:

Some hackers are smart about there hacking .. others have a a plot but didnt test there theory

Explanation:

8 0
3 years ago
So, I am homeschooled, and I want to watch videos on my school account because I might be waiting for like emails from my teache
Jobisdone [24]

what web browser

if firefox go to addons and see if you can turn off mkaffee or something like that

or go incogneto

plese give me branliest good luck

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which is the correct process for selecting an entire row in a spreadsheet?
    15·2 answers
  • Which signal types are represented by a continuous wave form?
    11·1 answer
  • Use the get_seconds function to work out the amount of seconds in 2 hours and 30 minutes, then add this number to the amount of
    13·1 answer
  • You can run a macro by:
    10·1 answer
  • Which argument forces a writer to return and change the input berfore resolving unicode erroe
    8·1 answer
  • Write a user written function that expects as its input argument a vector of x values and a vector of corresponding y-values. Th
    15·1 answer
  • Two threads try to acquire the same resource at the same time and both are blocked. Then, they continually change their states i
    14·1 answer
  • A computer consists of both software and hardware. a)Define the term software​
    5·1 answer
  • PLEASE SOMEONE PLEASE HELP ME OUT!!!!
    10·2 answers
  • The events that happen in a story are called the _________________.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!