!please help me to write method in my program!

I have written this program however � have to add something but I could not do it. I have to use four method for each selection. For chasis type four different type which are hatchback, sedan etc. this should be single selection. Moreover option part should be multi selection. Please could you help me for writing and adding these two method in to my program
import java.util.Scanner;
     public class CarConfiguration {
          public static void main(String[] args) {
               int choise = Menu();
     processSelector(choise);
          private static int Menu() {
     System.out.println("\nWELCOME TO CAR CONFIGURATION APPLICATION PROGRAM");
          System.out.println("======================================");
          System.out.println(" Enter _1_ to Chasis Type");
          System.out.println(" Enter _2_ to Engine Type");
          System.out.println(" Enter _3_ to Transmission");
          System.out.println(" Enter _4_ to Options ");
          System.out.println(" Enter _5_ to Finish ");
          System.out.println("======================================");
          System.out.print("Select Your Choise: ");
     Scanner input=new Scanner(System.in);
     int choise=input.nextInt();
     return(input.nextInt());
     switch(choise){
     case 1:
     break;
     case 2:
     break;
     case 3:
     break;
     case 4:
     break;
     case 5:
     break;
     default:
     System.out.println("Invalid selection");
     break;
     }

Hi,
This works now. You just need to create your methods and link them in with your case statement as flounder showed you.
import java.util.Scanner;
public class CarConfiguration
     public static void main(String[] args)
     int choise = Menu();
     processSelector(choise);
     private static int Menu()
          System.out.println("\nWELCOME TO CAR CONFIGURATION APPLICATION PROGRAM");
          System.out.println("======================================");
          System.out.println(" Enter _1_ to Chasis Type");
          System.out.println(" Enter _2_ to Engine Type");
          System.out.println(" Enter _3_ to Transmission");
          System.out.println(" Enter _4_ to Options ");
          System.out.println(" Enter _5_ to Finish ");
          System.out.println("======================================");
          System.out.print("Select Your Choise: ");
     Scanner input=new Scanner(System.in);
     int choise=input.nextInt();
     return(choise);
     private static void processSelector(int choise)
          switch(choise)
               case 1: //enter mehtods here and for all other empty cases
               break;
               case 2:
               break;
               case 3:
               break;
               case 4:
               break;
               case 5:
               break;
               default:
               System.out.println("Invalid selection");
               break;
}

Similar Messages

  • Please help to re-write this query using exists or with

    Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
    SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
    FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
    FROM (
    SELECT a.individual_id individual_id,
    CASE
    WHEN NVL
    (b.ship_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 45
    AND a.country_cd = 'US'
    AND b.individual_id in (
    SELECT UNIQUE c.individual_id
    FROM order c
    WHERE c.prod_cd = 'A'
    AND NVL (c.last_payment_dt,
    TO_DATE ('05-MAY-1955')
    ) >= SYSDATE - 745)
    THEN 1
    ELSE 0
    END AS one_mon_c_paid_us
    FROM items b, addr a, product d
    WHERE b.prod_id = d.prod_id
    AND d.affinity_1_cd = 'ADH'
    AND b.individual_id = a.individual_id)
    GROUP BY individual_id)
    Edited by: user4522368 on Aug 23, 2010 9:11 AM

    Please try and place \ before and after you code \Could you not remove the inline column select with the following?
    SELECT a.individual_id individual_id
         ,CASE
            when b.Ship_dt is null then
              3
            WHEN b.ship_dt >= SYSDATE - 90
              3
            WHEN b.ship_dt >= SYSDATE - 45
              2
            WHEN b.ship_dt >= SYSDATE - 30
              1
          END AS one_mon_c_paid_us
    FROM  items           b
         ,addr            a
         ,product         d
         ,order           o
    WHERE b.prod_id       = d.prod_id
    AND   d.affinity_1_cd = 'ADH'
    AND   b.individual_id = a.individual_id
    AND   b.Individual_ID = o.Individual_ID
    and   o.Prod_CD       = 'A'             
    and   NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
    and   a.Country_CD    = 'US'

  • Please help finding pre-exsisting methods

    please help find pre-existing methods
    JavaFirstTime Jan 2, 2005 3:21 PM
    please help clever people :)
    how to output decimals in 2 decimal places only?
    how to output large integers using format: 12,376,452
    I've been told there are pre-existing methods for that, but i just can't find it... ideally i need to know the source code...

    Well, there's many ways to do it ... Here's one:
    class NumberFormatDemo {
    public static void main(String[] args) {
    new NumberFormatDemo().go();
    public void go() {
    double decimal = 123.456;
    System.out.println((int) decimal + "." + (int)
    + (int) (decimal * 100 + 0.5) % 100);
    int largeInteger = 12376452;
    System.out.println(recursive(largeInteger));
    public String recursive(int largeInteger) {
    if (largeInteger > 999) {
    return recursive(largeInteger/1000) + ","
    1000) + "," + largeInteger%1000;
    } else {
    return "" + largeInteger;
    yes, that's exactly wot i need...
    how didn't i think of that myself, using mathematics, i was thinking it would be more complicated like converting decimals to string then count letters and so on.
    Thank you for putting me on the right track :)

  • Please help me to write PCRs... can any body give on real time PCRs .......

    hi to all,
    can any one please help me to write the sample PCRs.

    hi thanks to that...
    but i need some simple PCRs from u r end ......
    please explain to me..
    u said that i need to learn operations and functions ..
    i know those but i don't know how to use it...
    i have had U000 schema material...
    but i am not understing .... it....
    so if u can explain the one or 2 sample PCRs so that i can develop with the help of them........
    waiting for u r soooooooooon replay.............
    bye
    ravi

  • Please  Help me How write the BDC program for the MIGO inbound Delivery

    Please help me how to write bdc program for the MIGO Inbound Delivery in 4.7EE Version. Please help me.
    Not in LSMW.  Required call transaction or Session Method. Please help me.
    Mohan

    Run transaction BAPI . Select Logistics Execution/Shipping/InboundDelivery/SaveReplica.. You can use function module BAPI_INB_DELIVERY_SAVEREPLICA in your ABAP program.

  • Please help me to write a function for this requirement!

    Hi,
        I have created a stored procedure which accepts 2 input parameters (param1 & param2 ) and its output is 'Score'
    Eg:
    Exec uspScorecalculation StudentID,DeptID 
    output: 85
    Now, My requirement is , I want to populate this value as one of the columns in a 'Select' statement.
    Can you please give me some input like how can i write a funtion to retrieve this score from the procedure and use it in the select statement?
    I assume,  the funciton should pass the two parameters into the stored procedure 'uspScorecalculation'  and retreives the Score.
    Can you please help me on this?
    thanks!

    >> I have created a stored procedure which accepts 2 input parameters (param1 & param2 ) and its output is 'Score' <<
    We have no idea from this posting what this procedure does. No code. No spec. Only a vague, useless narrative. 
    We do not put that silly “usp_” prefix on a proc name; this is one version of tibbling. When we wrote in FORTRAN I and II, we had to put “fn_” on user functions name. A procedure uses a “<verb>_<object>” format. Have you read ISO-11179 Standards
    or any book on data modeling?  
    EXEC Calculate_Something_Score student_id, dept_id; 
    >> Now, My requirement is, I want to populate this value as one of the columns in a 'SELECT' statement. <<
    Populate a column? We do not do that in a declarative language like SQL. The row with that column comes into existence all at once, and all the rows in the table come into existence all at once. This is a set-oriented language. 
    >> Can you please give me some input like how can I write a function to retrieve this score from the procedure and use it in the SELECT statement? <<
    NO! An SQL programmer will take the body of the procedure and replace the parameters with column names. It will be part of a SELECT statement and not a function call. We hate UDFs and other procedural constructs. 
    Please post the code and DDL, if you want help. Your failure and rudeness in not following Netiquette only hurt yourself. Your mindset is still locking into 1960's FORTRAN, not SQL. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Please help me to write a file from applet to server with a servlet.

    In an applet the client elaborates a string and stores it in the variable of the name "line"
    I would Like to write the string "line" in the file myfile.txt on the server.
    I am in an applet trying to make the URLconnection to a servlet.
    The part of the applet which calls the servlet is the following:
    private void writeToSer(String line)
    try
    URL u = new URL("http://192.168.1.103:8180/servlet/ScriviFileServletFor1?stringa="+line);
    HttpURLConnection urlConn = (HttpURLConnection)u.openConnection();
    catch(IOException ioe)
    JOptionPane.showMessageDialog(null,"IO Exception ","attenzione",JOptionPane.ERROR_MESSAGE );
    the code of the servlet is the following:
    import java.io.*;
    import java.io.File;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ScriviFileServletFor1 extends HttpServlet {
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    //read the parameters
    String string = request.getParameter("stringa");
    try {
    File file = new File("/home/icurrado/myfile.txt");
    FileWriter out = new FileWriter(file);
    out.write(string);
    out.close();
    catch (Exception e) {
    e.printStackTrace();
    When I call the servlet from the bar of the URL with :
    http://localhost:8180/servlet/ScriviFileServletFor1?stringa=prova
    It works and writes the string "prova" in the file "/home/icurrado/myfile.txt".
    When I call the servlet from the applet it doesn't work and it doesn't write the string in the file.
    What is wrong or is missing ?
    Please help me.

    You dont need to go through the URL mechanism.
    From an Applet you can directly save the file on the server at destinated location.
    You can look for "Uploader Applet" in google.

  • Please Help Me to write a query

    I have a table called CLAIMs and I want to find out the rows which have the same claim and member id
    having cert ='MEMBER' and Insert date is greater than Other rows within the same claim and memberid.
    Eg:
    Insert date             claim                    member Id        cert     
    7/17/2009               2009106                  1345678         1345678 
    8/8/2009                2009106                  1345678         MEMBER 
    12/11/2009              2009107            1345679         MEMBER
    12/14/2009          2009107                   1345679         1345679
    Expected row:
    7/17/2009               2009106                  1345678         1345678 
    8/8/2009                2009106                  1345678         MEMBER  Please help.

    hoek wrote:
    Edited by: hoek on Dec 14, 2009 6:14 PMYour solution will show MEMBER even if there are no non-members for the claim, while OP stated:
    Insert date is greater than Other+* rows within the same claim and memberid
    SQL> with claims as (
      2                  select to_date('8/8/2009','mm/dd/yyyy') insert_date,2009106 claim,1345678 member_id,'MEMBER' cert from dual
      3                 )
      4  select *
      5  from   claims a
      6  where exists ( select null
      7                 from ( select b.insert_date
      8                        ,      b.claim
      9                        ,      b.member_id
    10                        ,      b.cert
    11                        ,      row_number() over (partition by b.claim, b.member_id order by b.insert_date desc) rn
    12                        from   claims b
    13                      ) b
    14                 where b.claim = a.claim
    15                 and   b.member_id = a.member_id
    16                 and   b.cert = 'MEMBER'
    17                 and   b.rn = 1
    18               );
    INSERT_DA      CLAIM  MEMBER_ID CERT
    08-AUG-09    2009106    1345678 MEMBER
    SQL> with claims as (
      2                  select to_date('8/8/2009','mm/dd/yyyy') insert_dt,2009106 claim,1345678 member_id,'MEMBER' cert from dual
      3                 )
      4  select  insert_dt,
      5          claim,
      6          member_id,
      7          cert
      8    from  (
      9           select  c.*,
    10                   max(case cert when 'MEMBER' then null else insert_dt end) over(partition by claim,member_id) max_non_member_dt,
    11                   max(case cert when 'MEMBER' then insert_dt end) over(partition by claim,member_id) max_member_dt
    12             from  claims c
    13          )
    14  where max_non_member_dt < max_member_dt
    15  /
    no rows selected
    SQL> SY.

  • Please help this dummy...How this program works??

    Hi, I am new in Java...I just bought a book and start to learn the java from that book. Here is one of the project exercise and seems that it is difficult for me to understand the flow of the program.
    class HelpClassDemo {
    public static void main(String args [])
    throws java.io.IOException () {
    char choice;
    Help hlpobj = new Help;
    for(;;) {
    do {
    hlpobj.showmenu();
    do {
    choice = (char) System.in.read () ;
    } while (choice == '\n' | choice == '\r');
    } while ( !hlpobj.isvalid (choice) );
    if(choice == 'q' ) break;
    System.out.println("\n");
    hlpobj.helpon(choice);
    Thats what the program code. I don't understand especially after the " } while( !hlpobj.isvalid(choice)); " part. And i don't know what is !hlpobj means....
    Please help.....

    is it indicated the opposite of hlpobj object or the
    opposite of isvalid method?the opposite of the result of isvalid method.
    if isvalid method returns true then the opposite of true which false because of the not sign(!)
    */

  • I have 64 bit Vista Home Premium.  I need to download Flash in order to use Premier Pro CS4.  Please help me so I can use your program.

    Dear Folks:
    I have the trial version of Adobe Premier Pro CS4, and I have 64 bit Vista Home Premium.  I can not download Flash in order to view the Help Program Tutorial.  I am a student at CCBC Essex Campus, and I need to assemble a three minute video for a class.  I have Internet Explorer (latest version), and I also have Firefox.  Please help me with a solution.
    Thank You,
    Dan Pasten
    111 Alcock Road
    Essex, Md. 21221-2110
    United States of America
    (410) 686-8067

    For easy searching, download the product user guide PDF(s)
    The individual CS5 pages also have links to the earlier user guide pages
    CS5 User Guides - online and PDF (right click PDF link to save PDF to your hard drive)
    http://blogs.adobe.com/premiereprotraining/2010/08/help-documents-for-creative-suite-5-pdf -and-html.html
    Some tutorial links... these MAY not apply to CS4, but it doesn't cost to look
    http://forums.adobe.com/thread/913334
    http://forums.adobe.com/thread/845731
    -and http://forums.adobe.com/message/3234794
    Encore http://tv.adobe.com/show/learn-encore-cs4/
    A "crash course" http://forums.adobe.com/thread/761834
    A Video Primer for Premiere http://forums.adobe.com/thread/498251
    Premiere Tutorials http://forums.adobe.com/thread/424009
    PPro Wiki http://premierepro.wikia.com/wiki/Adobe_Premiere_Pro_Wiki
    Tutorial http://www.tutorialized.com/tutorials/Premiere/1
    Tutorial http://www.dvxuser.com/V6/forumdisplay.php?f=21
    Tutorial HD to SD w/CS4 http://bellunevideo.com/tutorials/CS4_HD2SD/CS4_HD2SD.html
    Exporting to DVD http://help.adobe.com/en_US/premierepro/cs/using/WS3E252E59-6BE5-4668-A12E-4ED0348C3FDBa.h tml
    And http://help.adobe.com/en_US/premierepro/cs/using/WSCDE15B03-1236-483f-BBD4-263E77B445B9.ht ml
    Color correction http://forums.adobe.com/thread/892861
    Photo Scaling for Video http://forums.adobe.com/thread/450798
    -Too Large May = Crash http://forums.adobe.com/thread/879967
    -And another crash report http://forums.adobe.com/thread/973935
    After Effects Tutorials http://www.videocopilot.net/
    Authoring http://www.videocopilot.net/tutorials/dvd_authoring/
    Encore Tutorial http://www.precomposed.com/blog/2009/05/encore-tutorial/
    And more Encore http://library.creativecow.net/articles/devis_andrew/
    Surround Sound http://forums.adobe.com/thread/517372
    Regions and NTSC vs PAL http://forums.adobe.com/thread/951042

  • Please help me,i deleted photo whith the program clean genius pro, what can i do?thanks

    I used clean genius and i delated old photo the iphoto,please i want have again my photos please help me,thanks and sorry i.m spanish people desesperated,

    Reinstall it.
    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store or have a Recent Mac you can find it in your Purchases List.

  • Please help me to write the reports

    Hi everyone, This is rohith here, Please can anyone help me out to write the reports
    1. Developed material master details report. Input of material and plant as select-options and material type as parameter. Output list will have quantity by material group and plant.
    2. Created an Interactive report for displaying vendor information. Based on the selection made the corresponding Vendor Bank Details are listed such that the line selected in the basic list was visible along the secondary list.
    3. Developed an ALV report lists all deliveries that have been shipped but not yet billed
    4. Generated a report  which displays vendor invoice details.

    hi Rohit,
    <b>Welcome to SDN.</b>
    Design the Selection screen first with MATNR & WERKS as Select-options.
    and Material type as Parameteres.
    declare the req internal tables to fetch the data from DB tables .
    Validate the selection screen fields with their check tables according to req..
    write the logic of fetching the data in START-OF- SELECTION.
    and display the output internal table in the output list.
    <b>
    Reward points if useful</b>
    Cheers,
    Chandra

  • Please help me to write a class file?

    Hi;
    I want to write a class that
    after i input an integer say X in a dialog, it will calculate and display the answer of 2 raised to power X. The smallest value of X my program need to handle is 0. Teach me please!

    Which part of the program you need help with? Is it the interface, the actual calculation, the compilation, the editing ... etc.
    I don't think you're asking someone to do the whole program for you. Be a little more specific in:
    1. What you have tried so far
    2. What's not working ...
    3. What you don't understand and need clarification with ... etc.
    4. Do you have an education in Java ... how about in programming ...
    The question, as you posted, is just too vague ...
    But then again ... its quite possible that someone will post an entire solution for you ....
    Good Luck
    Kamran

  • Please help with a suitable method!

    Hello, I'm really hoping you can help me as I have a deadline (and sweets)!
    I've been given a spread sheet which I've put into Numbers that are several pages long. They contain various fee earners (Letting Fees, Management Fees, Administration fees, Renewal fees, Contractor Commissions, PDQ, & finally TDS fees). These fees have been earned over 3 different offices and the task is to allocate to which branch each of the fees were made.
    They are mostly organized into groups however there are quite a few randomly spread about the places. The previous method is to go through each page adding them up with a calculator and putting it into a simple chart which takes about 4 hours (and is almost always inaccurate).
    What I have done so far is to recreate this simple chart on 'Sheet 1' (the 3 branches as columns and the fees earners as rows), and on Sheet 2 have got all the data. I had thought the best way would be some sort of tagging method in which I could select a row in the data and somehow tag it as one of the branches particular fees (say Paris's Letting Fee). The figure for this fee would then be added into the box corresponding to 'Paris' Letting Fees' on Sheet 1 - any subsequent Letting Fees for Paris would be added giving a total in that box. Unfortunately you can't just click 'sort' because the text in the description field are all unique.
    Any help would be appreciated, although I'm not very good working with formulas so unless its something I can copy paste (with some give and take!) I'd be stumped.
    Thank you for reading and having a think.

    Here are two more examples using a similar thought process as above. The first shot shows SUMIF based on one field ("Category"), the second uses SUMIF based on the concatenation of two fields (YearMonth & Category.) The second would be useful if you'd like to "Slice & Dice" the data into Monthly periods based on Year. In your example, you could have earner & locations summarized, etc.. The possibilities are endless.
    Regards,

  • Please help me with addAll method of ArrayList

    Hi guys, I am trying to wrtie a method to add all elements of one ArrayList to another one. My code is
    import java.util.*;
    public class Purse
    public Purse()
    coins = new ArrayList<String>();
    public void add(String coinName)
    coins.add(coinName);
    public String toString()
    if(coins.size() == 0)
    return "Purse[]";
    String output = "Purse[";
    for(String coin : coins)
    output = output + coin + ",";
    return output + "]";
    public void transfer1(Object other)
    Purse otherPurse = (Purse) other;
    coins.addAll(otherPurse);
    other = null;
    private ArrayList<String> coins;
    The error i got is Purse.java:41: cannot find symbol
    symbol : method addAll(Purse)
    location: class java.util.ArrayList<java.lang.String>
    coins.addAll(otherPurse);
    ^
    1 error
    Tool completed with exit code 1
    when i tried to do in simple way it is perfectly work which is
    import java.util.*;
    public class TransferArrayList
    public static void main(String args[])
    ArrayList<String> list = new ArrayList();
    list.add("abc");
    list.add("fda");
    ArrayList<String> list1 = new ArrayList();
    list1.addAll(list);
    System.out.print(list1);
    list.clear();
    System.out.println(list);
    Can some one please tell me where i m doing mistake.
    Edited by: Virk on Nov 1, 2007 6:47 AM

    As I could see the code, you are trying to add a java object into the collection which is not permitted.
    The Purse object is not a collection type. If you can see the parameter of list.addAll(Collection aCollection) method is required a collection.
    So you can try this
    *public class Purse{*
    private List coins;
    *public Purse(){*
    coins = new ArrayList();
    *public List getCoinList(){*
    return coins;
    *public void transfer1(Purse other){*
    coins.addAll(other.getCoinList());
    cheer :)

Maybe you are looking for