A lonely program missing its other part??  ~o~

My program was suppose to output the diameter,circumference and area of a circle with the input of the radius. For some reasons, it only run half way and never get to the print method.
thanks
guys
import java.io.*;  //package for Java input/output classes
public class Circle
     static class circleInfo
          String RESULT;                                   //Input action that determines what to be calculated
          float RADIUS;                                   //Input value for the radius of a Circle
          final float PI = 3.14159265F;               //Constant for PI
          double DIAM;
          double CIRUM;
          double AREA;
           public circleInfo() throws IOException //The main method of this program
               BufferedReader in;
               in =
                    new BufferedReader( new InputStreamReader( System.in ) );          //Input stream for strings
               System.out.println( "Please enter the radius of a Circle: " );                         //Prompt the user to enter the radius value
               RADIUS = Float.parseFloat (in.readLine() );                                                  //convert the input to a float, and assign it to 'radius' variable
               DIAM = RADIUS * 2;                                   //Calculates and returns the circle diameter
               CIRUM = 2 * RADIUS * PI     ;                         //Calculates and returns the circle circumference                                             
                  AREA = RADIUS * RADIUS * PI     ;                    //Calculates and returns the circle area                    
         public void printcircleInfo()
               System.out.println( "A circle with radius of" + RADIUS + " have:");
               System.out.println( "A Diameter of " + DIAM );
               System.out.println( "A Circumference of " + CIRUM);
               System.out.println( "And an Area of" + AREA);                         
public static void main(String[] args)throws IOException
     circleInfo testcircleInfo = new circleInfo();
     }//end main
}//end Circle

Yeah, drop the teacher and get a copy of Effective Java instead. And The Elements of Java Style.
You already have a nested class, although not an inner class. The nested class in this case is entirely pointless.
Ways you could improve your code:
- Don't get user input inside of the constructor.
The constructor will block (it won't finish) if input isn't provided on the console. That's bad. And since the object has nothing to do with I/O or parsing, it's bad that it could throw exceptions about that.
A much better approach would be to get the user input somewhere else, turn it into a number type somewhere else, and then finally create the circleInfo object using the number.
- Drop this weird Circle/circleInfo dichotomy. What's it supposed to mean? If I told you vocally (without looking at code) that there was a Circle and a CircleInfo, what would you think the difference would be? (In particular, if CircleInfo holds information about a circle, then what's Circle for?) You should use nested classes when they're useful, not just for the hell of it.
- Make the Circle class (since circleInfo no longer exists) immutable. Its fields should be final.
- Follow naming conventions

