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
Setler79 [48]
3 years ago
14

Write a application that can determine if a 5 digit number you input is a palindrome. If the number is a palindrome then print "

The number is a palindrome." If it is not then print "The number is NOT a palindrome"
Computers and Technology
1 answer:
notsponge [240]3 years ago
4 0

Answer:

Written in Python:

num = int(input("Number: "))

strnum = str(num)

if len(strnum) !=5:

    print("Length must be 5")

else:

    if(strnum[::-1] == strnum):

         print("The number is a palindrome.")

    else:

         print("The number is NOT palindrome.")

Explanation:

This prompts user for input

num = int(input("Number: "))

This converts user input to string

strnum = str(num)

This checks the length of the string

if len(strnum) !=5:

    print("Length must be 5") If length is not 5, this prompt is printed

else:If otherwise

    if(strnum[::-1] == strnum): The compares the string reversed with the original

         print("The number is a palindrome.") If both are the same, this line is executed

    else:

         print("The number is NOT palindrome.") If otherwise, this line is executed

You might be interested in
Copyright laws protect:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this task a
agasfer [191]

B- Copyright laws protect original works both online and in print.

3 0
2 years ago
.All of the following are true with the respect to implicitinvocation except:
katrin2010 [14]

Answer: D) components are instances of abstraction

Explanation:

As, implicit invocation is the process by which it is used by the the software designer for styling the architecture of the software,where the event handling structured are formed in the system. The main aim of the implicit invocation is to separated the conceptual concern for maintaining or improving the ability of the software engineer. It is basically based on the notion of the broadcasting and based on the event driven. The components are the instance of the abstraction which are not used as the components in implicit invocation which are relinquished control the system over the computational performance,this is the major disadvantage of the implicit invocation.  

6 0
2 years ago
What does brainliest do?
balandron [24]

Answer it gives u points I think

Explanation:

6 0
2 years ago
Read 2 more answers
The ArrayList class contains a trim method that resizes the internal array to exactly the capacity. The trim method is intended
andreev551 [17]

Answer:

public void trimToSize() {

modCount++;

if (size < elementData.length) {

elementData = (size == 0)

? EMPTY_ELEMENTDATA

: Arrays.copyOf(elementData, size);

}

}

Now, the running time for copyOf() function is O(N) where N is the size/capacity of the ArrayList. Hence, the time complexity of trimToSize() function is O(N).

Hence, the running time of building an N-item ArrayList is O(N^2).

Please find the sample code below.

CODE

==================

import java.util.ArrayList;

public class Driver {

  public static void main(String[] args) throws Exception{

      int N = 100000;

      ArrayList<Integer> arr = new ArrayList<>(N);

     

      long startTime = System.currentTimeMillis();

      for(int i=0; i<N; i++) {

          arr.add(i);

          arr.trimToSize();

      }

      long endTime = System.currentTimeMillis();

      double time = (endTime - startTime)/1000;

      System.out.println("Total time taken = " + time + " seconds.");

  }

}

Explanation:

5 0
3 years ago
Audience centered public speakers are inherently sensitive to the
DanielleElmas [232]
Diversity of their audiences
7 0
2 years ago
Read 2 more answers
Other questions:
  • Which IPv6 transition technology can be used with NAT routers and has the address prefix 2001::32?
    10·1 answer
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • How do you take a screenshot on an iPhone?
    8·2 answers
  • PLEASE HELP ASAP!!!
    8·1 answer
  • What is the full form of ABC?
    9·2 answers
  • Using the Vigenere cipher, does the length of the key matter?
    8·1 answer
  • When gathering information about certain occupations, be sure to understand how you are paid. What is the difference between a s
    12·2 answers
  • Look at the following program and answer the question that follows it. 1 // This program displays my gross wages. 2 // I worked
    8·1 answer
  • Describe your ideas for a keyboarding game that would help someone improve their skills.
    6·1 answer
  • Amogus :0) owo have a good day y'all
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!