Answer:
import java.util.Scanner;
public class PalindromeInteger {
public static void main(String[] args) {
// Create an object of the Scanner class to allow for user's inputs
Scanner input = new Scanner(System.in);
// Create a prompt to display the aim of the program.
System.out.println("Program to check whether or not a number is a palindrome");
// Prompt the user to enter an integer number.
System.out.println("Please enter an integer : ");
// Receive user's input and store in an int variable, number.
int number = input.nextInt();
// Then, call the isPalindrome() method to check if or not the
// number is a palindrome integer.
// Display the necessary output.
if (isPalindrome(number)) {
System.out.println(number + " is a palindrome integer");
}
else {
System.out.println(number + " is a not a palindrome integer");
}
}
// Method to return the reversal of an integer.
// It receives the integer as a parameter.
public static int reverse(int num) {
// First convert the number into a string as follows:
// Concatenate it with an empty quote.
// Store the result in a String variable, str.
String str = "" + num;
// Create and initialize a String variable to hold the reversal of the
// string str. i.e rev_str
String rev_str = "";
// Create a loop to cycle through each character in the string str,
// beginning at the last character down to the first character.
// At every cycle, append the character to the rev_str variable.
// At the end of the loop, rev_str will contain the reversed of str
for (int i = str.length() - 1; i >= 0; i--) {
rev_str += str.charAt(i);
}
// Convert the rev_str to an integer using the Integer.parseInt()
// method. Store the result in an integer variable reversed_num.
int reversed_num = Integer.parseInt(rev_str);
// Return the reversed_num
return reversed_num;
}
// Method to check whether or not a number is a palindrome integer.
// It takes in the number as parameter and returns a true or false.
// A number is a palindrome integer if reversing the number does not
// change the number itself.
public static boolean isPalindrome(int number) {
// check if the number is the same as its reversal by calling the
//reverse() method declared earlier. Return true if yes, otherwise,
// return false.
if (number == reverse(number)) {
return true;
}
return false;
}
}
Explanation:
The source code file for the program has also been attached to this response for readability. Please download the file and go through the comments in the code carefully as it explains every segment of the code.
Hope this helps!
a)To document an antivirus pattern that continues to be sent to your mailbox
b)To insert as a Signature for all outgoing emails
c) To save your emails so that you can restore your mailbox if necessary
d)To create a file that deleted emails will be sent to for deletion
The purpose of creating a PST file is to
c) To save your emails so that you can restore your mailbox if necessary
Explanation:
B) ring
C) bus
D) all of the above
Answer:
ring
Explanation:
Answer:
The correct answer is D)
Data in a Flat File System can be easily managed.
Explanation:
When every file in the database is stored under a different name, it is often referred to as a Flat File System.
This system of filing is common with all Windows 95 computers and other operating systems since it's launch.
In a Flat File System, files are organised in a hierarchical file system with a hierarchy of directories and subdirectories, with every directory containing a certain number of files.
Cheers!
Answer:
c. 27
Explanation:
environmentvariable.
resultvariable.
independentvariable.
constant.
Answer: An objective function in linear programming is a decision variable.
Explanation: An objective function is a function which has the target towards the model whether it should be maximized or minimized according to the relation between the variables present in the function. There are set of variables which are responsible for the controlling of objective function that is known as decision variables.
Answer:
Following are the code to the given question:
user_num = int(input())#defining a variable user_num that takes input from user-end
x = int(input())#defining a variable x that takes input from user-end
for j in range(3):#defining for loop that divides the value three times
user_num = user_num // x#dividing the value and store integer part
print(user_num)#print value
Output:
2000
2
1000
500
250
Explanation:
In the above-given program code two-variable "user_num and x" is declared that inputs the value from the user-end and define a for loop that uses the "j" variable with the range method.
In the loop, it divides the "user_num" value with the "x" value and holds the integer part in the "user_num" variable, and prints its value.