Writing my first program....

Okay my first programming assignment is to write a program that requests an amount of money and will then calculate how many quarters, dimes, nickels and pennies it takes to get that number. I do wanna figure this out by myself, but since im new to JAVA i was wondering if anyone could give me some ideas and/or hints as to maybe where a good place to start is.....

A good way to start is for you to do what the program needs to do, and write down the steps involved.
Assume you start with $1.01
What would you do first?
next?
and so on.
Each statement should consist on only one action.
By the time you finish, you've pretty well outlined what the program needs to do.
Then you can start figuring out wha program instructions are needed.

Similar Messages

  • Can't install itunes. error  writing to file program files (x86)\Adobe\gnsk_dsp.dll

    I can't update itunes.
    During installation it says:
    Error while writing in file: Program Files (x68)\Adobe\gnsk_dsp.dll.
    Check whether you have the right to open that file.
    How can I remove this error?

    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • My first program to create a crystal report from java... Help needed...

    Hi... I am writing a java program that fetches a table from database and creates a Crystal Report from that table(ResultSet object)... Optionally exporting the report as a pdf also...  This will be a console application since it is my first program using crystal reports.... Any one can help me with this...?

    Hi Karthik,
    you could have a look over these developer guides below for understanding of Java sdk :-
    [http://www.sdn.sap.com/irj/boc/sdklibrary|http://www.sdn.sap.com/irj/boc/sdklibrary]
    you could also find  below sample codes for creating reports using Java sdk (RAS sdk) :-
    [http://www.sdn.sap.com/irj/boc/samples|http://www.sdn.sap.com/irj/boc/samples]
    let me know if you need any help,
    Regards,
    Rameez.

  • I created my first program-compiling error-help please

    hey there
    i just wanted my first program in java and here it is below with the eroor when i'm compiling it, i cant understand whats wrong:
    public class SquareArea {
         public static void main(String[] args); {
         float length;
         float width;
         float SquareArea;
         System.out.println ("Please enter length"+ length);
         System.out.println ("Please enter width"+ width);
         SquareArea= length*width;
         System.out.println ("The area of the square is" + SquareArea);
    The error is:C:\Documents and Settings\User\Desktop\SquareArea.java:5: missing method body, or declare abstract
         public static void main(String[] args); {
    ^
    1 error
    Tool completed with exit code 1

    There shouldn't be a semicolon between the ")" and the "{" near the end of that line.
    With that semicolon, you're basically defining an empty, zero-size main method, and then throwing a bunch of garbage after it. That's what the compiler thinks anyway. Remove that semicolon and it should compile OK.
    But it won't work super well, because you're not actually getting any input for length and width. It's just going to output this:
    Please enter length0
    Please enter width0
    The area of the square is0

  • Problem compiling my first program; Please Help me!

    Please HELP, what am I doing wrong?
    For over 5hours I have been trying to figure out how to compile a simple Hello world program using sdk1.3.1_02/j2re1.3.1_02 and I am getting the following errors: helloworld.java:2 cannot resolve symbol
    symbol : class string
    location : class helloworld
    cannot reolve the string symbol
    symbol : class out
    location : package system
    I want to program in java so badly but I am trying to get my environment set so that I can take off. To compile my first program has been a disaster!!
    This is my path:
    SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1_02\BIN
    Thanks very much in advance
    ::(

    Java is case sensitive,
    use String instead of string. and System.out instead of system.out
    Sudha

  • How to execute the first program without using SUBMIT and RETURN

    Hi Experts,
    My requirement is , I need to select thet value from VA02 at runtime and need to pass that value to VF01 transaction and press save then it creates proforma document.The created document we can see in VA02 by clicking on document flow.
    My program is processed through OUTPUT TYPE.
    To get this functionality i written coding like this.
    1) i am selecting the value at runtime from VA02  using FORM ROUTINE.Now iam passing this selected value to VF01 for
    genarate proforma document using BDC.Here the problem is,first time when i am selecting the value form VA02 at runtime it is in open status,now my BDC code need to update the value in VA02 only.so locking problem occurres  the document is not getting updated.
    To overcome this problem i have done changes like this......
    2) i splited my program into two parts, that  is into two programs.
    a) In first program i am only selecting the value form VA02 at runtime using FORM ROUTINE and in this program i have written SUBMIT statement to call another program there my BDC  code will create documet and update in VA02,upto here everything is doing fine,
         But here again the problem is when i process OUTPUT type my program is triggering and giving correct result but the status is not changing form YELLOW to GREEN.Why means when SUBMIT statement trigger, control is going to second program and creating a new document,but not coming to first program so the status is not changing as the first prohram is still processing. .If i write RETURN along with SUBMIT the VA02 is in open STATUS only, till control comes to first program.so it will not uodate document in VA02.
    If i execute all line in my program status will automatically change from YELLOW to GREEN how to acheive this
    please suggest me the solution.

    I would do 2 things:
    1) be sure to do a COMMIT WORK AND WAIT
    2) refresh your display in calling program
    the point 2) can be done by submitting the program again (or the transaction) with the same parameters

  • Itunes 9.2.1.5 "Error when writing file C:\program files\apple software....

    Got an error message when installing itues 9.2.1.5 "Error when writing file C:\program files\apple software update\softwareupdate.exe you do not have admin right to read/write the menu." "寫入檔案時發生錯誤 C:\program files\apple software update\softwareupdate.exe 你沒有權限存取目錄"
    There is no "apple software update" folder in my C:\program files\
    I tried to uninstalled all apple related software, restart the computer and reinstall the itunes, I still get this error message.
    It appears that the installation of quicktime was successful.

    After the last update I get "QuickTime was not found" Error I have uninstalled and re-installed itunes 9.2.1.5. several times but the problem persists

  • How to find First Program run in the Current Month in Foreground?

    Dear Experts,
    My requirement is that i need to find the First Program run date in the Current Month in foreground. The user must be allowed to run the Report only once for a month and if the next time he runs in the same month, it should not allow him to do so.
    Is there any Function Modules available? How to achieve this?
    Regards,
    Ramesh Manoharan

    Hello Ramesh,
    May be you can try with this code:
    INITIALIZATION.
      DATA:
      v_date TYPE datum,
      wa_indx TYPE indx.
    * Import the date to INDX table
      IMPORT date = v_date
        FROM DATABASE indx(xy)
        TO   wa_indx
        CLIENT sy-mandt
        ID 'DATE'.
      IF v_date IS NOT INITIAL.
        IF v_date+0(6) = sy-datum+0(6). "Check YYYYMM is same
          "Give your error message & exit
        ELSE.
          v_date = sy-datum.
    *     Export the date to INDX table
          EXPORT date = v_date
            TO DATABASE indx(xy)
            FROM   wa_indx
            CLIENT sy-mandt
            ID 'DATE'.
        ENDIF.
      ELSE.
        v_date = sy-datum.
    *   Export the date to INDX table
        EXPORT date = v_date
          TO DATABASE indx(xy)
          FROM   wa_indx
          CLIENT sy-mandt
          ID 'DATE'.
      ENDIF.
    Hope this is of some help.
    BR,
    Suhas

  • My first program in Java

    After I compile my first application using javac Welcome1.java
    when I try to run the pplication using java Welcome1
    I get this message
    Exception in thread "main" java.lang.NoClassDefFoundError: Welcome1
    Please if somebody can help me:
    This is my source code:
    // Fig. 2.1 Welcome1.java
    // A first program in Java.
         public class Welcome1 {
         // main method begins execution of Java application
         public static void main ( String args[] )
              System.out.println( "Welcome to Java Programming!" );
         } // end method main
    }     // end class Welcome1
    Thank you

    Try this
    go to c:\edit autoexec.bat
    type these lines
    set path=c:\j2sdk1.4.0\bin; // check the java folder name in c:\
    set classpath=c:\%classpath%;.;
    save and close DOS
    restart PC,
    now try the example
    Hope it helps
    Uma
    http://www.javagalaxy.com

  • My First Program, Seeking Advice

    Hello all!
    This is my first program attempt with Visual Studio 2013 Express and I don't have hardly any experience in programming to begin with...so bare with me. I have this idea for a Digital Communications Board. You know like the ones that are make of cork board
    that have a million things attached to it and its all over the place? Ya that mess. I have several ideas for this concept which, if given enough help, I will go into later. But basically, I want to be able to have a program or app that lets you assign categories
    for certain things that can be displayed in a work setting. Categories like Schedule, Announcements, and other things that you would want to add as you think of them. so I imagine this board starting out with a few that can be edited. 
    The main aspect of this program is to be able to upload any screenshot or picture or pdf file that is available and present it in a fashion that is organized. So if we just focus on the Schedule tab that I mentioned already I can probably explain it better.
    The way I will personally use this is to display employee schedules through the addition of a picture or file taken from my company's system (not a data retrieval, just simple manual entry). Later down the road I will attempt to make it so that the Schedule's
    for each employee can be entered manually so that there are simple layouts and no excess material to fill up the space. 
    So with this idea in mind what would be my first steps? I know I need the following things:
    1. I want to be able to have a minimum of 3 tabs displaying the name of the display that would come from it. for example, If i click the button/tab that says "Schedule" then that tab would expand or present the content that IS the schedule for
    the employee's or what has been set by the user to be displayed there.
    2. I want to be able to expand the number of tabs with ease. Like a typical "+" button that would obviously add another tab that can be set up for another purpose while at the same time it is formatted to space itself on the main page with
    the other tabs.
    I know this is a lot at one time but I really just want to get some constructive feedback and if someone is awesome enough to actually write code for me then please please please put comments in the code so I can understand!
    I appreciate any and all feedback!
    Thank you 

    Hello,
    Thank you for your post.
    Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    Because your issue is about programming, maybe Visual Studio Language Forums can help you:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • First program on Zed board

    I have just got our Zed board.
    Can you please help me in locating my first program for Zynq w.r.t:
    1- PS section
    2- PL section
    3- Both in communication.
    I just want a minimal design to get into.
     

    Have you tried to just Google "zedboard tutorial" there are tons of tutorials out there. Go to zedboard.org support and look around. You can find some here: Zedboard Tutorials, In the tutorials is a step by step guild to build a simple PS/PL design that interacts with the switches and leds.  If I remember there are two main tutorials, one is bare-metal (don't need to boot Linux) and the other requires Linux up and running via the SD interface.  

  • Writing a java program for generating .pdf file with the data of MS-Excel .

    Hi all,
    My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
    I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
    My Program is:
    * Created on Apr 13, 2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    package forums;
    import java.io.*;
    import java.awt.Color;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    import com.lowagie.text.Font.*;
    import com.lowagie.text.pdf.MultiColumnText;
    import com.lowagie.text.Phrase.*;
    import net.sf.hibernate.mapping.Array;
    import org.apache.poi.hssf.*;
    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hssf.usermodel.*;
    import com.lowagie.text.Phrase.*;
    import java.util.Iterator;
    * Generates a simple 'Hello World' PDF file.
    * @author blowagie
    public class pdfgenerator {
         * Generates a PDF file with the text 'Hello World'
         * @param args no arguments needed here
         public static void main(String[] args) {
              System.out.println("Hello World");
              Rectangle pageSize = new Rectangle(916, 1592);
                        pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
              // step 1: creation of a document-object
              //Document document = new Document(pageSize);
              Document document = new Document(pageSize, 132, 164, 108, 108);
              try {
                   // step 2:
                   // we create a writer that listens to the document
                   // and directs a PDF-stream to a file
                   PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
                   writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
    //               step 3: we open the document
                             document.open();
                   Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
                   POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
                   HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
                   HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
                   Iterator rows = hsheet.rowIterator();
                                  while( rows.hasNext() ) {
                                       Phrase phrase=new Phrase();
                                       HSSFRow row = (HSSFRow) rows.next();
                                       //System.out.println( "Row #" + row.getRowNum());
                                       // Iterate over each cell in the row and print out the cell's content
                                       Iterator cells = row.cellIterator();
                                       while( cells.hasNext() ) {
                                            HSSFCell cell = (HSSFCell) cells.next();
                                            //System.out.println( "Cell #" + cell.getCellNum() );
                                            switch ( cell.getCellType() ) {
                                                 case HSSFCell.CELL_TYPE_STRING:
                                                 String stringcell=cell.getStringCellValue ()+" ";
                                                 writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                 phrase.add(stringcell);
                                            // document.add(new Phrase(string));
                                                      System.out.print( cell.getStringCellValue () );
                                                      break;
                                                 case HSSFCell.CELL_TYPE_FORMULA:
                                                           String stringdate=cell.getCellFormula()+" ";
                                                           writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                           phrase.add(stringdate);
                                                 System.out.print( cell.getCellFormula() );
                                                           break;
                                                 case HSSFCell.CELL_TYPE_NUMERIC:
                                                 String string=String.valueOf(cell.getNumericCellValue())+" ";
                                                      writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                      phrase.add(string);
                                                      System.out.print( cell.getNumericCellValue() );
                                                      break;
                                                 default:
                                                      //System.out.println( "unsuported sell type" );
                                                      break;
                                       document.add(new Paragraph(phrase));
                                       document.add(new Paragraph("\n \n \n"));
                   // step 4: we add a paragraph to the document
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              // step 5: we close the document
              document.close();
    My Input from MS-Excel file is:
         Planning and Tracking Template for Interns                                                                 
         Name of the Intern     N.Kesavulu Reddy                                                            
         Project Name     Enterprise Sales and Marketing                                                            
         Description     Estimated Effort in Hrs     Planned/Replanned          Actual          Actual Effort in Hrs     Complexity     Priority     LOC written new & modified     % work completion     Status     Rework     Remarks
    S.No               Start Date     End Date     Start Date     End Date                                        
    1     setup the configuration          31/01/2005     1/2/2005     31/01/2005     1/2/2005                                        
    2     Deploying an application through Tapestry, Spring, Hibernate          2/2/2005     2/2/2005     2/2/2005     2/2/2005                                        
    3     Gone through Componentization and Cxprice application          3/2/2005     3/2/2005     3/2/2005     3/2/2005                                        
    4     Attend the sessions(tapestry,spring, hibernate), QBA          4/2/2005     4/2/2005     4/2/2005     4/2/2005                                        
         The o/p I'm gettint in .pdf file is:
    Planning and Tracking Template for Interns
    N.Kesavulu Reddy Name of the Intern
    Enterprise Sales and Marketing Project Name
    Remarks Rework Status % work completion LOC written new & modified Priority
    Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
    End Date Start Date End Date Start Date S.No
    38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
    38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
    2.0
    38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
    3.0
    38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
                                       The issues i'm facing are:
    When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
    and the second issue is:
    It is not recognizing the date format..it is recognizing the date in first row only......
    Plz Tell me wht is the solution for this...
    Regards
    [email protected]

    Don't double post your question:
    http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
    /Kaj

  • TS3276 I use Mail for my email and lately, if I get an email coming in while writing one, the program freezes for a few seconds. Frustrating.

    I have a 27" iMac 3.06 GHz Intel Core 2 Duo. I use Mail for my email. Just in the past 2 -3 months, if I'm writing an email while another one is coming in to the inbox, the program freezes, the spinning colour ball appears and I can't continue typing for 5 seconds or more. I get and write a lot of emails so it's frustrating.
    I've also noticed that sending messages is taking longer than it used to. The program spins its wheels for a few seconds before sending. Definitely noticeably longer than prior to this situation. Any ideas anyone?

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Help with first program

    I just started taking a class in Flash CS4 and I have a basic program that I'm suppose to develop for my first project. My problem is that I'm not good at programming yet so I was wondering if anyone is able to help me out. Here is what I'm suppose to do.
    Use flash CS3 to create a mini marble game. It should have the following elements:
    •         a) The first scene should have a single button labeled "start game", placed at the exact center of an 800*600 pixel screen. A simple background image containing a polka dot pattern should fill the background layer for this intro screen.
    •         b) When the start button is pressed, the game should show a new screen with a solid color background (which may be white). Two marbles, represented by filled circles (80 pixels of radius or 80 by 80 pixel bounding box) of two different colors should appear. The first marble should appear at the exact center of the stage, the second marble at either a random location (extra credit for this) or one of four possible locations OTHER than the area allocated for the first marble.
    •         c) Using the mouse or any keystroke, the player should be able to "start" the second marble in the direction of the first at a constant speed of 24 pixels per second (use an event handler and the Enter_Frame event, as well as a 12 fps speed for the movieclip, to establish the speed of the marble).
    •         d) When the first marble collides with the second, it should stop it's motion, and the second marble should start moving at the same speed in the same direction than the first one until it leaves the screen.
    •         e) Display a "Game Over" sign, when the second marble has left the screen.
    •         f) Publish the movie, and upload both the fla and swf here.
    I finish the a) section but I don't know what to do with the rest. Here is my file.
    http://rapidshare.com/files/360378296/Project1.fla

    use some actionscript to code your start button to move to a new frame where your two marbles are on stage.  then apply actionscript to the 2nd marble so when it's clicked or a key is pressed you start a loop that moves that 2nd marble towards the center marble.  when the two collide (use hitTest() ), stop the 2nd marble and start moving the 1st marble.

  • [perl] Writing my first module (IPTables::Rule); Looking for feedback

    Well pretty much as the subject says... I've been hacking away with perl for a while, but this is the first time I've tried writing a module.
    I think (hope) I'm on the right track in terms of doing it the "right" way (or one of the X "right" ways perl lets you!).
    If you're bored and have time to have a glance over and tell me how I'm doing, that would be great
    https://github.com/fukawi2/IPTables-Rule

    juster wrote:This looks nice and seems to be very complete. Creating modules is a thankless art and I wish you the best. I skimmed through it and noticed a few things that stood out to me:
    Thanks for your time and input
    juster wrote:You use empty prototypes for all your functions. These are not necessary and I think you have picked up this habit from somewhere else. Most likely from shell scripting. I also only mention this because prototypes can be misleading to programmers because they almost always do the unexpected and cause subtle confusion.
    Sure, let's say shell scripting............
    Removed them all.
    juster wrote:I see you call private functions, preceded by the ampersand (&). This is the old perl 4 syntax for calling functions. Luckily this ugliness is behind us. The only practical reason to use it now is to disable argument checking which has been previously enforced by prototypes. If you remove the empty prototypes you won't have to call your "private" subs by prefixing their names with ampersands.
    I was actually aware the ampersands are not required, but I like them... They're just a little hint when skimming code that it's a function... Just like $, @ or % on variables. Having a Google around, I didn't actually know there was a difference between using it and not using it, so I'm removed them too. I'll get used to it
    juster wrote:The setters in your docs use assignment instead of passing the new values as arguments to methods.
    Doh, that's why an extra set of eyes is useful... The test module can't pick that up
    Fixed also.
    juster wrote:Lastly, and maybe most important, why not put this on CPAN? Join us in the chaos! Anyways... have fun and merry xmas.
    I was thinking about it... Wanted to make sure it's not a complete dogs breakfast first though

