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
Margaret [11]
3 years ago
5

Write an expression that executes the loop body as long as the user enters a non-negative number. note: these activities may tes

t code with different test values. this activity will perform three tests, with usernum initially 9 and user input of 5, 2, -1, then with usernum initially 0 and user input of -17, then with usernum initially -1.
Computers and Technology
2 answers:
Elan Coil [88]3 years ago
3 0
If( usernum >= 0 )
{
   /* do something */
}
Lemur [1.5K]3 years ago
3 0

For the given problem, prompts the user to enter a number and then while loop is used to check whether a number is positive or not. Under the while loop body statement is printed and then input is stored in the user value. Then print the statement as ‘Done’.

Further Explanation:

Code: Following is the python code to that executes the loop body as long as the user enters a non-negative number.

#Prompt and read the input from the user

user_num = int(input('Enter a number:'))

#Loop is used to repeat the values of number

while (user_num>=0):

# If user enters a positive number then display the body statement.

print('Body')

user_num = int(input())

# Display the output.  

print('Done.')

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832  

3. The shape of our galaxy was determined ‘on the inside looking out' by surveying the milky way using ____________ telescopes. brainly.com/question/7866623

Answer details:

Grade: College Engineering

Subject: Computer Science and Engineering

Chapter: Python Programming

Keyword:

python, input, output, programming, statements, if-else, loops, print, body, done, positive, negative, number, display, non negative, prompt, problem, test code, usernum, test, activity

You might be interested in
Which disipline involves creating computer networks
Anestetic [448]

Answer:

computer science

The discipline of computer science includes the study of algorithms and data structures, computer and network design, modeling data and information processes, and artificial intelligence.

Explanation:

hope this helps

brainliest plz

5 0
3 years ago
Read 2 more answers
Which of the following is the last step in creating a budget?
sweet [91]
You answer to the question is C
3 0
3 years ago
Explain the application software and utility software in detail​
Vikentia [17]

Utility software is software designed to help analyze, configure, optimize or maintain a computer. It is used to support the computer infrastructure - in contrast to application software, which is aimed at directly performing tasks that benefit ordinary users.

In information technology, an application (app), application program or application software is a computer program designed to help people perform an activity. Depending on the activity for which it was designed, an application can manipulate text, numbers, audio, graphics, and a combination of these elements.

7 0
3 years ago
Which of the following is an example of a Boolean condition that Python could recognize?
Mila [183]
Your answer should be “B”.

i really hope i could help! good luck :)
7 0
4 years ago
Virtual classrooms are examples of communication or not​
3241004551 [841]

Answer:

I would say yes

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the purpose of a decision support system?
    13·1 answer
  • Which is a form of malware? A. clickjacking B. spam C. cookies D. Trojan horse
    7·2 answers
  • Type of file can a user send a technician in order to get help remotely, when using remote assistance
    5·1 answer
  • Why you think Operating System is pivotal in teaching and learning.
    13·1 answer
  • Hi hehehehehehehehehheeheh<br>​
    10·1 answer
  • IoT is the interconnection of what?<br> Hardware<br> Networks<br> Everyday devices<br> Cables
    10·1 answer
  • Describe the three essential characteristics of an object fromthe perspective of object oriented paradigm.
    7·1 answer
  • What is another term for additive manufacturing
    7·1 answer
  • The. Model has the disadvantage of high project cost due to creation several prototypes
    6·1 answer
  • on early ethernet networks, all computers were connected to a single wire, forcing them to take turns on a local area network (l
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!