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.
Answer:
the system development life cycle (SDLC) is the overall process of developing, implementing, and retiring information systems through a multistep process—initiation, analysis, design, implementation, and <u>maintenance to disposal.</u>
Explanation:
There are several SDLC models and each generally consists of a numbers of definite stages. For a given adopted SDLC model, information security and product services must be integrated in to the SDLC to ensure appropriate protection for the information that the system will transmit, process, and store.
Answer:
PART ONE
- import java.util.Scanner;
- public class CountToLimit {
- public static void main(String[] args) {
- Scanner scnr = new Scanner(System.in);
- int countLimit = 0;
- int printVal = 0;
- // Get user input
- System.out.println("Enter Count Limit");
- countLimit = scnr.nextInt();
- do {
- System.out.print(printVal + " ");
- printVal = printVal + 1;
- } while ( printVal<=countLimit );
- System.out.println("");
- return;
- }
- }
PART TWO
- import java.util.Scanner;
- public class NumberPrompt {
- public static void main (String [] args) {
- Scanner scnr = new Scanner(System.in);
- System.out.print("Your number < 100: ");
- int userInput = scnr.nextInt();
- do {
- System.out.print("Your number < 100: ");
- userInput = scnr.nextInt();
- }while (userInput>=100);
- System.out.println("Your number < 100 is: " + userInput);
- return;
- }
- }
Explanation:
In Part one of the question, The condition for the do...while loop had to be stated this is stated on line 14
In part 2, A do....while loop that will repeatedly prompt user to enter a number less than 100 is created. from line 7 to line 10
can do c++ and javascript but I might be able to help
send me a message
Word Wrap
As the name allows, the word wraps around the document once it reaches the border, thus making it the answer.
Hope this helps!