Maybe you are looking for

  • Move backed up music into new itunes

    I backed up my itunes to an external hard drive when computer crashed, but cant figure out how to move into itunes all at once.  I can only do it one by one.

  • RCVPOR blank on IDoc in R/3

    Hi All, I have a HTTP to IDoc scenario (HTTP > XI > R3).  For the Integration Repository, we are using the XSD from the imported IDoc from R3, with a minor change.  A message interface is also created.  In the Directory, 1 business system is created

  • Logic 9 will not open after mavericks installation

    Hi!, I have recently installed mavericks, now logic 9 will not open. At all .I tried to update Logic, and am now running version 9.8.1. Still the exact same outcome, any help as to what may be the problem would be greatly appreciated!

  • New gen Mac Mini: Boot Camp install problems

    I've got a new version Mac Mini that was just released, 4GB RAM, 250GB hard drive. Fired up Boot Camp, and pressed the button offering a 32GB Windows partition. It rebooted into my OEM XP Pro SP2 CD, and installed OK (as in it loaded the files). The

  • Bug in Flash Professional CC when launching debug launcher xml file handle not released

    There appears to be a bug in either Adobe Flash Professional CC, or ADL when launching debug launcher for an AIR application Flash Professional CC automatically generates or updates the XML app descriptor file. The bug is that Flash Professional is n