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
Hitman42 [59]
2 years ago
11

Please help! Program with Variables

Computers and Technology
1 answer:
Elza [17]2 years ago
5 0

Ask anything here: https://www.answers.com/search?q=Ask%20any%20question&filter=all

You might be interested in
(Palindrome integer) Write the methods with the following headers // Return the reversal of an integer, i.e., reverse(456) retur
Debora [2.8K]

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!

Download java
7 0
2 years ago
Define the acronym WAECUP and its components
Mariana [72]

WAECUP stands for waste, accident, error, crime, and unethical practices.

Assuming that the components are the same as what's included in the acronym, that should be your answer.

Hope this helps!

8 0
2 years ago
What role does javascript play in a web page
luda_lava [24]

Answer:

Js is an programming language usually used for coding. It is used on most browsers to produce an effective and interactive design for some users.

6 0
2 years ago
You work for a company that does network cable installations. Your company has been contracted to pull out the existing CAT 3 wi
kicyunya [14]

Answer:

RJ-11 connector.

Explanation:

RJ-11 (Registered Jack-11) also known as the phone line or modem port is a network cable having twisted wire pairs and a modular jack with two, four or six contacts. It is generally used with telephones and modem.

Hence, the other connector type that can be used with CAT 3 installations is the RJ-11 connector.

5 0
3 years ago
Which of the following is the correct order for arranging these titles in a subject filing system? A. Applications, Banking Serv
Ket [755]

Answer:

The correct answer is option (A) Applications, Banking Services, Customer Service

Explanation:

Solution

Methods of filing

There are 5 methods of filing:

• Filing by Subject/Category

• Filing in Alphabetical order

• Filing by Numbers/Numerical order

• Filing by Places/Geographical order

• Filing by Dates/Chronological order

In this case, we can fill by Alphabetical order which is given below

Applications, Banking Services, Customer Service

7 0
3 years ago
Other questions:
  • What does limited access to a document mean?
    14·2 answers
  • printLarger is a method that accepts two int arguments and returns no value. Two int variables, sales1 and sales2, have already
    11·1 answer
  • What do u say to your bf if he says sayy lesssss
    14·2 answers
  • Given the following sets, for each set operation provide the elements of the resulting set in set notation or using a well-known
    5·1 answer
  • Colin Mackay Inc., a software company with its head office in Amsterdam, has employees across three continents. Certain project
    11·1 answer
  • What is the purpose of the "time-to-live" (TTL) field of the IPv4 packet? a. ensures that the packet remains in the network long
    6·1 answer
  • Write a structured algorithm that prompts the
    9·1 answer
  • Acciones de un lápiz
    7·1 answer
  • Can you anyone please help me​
    13·1 answer
  • When can screentips be useful? when finding a tab when looking for a command when pinning the ribbon when using a command.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!