Write a method that returns the last digit of an integer

Assignment Help JAVA Programming
Reference no: EM13702983

Question: Write a method named lastDigit that returns the last digit of an integer.

For case, lastDigit(3572) should return 2. It should work for negative numbers as well.

For case, lastDigit(-947) should return 7.

Can you make a program that returns the last digit?

 

Reference no: EM13702983

Questions Cloud

Finds the location of the largest even integer : Describe an algorithm that takes as input a list of n distinct integers and finds the location of the largest even integer in the list or returns 0 if there are no even integers in the list.
Implement the recursive version of the binary search : Write the code to test it out on a sample input. Compare its complexity with the iterative version found in the text book.
Choose a combination of meaningful data structures : Describe a mechanism to access the telephone customer records by telephone #. Assume that we have a huge data in hand, say a million records or so.
Examples of suitable values for each of subsequent type : Give examples of suitable values for each of the subsequent type expressions. Do not use the empty list as the value for any list component.
Write a method that returns the last digit of an integer : Write a method named lastDigit that returns the last digit of an integer - It should work for negative numbers as well.
Ask the user to enter the desired character : Write a very simple c program which will Ask the user to enter the desired character- Repeat the asking part until the user types a desired letter. For each even number of attempts
How many parameters are supposed to be passed : How many parameters are supposed to be passed to the constructor or how big to create the array - Method Union comparing two different objects?
Create a program in any language that simulates a dfa : Create a program in any language that simulates a DFA that will accept a string 011(representation of 3 in binary) and reject everything else.
Prove or disprove the statement : What if the segments could intersect each other, but must all have unique slopes?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

  Implement simple java program to input syllabus grades

To implement simple Java program to input (hypothetical) syllabus grades, computing and displaying both normal Mean and Harmonic Mean.

  Write the methods used in section two of main

Write the constructor for the SortTraversableLinkedList. It should create the head and tail nodes, and set the size of the list to 0, as in a typical linked list.

  Assume an ideal gas mixture is in contact with water

Assume an ideal gas mixture is in contact with water. Determine the equilibrium concentration of the contaminant in the liquid is the gas stream is composed of 200 ppm of benzene in air

  Write program that convert us dollar into canadian dollar

Design a new class named Polygon that extends GeometricObject and implements Comparable. The number of sides in polygons varies, you cannot use a certain number of data fields for sides of a polygon - Write a program that passes an unspecified numb..

  One acre of land is equivalent to

One acre of land is equivalent to 43,560 square feet. Write a program that calculates the number of square feet in a tract of land with 3.5acres.

  Prepare address book java application

Prepare an application that reads the contents of your address book file and prepare a user guide that includes a description of the functionality of your overall address book system.

  Write java program to reverse contents of original array

Write down the Java program method named reversal which returns the new array which is a reversal of original array. Use [5.0, 4.4, 1.9, 2.9, 3.4, 3.5] to test method.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  One search function

One search function will use a sentinel to mark the end of the array. The other search function will use an array length (maximum legal index into the array) to determine when to exit the search loop. Both functions must return true when the searc..

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Improve the word jumble game

Improve the Word Jumble game presented in this chapter so that each word is paired with a hint. If the player enters hint, then the program should show the corresponding hint.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd