Trying to get the 1st character from an int

Hello all,
Ill try to make this as easy to explain as possible.
I want to get the 1st number of the int that the person enters
so for example: 100
then i want to get 1
200
then 2
and so on...
Here is the code so far. It works, but i just dont know where to get it from and i need it to be able system.println it.
Once again, thank you.
package bars;
public class Employee {
// class constants
// Data fields
private String custName;
private String custAddress;
private double rate;
private int custID;
private double steve;
public Employee(int id, String name, String adress, double ra) {
custName = name;
custAddress = adress;
rate = ra;
custID = id;
public String toString() {
return "Customer ID: "+ custID + "Customer Name : " + custName +
"Customer Adrress" + custAddress + "rate: $" + rate ;
public int getBalls(){
return custID;
public String getBallsy(){
return custAddress;
public double getRate(){
return rate;
the other one...
package bars;
import javax.swing.JOptionPane;
import javax.swing.*;
import java.util.*;
public class EmployeeApp {
//methods
private static int readInt (String prompt){
String numStr = JOptionPane.showInputDialog(prompt);
return Integer.parseInt(numStr);
private static double readDouble (String prompt){
String numStr = JOptionPane.showInputDialog(prompt);
return Double.parseDouble(numStr);
public static void main (String[] args){
//read and store the payroll data in an employee object
Vector programmers = new Vector();
for (int i = 0; i < 1; i++) {
Employee programmer =
new Employee(
readInt("Enter Customer ID: "),
JOptionPane.showInputDialog("Name: " ),
JOptionPane.showInputDialog("Address: "),
readDouble ("Enter hourly rate: ")
int steve = programmer.getBalls();
int bob = steve;
programmers.add(programmer);
System.out.println("here: " + steve);
System.out.println(programmers.toString());

I am not sure what you want, but this method will return the left digig.
public int getLd(int n)
     if (n > 10) return(getLd(n/10));
          else       return(n);
}Noah

Similar Messages

  • HT201328 I am trying to get the unlock code from ATT

       I am trying to get the unlock code from ATT for my Iphone 4S bought in an Apple store, and now they refused to give it, because it is reported as stolen.
    I have all the invoices and recepts, .
    How can I do to unlock the phone if they continue in their negative and hostile attitude???
    Thanks,
    Paul
    [email protected]

        hipichik Hello there. Let's get more specific information. What type of lock code are you referring to? And what are you looking to do with your phone?
    SheritaH_VZW
    Follow us on Twitter
    @VZWSupport

  • I lost all of my Itunes music because of an infection that required them to wipe my computer.  I am trying to get the music back from multiple sources.  What I have recovered is a mess. Albums are mixed or songs not grouped as album. Help?

    My computer got infected with some terrible virus.  I contacted the manufacturer and they said the only thing to do was wipe the whole thing. I could not back it up bec this mess?ause it would include the infection. I have been trying to recover the lost music from several different places.  A friend tried to help me by putting all of his music on my computer from his external hard drive. That was very nice of him but now it is a terrible mess. The recovered songs are not grouped into albums correctly.  Some albums are mixed - every other song is from the other album.  Some songs are listed separately and not grouped as an album.  I tried to ask iTunes to find album art work and it has been running that for over 48 hours. Is that possible?  When I try to stop it I get a message that says I will lose all the data.  I admit that I am not very tech. savvy and I really don't know what I am doing.  It took me more than 20 years to make that collection and I am heart broken. Do you have any ideas about how I start to fix

    Unfortunately you've discovered too late how important it is to maintain an up-to-date backup of your iTunes library (and all other data of value).  You could, before wiping the drive, have considered making use of a commercial data recovery service that could (albeit at considerable cost) have extracted your library from the hard disk, even if virus infected.
    In the absence of that option, you will need to restore the content of your library from its original sources:
    Depending on your location, you may be able to re-download any iTunes Store purchases that are still available on the Store
    Likewise, most digital purchases from Amazon (including auto-rip copies of purchased CDs) should be available from the Amazon Cloud and via the Amazon Music application - the same may be true of other commercial sources for digital downloads
    Content imported from your CDs will have to imported again
    The specific situation that you describe regarding the music imported from your friend's external HDD suggests that either the source is badly organized and/or originates from a source other than iTunes (other media players may use alternative tags for information like artist, title, album, etc. that are not wholly consistent with how iTunes handle these).  Without details of the issues you're seeing it is difficult to suggest a remedy other than going through the media album-by-album, track-by-track, and correcting the inconsistencies.
    In the absence of a backup or access to the original library data there is no option other than painstakingly recreating your library as described above.  As you do so, you'll now realize how important creating and maintaining backups are - in my case I have at all times three separate duplicates of my library, in two different locations, where none is ever more than a week old compared to the content of my master library.

  • Trying to get the last row from a resultset

    Hi,
    I'm trying to do a query to postgreSQL and have it return the last updated value, (last row).
    My prepared statement is returning the correct results, but i'm having a problem getting the latest value.
    I'm using a comboBox to drive a textfield, to load the last entered values in depending on which item in the comboBox is selected.
    I've tried a variety of things and most seem to return the first row, not showing the updated values.
    Or, if it does work, it takes to long to load, and i get an error.
    here is the working code;
    Object m = machCBX.getSelectedItem():
    try { PreparedStatment last = conn.prepareStatement("SELECT part, count FROM production WHERE machine = ?",
    ResultSet.TYPE_SCROLL_INSENSITIVE,  //tried both INSENSITIVE and SENSITIVE
    ResultSet.CONCUR_READ_ONLY);
    last.setString(1, String.valueOf(m));
    rs. = last.executeQuery();
    if(rs.isAfterLast) == false ) {
    rs.afterLast();
    while(rs.previous()) {
    String p = rs.getString("part");
    int c = rs.getInt("count");
    partJTX.setText(p);
    countJTX.setText(c);
    }this grabs values, but they are not the last entered values.
    Now if i try to use rs.last() it returns the value i'm looking for but takes to long, and i get:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space I also know using ra.last() isn't the best way to go.
    I'm just wondering if there is another way other than getting into vectors and row count? or am i better off to go with the later?
    thanks
    -PD

    OK, you've got a major misunderstanding...
    The relational database model is built on the storage of sets - UNORDERED sets. In other words, when you hand a database a SELECT statement without an ORDER BY clause, the database is free to return the results in any order.
    Now it so happens that most databases will happen to return data retrieved by an unordered SELECT, at least for a while, in the same order that it was inserted, especially if no UPDATE or DELETE activity has occured, and no database maintenance has occured. However, eventually most tables have some operation that creates a "space" in the underlying storage, or causes a row to expand and have to be moved or extended, or something. Then the database will start returning unordered results in a different order. If you (or other people) never ever ever UPDATE or DELETE a table, then on some databases the data might well come out in insertion order for a very very long time; given human nature and the way projects tend to work, relying on that is a sucker's bet, IMHO.
    In other words, if you want the "most recent" something, you need to store a timestamp with your data. (With some databases, you might be able to take advantage of some non-standard feature to get "last updates" or "row change timestamps", but I know of no such for Postgres.
    While this won't solve your major problem, above, your issue with rs.last is probably occuring because Postgres by default will prefetch your entire ResultSet. Use Statement.setFetchSize() to change that (PreparedStatement inherits the method, of course).

  • Strip the first character from a string

    i am trying to strip the leftmost character from a string
    using the following:
    <cfset Charges.DTL_CHG_AMT_EDIT =
    #Right(Charges.DTL_CHG_AMT_EDIT,Len(Charges.DTL_CHG_AMT_EDIT)-1)#>
    i keep getting the following error:
    Parameter 2 of function Right which is now -1 must be a
    positive integer

    > RemoveChars() much easier than Right()? How so?
    Semantically, if the object of the exercise is to *REMOVE
    CHARacters from a
    string* (which it is, in this case), it is simply better
    coding to use
    removeChars() rather than right(). That, and it's one less
    function call
    (the RIGHT() solution also requires a call to LEN() for it to
    work).
    So removeChars() is "easier" because it reflects the intent
    of the exercise
    directly, is simpler logic, is easier to read, and - I can't
    be arsed
    counting keystrokes - is probably less typing.
    That'd be how.
    Adam

  • Getting the file type from a placed file

    Hi
    I am trying to get the file type from items placed on a page. I know the types available has one of the three interfaces "IImageAttributes", "IEPSAttributes" or "IPDFAttributes", but how can i test whether the placed image is a TIF, JPG ... Of course i could test on the suffix or the file type (mac), but that isnt "secure" enough, since InDesign can place files with no filetype or extension, if they are in an importable format.
    What I want in short, is to read the filetype shown in the Info palette, any one knows how to do this?
    Jon

    Thanks, I did take a look in these interfaces, but that didnt solve the problem for eps, pdf and other none raster types.
    Instead I found the:
    IDataLink->GetNameInfo()
    Which gives me the string from the Info palette.

  • Tokenizer - getting the third node from this format (800,PA,PAC,Package)

    Hi Folks,
    I am trying to get the third node from the following format: 800,PA,PAC,Package
    The correct output is PAC.
    Your help is very much appreciated!
    Just to add the code that I have is as follows:
    Import com.sap.mw.jco.*;
    //write your code here
    String DBTABLE = a;
    String WHERE_CLAUSE = b+" = "+"'"c"'" ;
    //...some code in here...
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("RFC_READ_TABLE");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( DBTABLE, "QUERY_TABLE");
    input.setValue( "," , "DELIMITER");
    //Fill the where clause of the table
    JCO.ParameterList tabInput = function.getTableParameterList();
    JCO.Table inputTable = tabInput.getTable("OPTIONS");
    inputTable.appendRow();
    inputTable.setValue(WHERE_CLAUSE,"TEXT");
    mConnection.execute( function );
    //This is the part where the output is generated
    JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
    String resultSet = valueSet.getString("WA"); //WA contains 800,PA,PAC,Package
    mConnection.disconnect();
    return resultSet;

    Hi Morgalr,
    Thank your for the tip.
    I am not sure if there is a better way to do the coding. But what what I have come up is the following:
    JCO.Table valueSet = function.getTableParameterList().getTable("DATA");
    String resultSet []= valueSet.getString("WA").split("(double \ in here),");
    mConnection.disconnect();
    return resultSet[2];
    Let me know if this works with you.
    regards,
    Lex

  • How could I get the Finish10 value from MS Project2010 Server_Reporting database

    I am trying to get the finish10 data from project server using SQL.
    But it seems the finish10 column is not in MSP_EpmAssignment_Userview or MSP_EpmTask_Userview.
    So could you please help me to find it?
    Thanks.

    Hi,
    try to extract information from MSP_EpmTaskBaseline.
    This is Sql query
    SELECT MSP_EpmTask_UserView.TaskName, MSP_EpmTaskBaseline.TaskBaselineFinishDate, MSP_EpmTaskBaseline.TaskBaselineStartDate,
    MSP_EpmTaskBaseline.BaselineNumber
    FROM MSP_EpmTaskBaseline INNER JOIN
    MSP_EpmTask_UserView ON MSP_EpmTaskBaseline.TaskUID = MSP_EpmTask_UserView.TaskUID
    WHERE (MSP_EpmTaskBaseline.BaselineNumber = 10)
    if doesn't work try to rebuild your reporting database.
    Hope this help you.
    Jalal Blali MCTS, MCITP
    Thanks for the help, but I'm trying to extract columns named [finish10], not [baseline1 ~10 finish].

  • Ive just got a new iPhone4 and I am trying to get the App's ie games from my iPhone3 onto the 4 and retain the same levels that I have reached on the 3, The Apps have gone onto the 4 but its making me re-start everything from level 1?

    Ive just got a new iPhone4 and I am trying to get the App's ie games from my iPhone3 onto the 4 and retain the same levels that I have reached on the 3,
    The Apps have gone onto the 4 but its making me re-start everything from level 1?
    Ive paid $$ for the games and then more $$ within the games via iTunes for in game purchases and desperatly want the games on the 4 with the levels that I have reached on the 3!
    Can anyone help!! Please!!!! My Smurfs and Animals are starving Hahahaha

    Mate, it's good to hear that you have gotten the iPhone 4 but sorry to burst your bubbles. Not all games can have the "saved" data ported over.
    Normally when you save a game in iPhone, the memory used is in the flash memory of the device. Those that can be ported over, reason is due to the data being saved over the air and when you logged in on a new device, it recognises you via the userID.
    Maybe you can try to backup your iPhone 3, and restore the file onto your iPhone 4. Not too sure if that would brick your phone though.

  • Trying to get the top N records from a query.

    Hello,
    Im trying to get the top N records of a random query. I've been looking for a decent solution for a while now and the 2 solutions I've come across are:
    select *
    from (select * from qrs_klantgroepen order by code) a
    where rownum < 10
    ORA-00907: missing right parenthesis
    The query works when I remove the order clause from the subquery, but it's mandatory to get the results I need.
    The next solution:
    select *
    from (select code, row_number() over (order by code) from qrs_klantgroepen) a
    where rownum < 10
    ORA-00923: FROM keyword not found where expected
    Apparently the construct used here isn't supported by my oracle version.
    I'm using oracle Oracle8 Enterprise Edition Release 8.0.5.2.1.
    Is there another way I can achieve the results I want?
    Looking forward to your replies.
    Frederik

    it must be nostalgy, but I would try something like
    SQL> select * from emp e where 5>(select count(*) from emp where ename<e.ename) order by ename;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 1987-05-23_00:00:00       1100                    20
          7499 ALLEN      SALESMAN        7698 1981-02-20_00:00:00       1600        300         30
          7698 BLAKE      MANAGER         7839 1981-05-01_00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 1981-06-09_00:00:00       2450                    10
          7902 FORD       ANALYST         7566 1981-12-03_00:00:00       3000                    20
    SQL> select * from (select * from emp order by ename) where rownum<6;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7876 ADAMS      CLERK           7788 1987-05-23_00:00:00       1100                    20
          7499 ALLEN      SALESMAN        7698 1981-02-20_00:00:00       1600        300         30
          7698 BLAKE      MANAGER         7839 1981-05-01_00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 1981-06-09_00:00:00       2450                    10
          7902 FORD       ANALYST         7566 1981-12-03_00:00:00       3000                    20Message was edited by:
    Laurent Schneider

  • Trying to setup wifi, how do I get the mac address from ipod touch 5th gen?

    trying to setup wifi, how do I get the mac address from ipod touch 5th gen?  cannot get to the setting screen as it is trying to connect to itunes.

    If yo are setting up the iPod vai wifi you have to connect to a network that does not use MAC address filtering.
    After it is set up yu can get the MAC from Settings>General>About>WiFi Address

  • How can I get the example fonts from the font file Programmatically?

    Hi Friends,
             I am doing one mac application for the fonts management. Now I would like to Preview the Font in the NSTextView.  This is my coding for the textView.
        NSTextView *text3=[[NSTextView alloc]initWithFrame:NSMakeRect(250,500,450,30)];
        [text3 setString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZ"];
        [text3 setFont:[NSFont fontWithName:@"GangofThree" size:40]];
        [[[self window] contentView] addSubview:text3];
    Because I have set the string in English for the NSTextView I can't able to view the other languages characters.I got the character set of the font file by using this code.
       NSCharacterSet *characterset = (NSCharacterSet *) CTFontCopyCharacterSet (fontRef);
    This Font is greek font.Now My question is how can I able to get the greek characters from this characterset.

    Your text string would certainly have to be in Greek itself, not Latin.  No normal font just translates Latin letters to Greek, they use other codepoints reserved for Greek letters.

  • Trying to get the Opening and Closing Balance, 0TOTALSTCK and 0VALSTCKVAL

    Hi Experts, Good Day.
    I am developing a query for Stock Balances, Using Custom cube created with copy from 0ic_c03.
    I am trying to get the Opening and Closing Balance, based on Non-Cumulative KF - 0TOTALSTCK and 0VALSTCKVAL.
    Both The KF's Behaviour for Exception Aggregat. = Last Value
    I am using VARIABLE OFFSET as -1 to get Opening Balance, and just restriction for Closing Balance based on 0CALMONTH
    Unfortunately i am getting data for the periods which does not have data in my Cube. It is taking the total value as closing balance for the periods which we don't have transaction in the cube.
    For Ex. I have data for 09.2010 & 10.2010 a particular material, when i enter 08.2010 as input i am getting the total value of the material.
    I hope you understand the problem and solution soon.
    I will give you more explanation if needed.
    Thanks in Advance....
    Have a great Day Ahead.....
    GopalN

    Hi GopaIN,
    can you explain us process you have done about initialization of data (2LIS_03_BX, cube compression)? it seams like there was data before 09.2010 and you load it with 2LIS_03_BX data source. That data is not in cube, but just used for update markers.
    Edited by: Sasa Todorovic on Mar 25, 2011 9:48 AM

  • Is there a way to get the correct order from the dependent types of a sche

    Hi ,
    I have a CT facing the following problem:
    When trying to built a SQL script to create all the object types within a schema using the DBMS_METADATA packages.
    Did insert in a table the names of the types that will be exported following a concrete order, next loop into the table and call the DBMS_METADATA package for each row.
    These type are depedent between them, there are some type attributes calling other types and here the issue
    First : try to generate the order by created column of dba_objects and when the generated SQL script is launched a lot of type appearing as incomplete state due to the order isn't correct.
    Second : try to insert the table ordering by object_id colums of dba_tables view, it appears incomplete types too.
    Currently want to insert the table using a recursive query with connect by against the dba_type_attrs starting with the rows when ATTR_TYPE_NAME is not null (the types that are called by other types), but this way has a issue dificult to resolve: the roots of hierarchy are the rows when ATTR_TYPE_NAME is not null and we've dependencies between roots nodes
    The question is is there a way to get the correct order from the dependent types of a schema?
    Platform: IBM SP AIX
    DB version: 9.2.0.7
    Any help will be appreciated .
    Thanks in advance.

    The xxx_dependencies view should give you the dependencies betwee nthe various types. I would look at something along the lines of:
    SELECT object_name, referenced_name
    FROM (SELECT o.object_name, d.referenced_name
          FROM user_objects o, user_dependencies d
          WHERE o.object_name = d.name(+) and
                o.object_type = d.type(+) and
                d.referenced_type(+) = 'TYPE' and
                o.object_type = 'TYPE')
    START WITH referenced_name IS NULL
    CONNECT BY PRIOR object_name = referenced_nameThe outer join between user_objects and user_dependencies is required to generate the names of types which are not dependent on other types, or do not have other types dependent on them.
    HTH
    John

  • Heey i bought an iphone 3gs about 2-3 months ago (used) today i blanked off the phone itself and then tried to get the newest update cuz i wasnt able to before so i did and now im locked out and it says sim failure invalid sim i can even get into it :(

    heey i bought an iphone 3gs about 2-3 months ago (used) was in mint condition well taken care of not even a scratch as soon as i got home i tried syncing it to my computer but didnt work it didnt even sync or notice my iphone software .. so i went to my friends and synced it there it has been working for music but videos wont work? but i didnt care  and then the pop up that says update so we would click it wait and it wouldnt work ever since ive had it so i left it like that so i went to my friend today i blanked it off the phone itself and then tried to get the newest update cuz i wasnt able to before so i did and now im locked out and it says sim failure invalid sim i can even get into it PLEASE HELP and cant get a new sim at the moment or take it into the apple store because i live about an hour and a half away from the city and rarley go to it please help me !!!!!!!!!!!!!!

    When I use find file http://www.macupdate.com/app/mac/30073/find-file (which does tend to find files that "Finder" can't), it's not coming up with any other itunes library files that have been modified in the past week, which I know it would have been - unfortunately, I don't have a very recent backup of the hard drive.  It would be a few months old so it wouldn't have the complete library on it....any ideas?  I'm wondering if restarting the computer might help but have been afraid to do so in case it would make it harder to recover anything...I was looking at this thread https://discussions.apple.com/thread/4211589?start=0&tstart=0 in the hopes that it might have a helpful suggestion but it's definitely a different scenario.

Maybe you are looking for

  • Unable to load DB2 library

    Hi, We are trying to install an application server on Windows in a UNIX SAP (abap+java) system with SAPinst.Our Central instance is in DB2/AIX platform and we want to install an windows application server. An error occured while processing start dial

  • How to import both CDs of a 2 disc set?

    My daughter has been trying to import the CD Hannah Montana 2 into itunes. The first disc, named Hannah Montana 2, imported easily. When we put the second disc, named Meet Miley Cyrus, into the computer and click import in itunes, it automatically li

  • Can Dreamweaver do explicit SSL/TLS FTP Connections?

    Hi, I posted this before, but never got a clear answer. Then again, my question wasn't phrased very clearly. I am currently unable to connect to our testing server via Dreamweaver (but can via CuteFTP) because : "The FTP settings for the server are e

  • HELP! Went to get 2.0, iPod bugged out, restored, 1.1.4 Apps=gne

    I restored my iPod, authorized comp, it's in my history, set on auto sync, but still says,"iTunes could not install the iPod Touch Software Upgrade on iPod "1337grunt" because an unknown error has occured(-4)" Please help me

  • Question on hooking time capsule up.

    I am looking to buy a time capsule, but first need to know a couple things, so anyone who could help me I would gladly appreciate it.  First question:  I currently have a modem and a wireless router hooked up at my house, which runs fine.  I was just