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
sesenic [268]
3 years ago
12

Write code that prints: Ready! firstNumber ... 2 1 Run!

Computers and Technology
1 answer:
motikmotik3 years ago
3 0

Answer:

The program to this question can be defined as follows:

Program:

num=int(input("Enter any number: ")) #defining variable num, that take value from user

val=0; #defining variable val

for i in range(num): #defining loop to calculate value in decreasing order

   val=num-i; #holding value in variable

   print(val) #print value

Output:

Enter any number: 3

3

2

1

Explanation:

In the above-given code, a variable "num" is declared, that uses input function to take value from the user end, in the next line a "val" variable is defined, that calculates values and print it in decreasing order.

  • In the next step, a for loop is declared, inside the loop a "val" variable uses num and loop variable "i" to calculate the value in decreasing order.
  • In the last print method is used that prints "val" variable value.
You might be interested in
Which factor is NOT used to determine who can be let go during a downsizing?
OverLord2011 [107]
It’s C- gender. Hope this helped!
8 0
2 years ago
Read 2 more answers
Create an application (that uses the SortedABList) that allows a user to enter a list of countries that he or she has visited an
gulaghasi [49]

Answer:

import java.util.*;

public class Country

{

  public static void main(String args[])

  {

      char ch,temp;

      int flag = 0;

      String country;

      ArrayList<String> countries = new ArrayList<String>();

      Scanner sc = new Scanner(System.in);

      do

      {

          System.out.println("enter the country you have visited:\t");

          country = sc.next();

          for(int i=0;i<countries.size();i++)

          {

              if(countries.get(i).equals(country))

              {

                  System.out.println("you have already entered the country");

                  flag = 1;

                  break;      

              }

          }

          if(flag == 0)

          {

              countries.add(country);

              flag = 0;

          }

          System.out.println("want to add another country(y/n):\t");

          ch = sc.next().charAt(0);

      }while(ch!='n');

      Collections.sort(countries);

      System.out.println("Countries you have visited:\t"+countries);

      System.out.println("Total number of contries visited:"+countries.size());

     

  }

}

Explanation:

8 0
3 years ago
________ returns the last character in a StringBuilder variable named strBuf? Select one: A. strBuf.charAt(strBuf.length() - 1)
Lunna [17]

Answer:

A

Explanation:

strBuf.charAt(strBuf.length() - 1)

4 0
3 years ago
Draw the hierarchy chart and then plan the logic for a program that calculates a person’s body mass index (BMI).
dusya [7]

Explanation:

I have attached the answer as an image. I can't upload the file as it requires a licensed product and I only used demo version. I can provide the file too if you can give me your vlsig file required to use full software. However, If you just copy along the images on your Visual Studio, you will easily create the files yourself. Answer is provided for both scenarios as part A and part B, one which stops after 1 iteration and the one which loops until 0 height is given.

8 0
2 years ago
When the "swen" virus infected someone's system, it made significant changes to the registry that caused it to be extremely diff
Effectus [21]
<span>In certain cases, when the Swen executable is removed or renamed by an anti virus program without stopping to fix the registry, it then will become impossible to run any executable files on the machine. This happens because windows will be unable to find the file that is associated with any executables on it's hard drive.</span>
7 0
2 years ago
Other questions:
  • You have installed a streaming video service on your network. You want selected hosts to be able to access this service via a dy
    6·1 answer
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • Xml is used to format the structure and style of a web page. true or false
    7·1 answer
  • On a Linux system, which command allows you to modify settings used by the built-in packet filtering firewall?
    15·1 answer
  • Number 20, can anyone help?
    11·1 answer
  • What is a win-win situation?
    5·1 answer
  • which three objects can be linked or embedded in a word document? A. worksheets, margins, colors B. charts, worksheets, images C
    7·1 answer
  • I have lost the watch (that,which) you gave me​
    12·1 answer
  • Which of the following are valid calls to Math.max? 1. Math.max(1,4) 2. Math.max(2.3, 5) 3. Math.max(1, 3, 5, 7) 4. Math.max(-1.
    9·1 answer
  • Hi who plays among us
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!