answer.
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
Vsevolod
2 months ago
3

Write code that prints: Ready! countNum ... 2 1 Blastoff! Your code should contain a for loop. Print a newline after each number

and after each line of text Ex: countNum = 3 outputs: Ready! 3 2 1 Blastoff!
Computers and Technology
2 answers:
Harlamova29_29 [1K]2 months ago
4 0

Response:

C# Code:

#include <stdio.h>

// main function initiated

int main()

{

  // variables declared

  int userNum = 0;

  int i = 0;

  // assign userNum to 3

  userNum = 3;

  // print 'Ready!'

  printf("Ready!");

  // print new line

  printf("\n");

  // for-loop to print userNum ... 2 1

  for (i = userNum; i >= 1; i--)

  {

      // print current 'i' value

      printf("%d", i);

      // print new line

      printf("\n");

  } // for-loop concluded

  // print 'Blastoff!'

  printf("Blastoff!");

  // new line printed

  printf("\n");

 

  // exit program

  return 0;

} // main function concluded

Details:

oksian1 [950]2 months ago
4 0

Response:

import java.util.Scanner;

public class BlastOff {

   public static void main(String[] args) {

    Scanner in = new Scanner(System.in);

       System.out.print("Enter Count Down Number: ");

       int countNum = in.nextInt();

       System.out.println("Ready!");

       for(int i = countNum; i>0; i--){

           System.out.println(i);

       }

       System.out.println("Blastoff!");

   }

}

Details:

Using Java programming:

  • Request and acquire countdown number from the user with the scanner class
  • Display the text Ready! System.out.println("Ready!");
  • Utilize for loop to output numbers from countNum down to 1
  • After the loop, print Blastoff! System.out.println("Blastoff!");
  • Ensure that each output is on its separate line with .println()
You might be interested in
How can you check an orthographic drawing to be sure there are no missing lines
maria [1035]
Using a magnifying glass.
4 0
2 months ago
Skylar is viewing her personal and business calendar in a side-by-side fashion, but she would like to view a single calendar tha
Natasha_Volkova [1026]
Skylar should enable the Overlay option.
8 0
1 month ago
A regional trucking company landed a contract to supply products for a major retailer. To do this, it needs to hire an IT profes
zubka84 [1067]
I believe the answers are F and A
.
8 0
1 month ago
This question involves the creation of user names for an online system. A user name is created based on a user’s first and last
Rzqust [1037]

Response:

Refer to the explanation

Clarification:

import java.util.*;

class UserName{

ArrayList<String> potentialNames;

UserName(String fName, String lName){

if(this.isValidName(fName) && this.isValidName(lName)){

potentialNames = new ArrayList<String>();

for(int j=1;j<fName.length()+1;j++){

potentialNames.add(lName+fName.substring(0,j));

}

}else{

System.out.println("firstName and lastName should only consist of letters.");

}

}

public boolean isTaken(String name, String[] array){

for(int j=0;j<array.length;j++){

if(name.equals(array[j]))

return true;

}

return false;

}

public void removeUnavailableUserNames(String[] takenNames){

String[] namesArray = new String[this.potentialNames.size()];

namesArray = this.potentialNames.toArray(namesArray);

for(int j=0;j<takenNames.length;j++){

if(isTaken(takenNames[j],namesArray)){

int idx = this.potentialNames.indexOf(takenNames[j]);

this.potentialNames.remove(idx);

namesArray = new String[this.potentialNames.size()];

namesArray = this.potentialNames.toArray(namesArray);

}

}

}

public boolean isValidName(String str){

if(str.length()==0) return false;

for(int j=0;j<str.length();j++){

if(str.charAt(j)<'a'||str.charAt(j)>'z' && (str.charAt(j)<'A' || str.charAt(j)>'Z'))

return false;

}

return true;

}

public static void main(String[] args) {

UserName user1 = new UserName("john","smith");

System.out.println(user1.potentialNames);

String[] existing = {"harta","hartm","harty"};

UserName user2 = new UserName("mary","hart");

System.out.println("potentialNames prior to removal: "+user2.potentialNames);

user2.removeUnavailableUserNames(existing);

System.out.println("potentialNames following removal: "+user2.potentialNames);

}

}

8 0
2 months ago
What type of hardware enables users to interact with a computer? Check all that apply. the CPU the hard disk drive the keyboard
zubka84 [1067]

Answer:

the keyboard

the monitor

the mouse

Explanation:

just completed the test

6 0
1 month ago
Read 2 more answers
Other questions:
  • Why computer is known as versatile and diligent device ?explain​
    14·1 answer
  • Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
    6·2 answers
  • Charlie has a large book collection. He was keeping track of it in a spreadsheet, but it has grown big enough that he wants to c
    10·1 answer
  • Debug the program so it prints the factorial of a positive integer entered by the user. This is calculated by multiplying all th
    9·1 answer
  • If a database named Contacts has a table named tblEmployees and another database named Orders links to that tblEmployees table,
    8·1 answer
  • Which kind of file would be hurt most by lossy compression algorithm
    8·2 answers
  • Use Excel to develop a regression model for the Consumer Food Database (using the "Excel Databases.xls" file on Blackboard) to p
    13·1 answer
  • To be a successful computer systems engineer, you must be proficient in programming languages and operating systems. Similarly,
    5·2 answers
  • Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els
    15·2 answers
  • Write the execution steps if the input is a lion.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!