Similar Messages

  • I am working on a PC.  My InDesign CS6 was working but is now missing its amtlib.dll file.  To fix it it says to reinstall program but I was am idiot and didn't make a copy.  Is there any way to reinstall this missing file?

    I am working on a PC.  My InDesign CS6 was working but is now missing its amtlib.dll file.  To fix it it says to reinstall program but I was am idiot and didn't make a copy.  Is there any way to reinstall this missing file?

    It was bought for my son and he never registered it. 
    I still don't understand why Neema was trying to reinstall it when she didn't have the serial number but after she uninstalled it, said she couldn't reinstall it because I didn't have the serial number.  I never had it yet she didn't have a problem with trying to install it originally.
    Still won't buy another Adobe product again.  I've talked to a lot of people who can't stand Adobe and I now know why.  I can't even update Flash without my whole system crashing or getting a virus.
    I won't re-purchase InDesign either.  I realize it should have been registered and I explained that my email had been hacked and my proof of purchase was deleted with ALL of my emails and I also had a major virus after updating Flash.
    I can't afford to buy the same product twice.
    I will find out what other formats my book distributor (Ingram Books) accepts and purchase that program.
    Not impressed with Adobe and will share my experience with others so they can be sure to register their product and make a copy of the program BEFORE allowing an Adobe employee to take control of their computers.
    If you knew the answer to my question, customer support should have too.
    Thanks for your help.
    Denise

  • On my MacBook Pro, sometimes when I click to close tabs in Safari the button will not work.  I have to click on some other part of the screen and then it will.  This happens in other programs like Word/Excel for changing font, etc. Solution/Suggestions?

    On my MacBook Pro, sometimes when I click to close tabs in Safari the button will not work.  I have to click on some other part of the screen and then it will.  This happens in other programs like Word/Excel for changing font, etc. Solution/Suggestions?

    Start up in Safe Mode.
    http://support.apple.com/kb/PH4373

  • Does Iphone 4s have its serial no./IMIE no. or any other unique no. written on its hardware parts apart from sim tray. I mean somwhere inside? I know I can get it from settings, or on Box or from Sim tray.

    Does Iphone 4s have its serial no./IMIE no. or any other unique no. written on its hardware parts apart from sim tray. I mean somwhere inside? I know I can get it from settings, or on Box or from Sim tray.

    Ask in iFixit forum, they are the people that dismantle all apple equipment.

  • Is it possible to deconstruct an existing video to get its component parts?

    I made a video http://gallery.mac.com/lorna6#100193 years ago from footage taken in about 2000 and 2001. In a prior thread I mentioned having somehow losing the AUDIO component. Well, disturbingly, I went and watched the video from my old iMovie '06 and discovered that it was the video clips that were missing, not the audio. In the picture below, those black frames represent no video to be seen. I think that the exclamation mark in the yellow circle means the same thing or that something went awry.
    Here is a picture of the clips in the work space part -- the upper left quadrant, of my iMovie '06 project.
    To clarify: I forgot how I made that video because it was so long ago. I know from reading about iMovie '09 that I will probably do more videos on it because it sounds less complex but equally good for the most part.
    Someone in this forum, John, encouraged me to go over the highlights of that old video using the iMovie '09 program and I liked that idea........ so you can imagine my dismay when I returned to the program, opened it up, and now see that I lack not the audio, but the most precious video.
    Sadly, the original footage is lost due to external hard drive crashes. I might have kept a memory chip that had it but after all these years and me being disorganized, I do not know where it is.
    Is there a way that I can use the iMovie 06 video that you see at my Mobile Me Gallery to extract the clips and the audio? Or if not the audio, then at least all of the video clips? *Is it possible to deconstruct an existing video to get its component parts?*
    ~L

    I have had a series of iMovie applications but I used them all too infrequently, partly out of Fear of Trying. Now with the iMovie '09 out, I think I can do it. Yes, I know that I made the Cheyenne video with a previous app, but I found it confusing at times, and look now and see how I bollixed it up, losing some clips in ways I do not know.
    You (John C.) wrote:
    That's a miniDV camera, which uses tape. It's very similar to my earlier camera, as listed in my details below - the Sony DCR-TRV20. I now mainly use a high definition AVCHD Sony HDR-SR7 - that's why I've switched from iMovie HD 6 to iMovie '09.
    .......... Lorna says ...........................
    John, I call that a Pandoa's Box paragraph up there! First of all, I am left thinking that the type of videocam that I use will determine which kind of iMovie application I use. Yes? Can I assume that since you with your Sony DC-TRV20 have high definition AVCHD, then my DC-TRV11 might also have it.
    I have my user manual in front of me and looked in the Index for both HD and AVC (what is the C in AVC?), and neither is listed. I cannot find anywhere in the manual that tells whether my mini digital TRV11 also has high def AVDHC.
    How important is that in using the new iMovie '09? If my Sony does not have it, then does that simply mean that I cannot make use of the HD capability of iMovie '09?
    All of this would have been a moot question because earlier I had decided to just use the video component in my Canon digital camera, but then getting my Sony mini digital out and seeing and touching it, and remembering it worked, I began thinking that maybe I should use the camera video for when I am away from home and the Sony for when I am here at home.
    There is one thing I would say about HD: It is a memory gobbler, and if you make videos for YouTube, you might feel the constraints within that platform. It might be better for showing things to family and friends on your home tv with no megabyte or time restrictions.
    You/John C. continued writing:
    Your thoughts on archiving and backup sound sensible Lorna. I must admit, I don't backup as often as I should. I've been using the old Apple Backup program, but am considering moving to Time Machine, with an appropriate hard drive to match - maybe Time Capsule like you are using.
    .......... Lorna says ...........................
    John,if you decide to get Time Capsule to work wirelessly and continuously with Time Machine, then I suggest you consider a 2 terabyte capacity. I began using the Apple Back up but found it confusing and ultimately insufficient.
    You/John C continued writing:
    Currently (as listed below), I have 4 external hard drives - 3 are FireWire 400 and the largest one is FW 800. None of these has ever given me a problem (touch wood) - they are LaCie 120GB (not your favourite!), and 3 Maxtor's - 250GB, 300GB and 1TB. The 1TB drive is RAID enabled, having two 500GB drives in the enclosure, which I'm effectively using as one drive, that is, one is not a mirror of the other - so if one fails I've lost all the data! A good reason for using Time Machine.
    .......... Lorna says ...........................
    John I still am not clear on what RAID is and I guess I will Google it to find out. What is the purpose of having two separate drives housed in a shell? Is it about saving space? Or is it about ports? Or what?
    Of course, if you get the one that was mentioned by someone earlier, than it would warn you when something is about to go wrong and you could act pre-emptively. But that was suggested for a business or a pro, neither of which I am.
    You/John C wrote:
    As my HD camera is a hard drive model (60GB), I archive the footage to the Maxtor 1TB drive, using iMovie's "Archive All" feature. From there, it's easy to import clips into an Event, which is also stored on the Maxtor - so double jeopardy! I had better get cracking on updating my backup strategy
    .......... Lorna says ...........................
    I am lost. What do you mean, your HC camera is a hard drive model? And what you wrote sounds like something important that I should understand more precisely. I am thinking that the salesguy at Best Buy was right: I should get yet another hard drive in which to store specifically and only my homemade video stuff, my iTunes, and my photographs. I don't know how I would do that, though, if I want them to be stored ALSO IN MY 2TERABYTE SEAGATE as a double archive.
    -L
    John

  • From where can i download "adobe acrobat distiller" ? and if its a part of acrobat family, is it ava

    From where can i download "adobe acrobat distiller" ? and if its a part of acrobat family, is it available as a separate install within this product family "acrobat"
    What is the latest version of distiller.
    Where can i find more informaiton just on distiller?
    Thanks,
    N

    There are many different Acrobat-related products.
    Acrobat Standard
    Acrobat Pro
    Adobe Reader
    LiveCycle (actually this is another separate enterprise oriented Acrobat family of products.
    Acrobat Standard and Acrobat Pro will each install several software programs on your computer. One of which is Acrobat Distiller. Acrobat Distiller is a program that is used to convert postscript files into pdf files. Acrobat Distiller used to be the only way to create postscript files. Now many users never use Distiller to create pdf files, hence its prominence is deminished.

  • Program monitor only showing part of clip.

    Hi
    My program monitor only shows part of a clip during playback, though output to an external monitor is fine. If I stop playback and click in the monitor window, the clip is displayed correctly, but reverts back to partial when playing back.
    This started happening today after installing Matrox tools update to 5.1 and latest matrox effect patterns.  Everything else is perfect inc source monitor.
    Have tried may settings changes, new projects old projects, new clips etc etc but its the same every time.  Any ideas what has gone wrong? Its been running perfect for last 4 years.  Is it worth reinstalling CS5 and would I have to reinstall Matrox also?
    Windows 7 system 64 bit;  2 x 2,66 quad xeon processors;  4Gb ram;
    ATI 4670 512mb graphics card;
    Prem Pro CS5
    Matrox RT.X2
    Many thanks

    Hi
    My program monitor only shows part of a clip during playback, though output to an external monitor is fine. If I stop playback and click in the monitor window, the clip is displayed correctly, but reverts back to partial when playing back.
    This started happening today after installing Matrox tools update to 5.1 and latest matrox effect patterns.  Everything else is perfect inc source monitor.
    Have tried may settings changes, new projects old projects, new clips etc etc but its the same every time.  Any ideas what has gone wrong? Its been running perfect for last 4 years.  Is it worth reinstalling CS5 and would I have to reinstall Matrox also?
    Windows 7 system 64 bit;  2 x 2,66 quad xeon processors;  4Gb ram;
    ATI 4670 512mb graphics card;
    Prem Pro CS5
    Matrox RT.X2
    Many thanks

  • Can't run iTunes, Apple Application Support program missing.

    Can't run iTunes, Apple Application Support program missing.  It's a brand new computer, never had iTunes installed.  I've attempted 16 installs, each time uninstalling the previous install and verifying no Apple software installed before trying again; I've also been using different browsers, still no luck.  Windows 7, 64 bit.

    Try downloading 7-Zip (free), or a free trial of WinRAR, and unpack the iTunesSetup.exe or iTunesSetup64.exe file into its components then try installing them individually in alphabetical order (don't try to install SetupAdmin.exe or iCloud.msi). AAS might not install right now, but you may get a more useful error message as to why not, or it might install once the other components have been installed.
    tt2

  • Having trouble installing photoshop elements 10. Keeps telling me "file archive part of PS ele 10 is missing. need all parts to extract??

    Having trouble installing photoshop elements 10. Keeps telling me "file archive part of PS ele 10 is missing. need all parts to extract??

    there are two files for win os, an 7z and an exe.
    download both, place both in the same directory and click (or double click) the exe.
    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 |12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.
    window using the Lightroom 3 link to see those 'Important Instructions'.

  • How can I save a page and all its component parts in a single file, like IE does as an MHT - it's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)

    how can I save a page and all its component parts in a single file, like IE does as an MHT?
    It's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)
    It is simply too painful to have to zip everything up into a single file to send. MHT format has been available for years now from IE, and with every new FF release it's the first thing I look for. I have been using FF for years, and hate having to come out of it, over into IE |(which I even took out of startup) and key everything in again, in order to send somebody something in a convenient format that they can open with a single click.
    I can't believe this hasn't been asked before, so have you looked at it and rejected it? Have MS kept the file format secret?
    Thanks
    MG

    This is not really an answer just my comments on your question.
    I am sure I recollect efforts being made to get mhtml to work with FF.
    Probably the important thing to remember about .mhtml is that if other browsers do support it they may need addons, and may not necessarily render the content correctly/consistently.
    There are FF addons designed for archiving webpages, you could try them, but that then assumes the recipient has the same software.
    You could simply save the page from FF to your XP pc; then offline open it with and save it using IE, before then emailing using FF, and attaching the .mht or mhtml file that you have now created on your PC.
    As an alternative method, in some cases it could be worth considering taking a screen grab of the required page, then sending that to the recipient as a single email attatchment using either a bitmap or jpeg file format for instance.
    Something such as an airline booking may be designed with a print option, possibly it could be worthwile looking at sending the print file itself as an email attachment.

  • HT1926 when updating Itunes on my computer an error message appears stating that itunes update cannot be completed because there is a program missing.  What program is it that itunes needs?  I am currently using windows xp.

    My sister has given me a fourth generation ipod.  I am trying to update itunes and an error comes up and says that there is a program missing.  What program is that? Any ideas?  I am super frustrated.  Thank you for any help.

    Try the following user tip:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Missing rests in part box

    Downloaded Logic 10 yesterday and found that the user rests are missing in the part box of the score window. Do I have to download the basic software again (for free, I hope!) or is there another way?

    Hi
    Pancenter wrote:
    Rests are advanced tools...?   hahahaha.  Somebody needs to sit down and have a talk with the people making these kind of decisions. 
    Hmmm... I can only assume that they feel that User Rests are an advanced score function?
    CCT

  • I recently moved all my logic audio sessions to a back up hard disk. Also updated to Loin OSX. My Stylus RMX is not working. I get a message Missing Element on Part 1...Currently not installed on their computer or has been moved to a different folder. An

    I recently moved all my logic audio sessions to a back up hard disk. Also updated to Loin OSX. My Stylus RMX is not working. I get a message Missing Element on Part 1...Currently not installed on their computer or has been moved to a different folder. Any help out there?

    Hi
    Sounds like you may have moved the RMX library folder?
    Is RMX fully updated (for Lion)?
    Check your hard drives for a file called SAGE:
    It (or an alias of it) is normally found in the <USER>:Library:Application Support:Spectrasonics.
    Note that on Lion, the <User> Library is 'hidden'... quickest way to get there is to hold down Option (Alt) whilst using the Finder:Go menu
    CCT

  • I cannot get my photo to print for this reason -there is a photo in this print job which is missing its source file

    I'm working in lightroom to print cards with a custom print size.  When I set up the printer I get a message that reads "There is one photo in the print job which is missing its source file".  The preview shows my card as blank.  What is wrong?

    I would believe what the message is saying, that a photo is missing.  Do you know what photo you're trying to print, and if you look at this photo in Library, does it have a question mark on the thumbnail or other indication that the preview is there but the master photo is gone/moved?

  • My Mac HD says that I have Quicktime Software, all that I find in my applications is Quicktime Player. And I cannot unlock Quicktime Pro in this program through its preferences.. help?

    My Mac HD says that I have Quicktime Software, all that I find in my applications is Quicktime Player. And I cannot unlock Quicktime Pro in this program through its preferences.. help?

    http://support.apple.com/kb/DL923?viewlocale=en_US&locale=en_US
    Install and register this version. It installs in the Utilities folder.

Maybe you are looking for