subject
Engineering, 14.04.2021 14:00 piratesfc02

A number (or a word) is called palindrome if it may be read in the same way from left to right as right to left (e. g. 131 and 56965). Write a Java application that reads from the user a positive integer consists of exactly 5 digits. Then separates the integer into its individual digits and prints a message indicating if this integer is palindrome or not. The program should print an error message if the number is not positive and not composed of 5 digits. Hint: Use % 10 in order to extract the last digit of an integer and / 10 in order to eliminate the last digit of an integer. For example, 942 % 10 = 2 and 942 / 10 =94. Sample run1: Enter a positive integer (5 digits): -12345 The number should be positive and of 5 digits Sample run2: Enter a positive integer (5 digits): 123 The number should be positive and of 5 digits Sample run3: Enter a positive integer (5 digits): 12321 12321 is a palindrome Sample run4: Enter a positive integer (5 digits): 12345 12345 is not palindrome

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 19:30
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
question
Engineering, 04.07.2019 18:10
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
question
Engineering, 04.07.2019 18:10
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
question
Engineering, 04.07.2019 18:10
Aturning operation is performed with following conditions: rake angle of 12°, a feed of 0.35 mm/rev, and a depth of cut of 1.1 mm. the work piece is aluminum alloy 6061 with t6 heat treatment (a16061-t6). the resultant chip thickness was measured to be 1.0 mm. estimate the cutting force, fc. use shear stress of 207 mpa and coefficient of friction on the tool face of 0.6.
Answers: 1
You know the right answer?
A number (or a word) is called palindrome if it may be read in the same way from left to right as ri...
Questions
question
Mathematics, 22.07.2019 15:30
Questions on the website: 13722360