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
LuckyWell [14K]
3 years ago
14

CHALLENGE ACTIVITY 4.2.2: Basic while loop with user input. Write an expression that executes the loop while the user enters a n

umber greater than or equal to 0. Note: These activities may test code with different test values. This activity will perform three tests, with user input of 9, 5, 2, -1, then with user input of 0, -17, then with user input of -1. See "How to Use zyBooks" . Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.
Computers and Technology
1 answer:
tino4ka555 [31]3 years ago
3 0

Answer:

#include<iostream>

using namespace std;

int main()

{

int userNum;

userNum=9;

while(userNum>=0)

{

  cout<<"Body"<<endl;

  cin>>userNum;

}

cout<<"Done"<<endl;

return 0;

}

Explanation:

  • Use the userNum >= 0 expression that executes the loop while the user enters a number greater than or equal to 0.
  • Print the userNum inside the while loop.
You might be interested in
Does coaxial cable use radio waves to transmit data
Elan Coil [88]
Coaxial cable<span>, or </span>coax<span> (pronounced </span><span>/<span>ˈkoʊ.æks</span>/</span><span>), is a type of </span>cable<span> that has an inner conductor surrounded by a tubular insulating layer, surrounded by a tubular conducting shield. Many coaxial cables also have an insulating outer sheath or jacket. The term </span>coaxial<span> comes from the inner conductor and the outer shield sharing a geometric axis. Coaxial cable was invented by English engineer and mathematician </span>Oliver Heaviside, who patented the design in 1880.[1]<span> Coaxial cable differs from other </span>shielded cable<span> used for carrying lower-frequency signals, in that the dimensions of the cable are controlled to give a precise, constant conductor spacing, which is needed for it to function efficiently as a </span>transmission line<span>.</span>
5 0
3 years ago
Read 2 more answers
Now now now now mowewweedeeee
gavmur [86]

Answer:

15

Inside the type declaration, you specify the maximum length the entry can be. For branch, it would be 15.

I can't seem to type the full "vc(15)" phrase because brainly won't let me.

4 0
3 years ago
This procedure protects against the loss of data
Arte-miy333 [17]
Data Backup and Recovery is the procedure that protects against the loss of data. It is to protect the crucial data against losing in events like physical disaster, database corruption, hardware failures, and other incident that can cause the data to lose.
6 0
3 years ago
Copy the countdown function from Section 5.8 of your textbook. def countdown(n): if n &lt;= 0: print('Blastoff!') else: print(n)
Lapatulllka [165]

Answer:

def countdown(n):

   if n <= 0:

       print('Blastoff!')

   else:

       print(n)

       countdown(n-1)

       

def countup(n):

   if n >= 0:

       print('Blastoff!')

   else:

       print(n)

       countup(n+1)

number = int(input("Enter a number: "))

if number >= 0:

   countdown(number)

elif number < 0:

   countup(number)

<u>Outputs:</u>

Enter a number: 3                                                                                                              

3                                                                                                                              

2                                                                                                                              

1                                                                                                                              

Blastoff!

Enter a number: -3                                                                                                              

-3                                                                                                                              

-2                                                                                                                              

-1                                                                                                                              

Blastoff!

Enter a number: 0

Blastoff!

For the input of zero, the countdown function is called.

Explanation:

Copy the countdown function

Create a function called countup that takes one parameter, n. The function counts up from n to 0. It will print the numbers from n to -1 and when it reaches 0, it will print "Blastoff!".

Ask the user to enter a number

Check if the number is greater than or equal to 0. If it is, call the countdown function. Otherwise, call the countup function.

4 0
3 years ago
Can I ask a computer question based on engineering?
mr Goodwill [35]
Yes you can

Hope this helps.!

6 0
3 years ago
Other questions:
  • Consider a relation representing the present position of molecules in a closed container. The attributes are the ID for the mole
    12·1 answer
  • What term refers to a piece of software that interfaces with the hardware on your computer?
    10·2 answers
  • Write a program that utilizes the concept of conditional execution, takes a string as input, and: prints the sentence "Yes - Spa
    8·1 answer
  • How should you handle possible suicides:
    10·1 answer
  • How do you customize Track Changes in a text document?
    11·1 answer
  • Your it department enforces the use of 128-bit encryption on all company transmissions. your department also protects the compan
    13·1 answer
  • Consider the following method:
    14·1 answer
  • I’ll mark brainliest, thanks
    10·2 answers
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • Read each of the following statements about Computer Science and explain why you think that statement is true.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!