What is the proper way to create a new line space int the output?

I want to create a space in between each input so the output would look something like this,
Name of item 1: lollipops
Quantity of item 1: 10
Price of item 1: .50
Name of item 2: diet soda
Quantity of item 2: 3
Price of item 2: 1.25
Instead of this:
Name of item 1: lollipops
Quantity of item 1: 10
Price of item 1: .50
Name of item 2: diet soda
Quantity of item 2: 3
Price of item 2: 1.25
Here is my code:
for (i = 1; i < 4; i++)
               System.out.print( "Name of item " + i + ":");
               name = keyboard.nextLine();
               System.out.print( "Quantity of item " + i + ":");
               quantity = keyboard.nextDouble();
               keyboard.nextLine();
               System.out.print( "price for item " + i + ":");
               price = keyboard.nextDouble();
               keyboard.nextLine();
          }I know i can use the an empty output statement but is there something that will make my code neater?
Edited by: RandellK on Sep 27, 2009 6:23 PM

Just use an empty println.
It's a pretty common idiom and no messier than printing a newline.

Similar Messages

  • Whats the esiest way to create a new photo album in the photo option?

    help i cant figure out to create new photo albums on the iphone

    Have a Look Here:
    https://discussions.apple.com/message/12290764#12290764
    And Here:
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    I'm having problem with text boxes.  Whenever i hit the enter button to start a new line or paragraph, the cursor doesn't drop down to the next line.  Instead i get this little red + sign in the box.

    You are absolutely right.  Thought Enter meant Enter.  I was wrong.  Thank you for the help.
    Rod Rogers, Broker
    Accredited Land Consultant (ALC)
    Metcalf Land Company, Inc.
    Office: 864-585-0444
    Mobile: 864-316-0297
    Fax: 864-583-6000
    <http://www.metcalfland.com> www.metcalfland.com

  • What is the proper way to create a monotone image with real looking contrast?

    Once I apply a color to my previously created black and white image everything looks washed out.
    I have an artwork with 3D representation of the letterforms, casting shadows on the textured surface. Shadows are deep black. I need this artwork to be colored in gold. My client forwarded me the specs for the metallic gold which he got from the PANTONE. They are:Gold (871); Adobe 1998 RGB: 126-113-76
    HSB*: 44 degrees-40%-50%
    What is the proper way of applying those values to the desired image.
    My idea was to make the image black and white and than create a monotone image with the above specs. In this case the image gets washed out as the darkest black in the shadows becomes this Pantone gold. Is there any other way?

    A duotone will work, however you are going to want to work closely with your printer . Most printers will want the second color in CMYK (Possibly C60 M40 Y0 K100 instead of RGB values or specify a Pantone Rich Black (I personally like 6C)but it will cost you more for the wash up of both heads of the printer...
    Go to Image>Mode>Duotone (image must be greyscale first for this to work) then add the desired colors to your ink scales.

  • What's the easiest way to create a new VLAN and then move all existing devices to it?

    One of our locations was implemented using VLAN1 as the main (native) VLAN. My goal is to create a new sub-interface on the router and then move all the existing switches (all Layer 2) into the new VLAN, without disrupting the network (and remotely). I am trying to determine the best way to proceed. Thanks.

    I wanted to shed a little more light on the situation. The "new" VLAN has actually been in existence since the network was initially setup. The network runs VTP and the new VLAN already has an interface on the router and already shows up on all the switches when you do a "sh vlan" command. We have about 10 VLANs in all. In reality, I am simply trying to migrate about 8 switches from VLAN1 (which they never should have been on) to the new VLAN. I know that I need to create an interface for the new VLAN on each of the switches and then swap the management IP to that interface. If I could connectly directly into each switch via the console port, this would be a simple task. However, the switches are in extremely remote locations with special circumstances, thus I have no physical access to them. This fact has me a little reluctant to making the changes, as we can't afford any mistakes that would potentially cause network downtime. I am looking for some guidance on exactly the steps to take to achieve my goal. Let's call the new vlan, VLAN2. During testing, I logged into a local switch that was on VLAN1 (that's where it had it's management address). It did have VLAN2-VLAN10 as well, via VTP. I created an interface for VLAN3 on the switch and then accessed it via VLAN3 to swap the main management interface from VLAN1 to VLAN2. The changes took, but I couldn't access it via VLAN2. I am assuming this is because the router still has VLAN1 listed as the native vlan and the VLAN2 IP address is still assigned to VLAN1 on the router. What would be the best way for me to make the required changes on the 8 switches that need swapped, without losing remote access? It wouldn't hurt if the network went down for 5 minutes or less, but we can't have a big outage. Thanks.

  • What is the best way to create a diagram or space layout?

    I need to create a layout of an area for an upcoming event.  What is the best way to do that?

    Here are 2 free programs that I use for making sketches. There are others also available. (Google is your friend)

  • What's the "right" way to create a News list in CQ5.4?

    Hey folks,
    I'm a brand new CQ developer and, though I've done a lot of reading, I'm still in the dark on how to do a few things.
    I'm currently working on a corporate website, and I need to build a News page. Each article contains a title and rich text (possibly including embedded images, videos, etc...), and the News page itself should display a paginated list of recent article summaries (with "read full article" links). I also need to show the two or three most recent article summaries on the site's front page, under a News heading.
    I thought there'd be a pre-built component to cover this case, since most corporate sites include a News page of some sort, but I haven't found one. Am I missing it? I looked into the Blog page template, but I think that adapting that may be overkill.
    I think that the right way to do this would be to build a News component with a Title and Rich Text field in the edit dialog. New articles could be created by dropping these components into the parsys of the News page. I could then create both a .html and a .summary view for the components and use a customized List component to display the summary list on the front page. Am I on the right track here, or am I overcomplicating it?
    Thanks!
    - Michael

    Hi,
    The "right" way of building any list-like component is to extend the existing List component.
    That is referenced in this documentation page:
    http://dev.day.com/docs/en/cq/current/wcm/default_components.html#List
    You can find it under /libs/foundation/components/lists
    To create, for example, a 'News List' component, just create a new component under your /apps/myproject/components, setting 'foundation/components/list' as sling:resourceSuperType ans add your custom script to display each news item. see also [1]
    That way you canprovide more renderers to be used around your site(s)
    [1] - http://dev.day.com/docs/en/cq/current/developing/components.html#Developing%20a%20new%20co mponent%20by%20adapting%20an%20existing%20%20%20%20%20component
    Hope this helps,

  • Does anyone know what is the proper way to render a rectangle transparent texture over the screen in OpenGL ES 2.0?

    Hello I'd like to convert my directx program to ios and I'm stuck right now on rendering textures.
    I messed around and enabled otho camera in open gl ES 2.0 and textures render but I can't get alpha to work.
    I used glDrawArrays specifying the colour as my colour with the alpha yet it seems to completely ignore the alpha.
    Do I need to enable states as with directx?
    I'm very new to OpenGL. (if there's any directx to OpenGL tutorials about they might be nice I did buy an OpenGL book but it's all wrong since it uses glVertex3f etc which isn't VBO obviously that won't work for app store apps)

    Thank you both guys.
    As John said, I believe I'm looking for a gap-free sequence per master record.
    The line number of the OrderItems table is the second half of the primary key. The first half of the primary key (DocumentNumber) is the foreign key to the Orders table.
    Think of it like line items on an order or invoice. For example, if you were talking to someone on the phone concerning an invoice, you might say, "The pricing for line item #3 is incorrect." In this case, it's good to have a common reference. Or imagine a Microsoft Excel spreadsheet with no row numbers displayed! You'd never get anywhere if you had to explain something over the phone.
    If this is tricky to perform, I take it using a sequence and trigger such as the Fusion Order Demo is the best way to approach the challenge for simplicity's sake?
    Will

  • What's the best way to create and edit a PDF where the source document is also a PDF?

    Hi,
    To be specific, we are in the process of upgrading our A/P processes and we have received a user manual from the company we contracted for the upgrade. I've been tasked with customizing this manual for my company's specific processes (this is with the permission).
    What is the best course of action to accomplish this? I thought I should save a copy of the manual, and then modify each page as necessary. I will be adding and deleting text and graphics. I have never used Acrobat before, but consider myself a quick study.
    Any suggestions wil be greatly appreciated.

    When Acrobat saves to Word 97-2003 format, it actually writes a Rich Text Format file - the binary .DOC format used by Word is a closed standard. The .DOCX format is just XML, and neither export process cares if you have Office installed or not. In theory, OpenOffice can read both types of file; but there does tend to be some minor difference between how OO arranges things and how MS Word does it.
    The critical thing is that if the PDF file has structure tags (i.e. it's accessible), Acrobat can flow the content properly in the exported file and can identify things as headers, quotes, lists, tables, etc. If not, it has to guess what the reading order is based on where things are on the page, and it will often get confused by intricate layouts, spanned columns, etc. There are of course some things (such as Word Art) which don't survive the trip to PDF and back, and will show as an image.

  • What is the proper way to format a new HD as GUID before installing Leopard

    Before installing Leopard on my new WD RE3 HD I went into Leopar disk utilities and chose PARTITION and then under advanced I chose GUID and let it do its thing. Now when the disks display on boot (I have both Leopard & Snow Leopard dosks availale) when I hold down the OPTION key the Leopard disk shows as "Leopard" but the new Snow Leopard disk displays as "EFI Boot" and I have been told it's because it was not formatted as a GUID disk. Would installing and booting up with Snow Leopard even be possible on a non GUID disk? The Snow Leopard drive is designated as the boot drive and it boots up just fine with no error messages... only when I do a selective boot do I see it as "EFI Boot disk"

    Sorry to disappoint, but...
    I have a MacBook Pro and I have partitioned my internal hard disk to have both Leopard and Snow Leopard. When I restart the computer holding the option key, it shows both Leopard and Snow Leopard. Then I choose which one I want.
    Now, I installed the new Disk Warrior 4.2 on my Leopard partition and recreated the directories for the Snow Leopard partition. Then when I restart holding the option key, it shows Leopard and EFI boot.
    This leads me to conclude that DW 4.2 somehow hosed something in the disk. Being the coward that I am I had backed up my Snow Leopard partition. Put it back and it shows, Leopard and Snow Leopard as expected.
    Roberto
    Message was edited by: Roberto Sepúlveda

  • Return key not creating a new line when using the horizontal text tool

    Going through the adobe after effects 'classroom in a book' examples - when writing a line of single line using the horizontal text tool pressing return does not create the next line underneath, the cursor stays on the same line?
    Anybody out there had this problem?

    Hi Bill
    Thanks for replying!
    My OS is windows 7. I think it is the first time I have needed to put more than one line of text in an after effects layer. I am new to CS5.5 - after effects and I'm going through an adobe tutorial  'classroom in a book' series book.
    I thought about using a paragraph text box as you suggest but could not find the function in the tools menu.
    I have since tried clearing the cache out and restoring default layout but with no joy.
    I have used the return key for multiple line text in premier pro and it works perfectly ok.
    Cheers,
    Alan

  • What is the best way to create the layout for a single page website in Adobe Muse?

    I was wondering the best way to create the layout for a single page website in Adobe Muse. Does anyone have any suggestions?

    I know how to create a website but will that help me create a single page website? Below I will leave a demo of what I want. I want it to only have one page but multiple sections. What is the easiest way to create a single page website like the demo below?
    Demo Website

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • What is the Proper way to nullify the VECTOR after it's scope is over

    I am using Vectors and Array lists at many places in my Web Application, It is neccessary to use them.
    In some processes I m storing bulk amount of data into vector due to that the performance of my application will be decreased, for that I have to nullify the vector after it's scope is over.
    To nullify I m using Vector v = new Vector()
    v.clear().
    The above method is suitable in case of simple object data like strings and other values.
    But I wanna know that If I m using HashMap and storing bulk data in it and then I m storing each HashMap into vector, what is the proper way.
    Does I have to iterate each object of HashMap from vector and set them as null and then set vector as null or directly I can use v.clear() method??
    If any having any answer regarding my question then plz reply your each valuable reply will be appriciable.
    Thanks in advance......!!

    JBOSS2000 wrote:
    Each time in loop a new object of vector is created and each time I m nullifying it. Thats what I m doing.
    Thats why I m nullifying it.
    Even if I'll declare it out side the loop then also for the each iteration I have to nullify it cause what I m doing is I m inserting the data into database in each iteration of loop, So that I think it is must to nullify the objects each time.If it is constructed inside the loop then you do not have to nullify it. If it is constructed outside of the loop and you want to empty it for each iteration then just clear() it.

  • What is the proper way to publish standard proxies/services using PI?

    Hello experts,
    Iu2019m working on a Project where we have an ECC 6.0 and we need to publish some standard services to external third-party applications. We found that the functionality that these third-party applications need is accomplished by the service MaintenanceRequestCreateRequestConfirmation_In of component ESA ECC-SE 603. As we are centralizing all our interfaces in SAP Process Intregration I have installed the ESA ECC-SE 603 XI content in SAP PI. After the installation, in tr. SPROXY transaction of the ECC system I can see the proxy properly implemented and ready to be called. And now I have to configure the interface in Integration Directoy. What I wonder is whatu2019s the best practice to configure this in PI? As I can see in ESR the service category is Inbound but, if Iu2019m not wrong, I have to publish a Outbound service? What should I do? Copy the entire definition to my own Software Component and create my own Outbound service? What is the proper way to publish standard proxies/services using PI?
    Thank you in advance.

    Using the Page Items to Submit property on the report region, the Refresh action is all that should be needed. I created a copy of page 2 on page 3, removed the Set Value action, and it is working as expected. I don't have access to 4.2.1 to try it on that specific patch level, but I've been using Page Items to Submit with a Refresh DA since 4.2.0 with no problems.

Maybe you are looking for

  • Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?

    Why does a mail-merge in MS Publisher split into multiple files when printed as a pdf file?

  • Can I get my Laserwriter Select 360 to work on my intel iMac?

    I have a new Intel iMac running 10.4.8. I want to use my Apple Laserwriter Select 360 with the iMac connecting via an Ethernet to Local Talk bridge (Assantetalk) via my net gear router. The driver comes up in the printer list, but it comes up with an

  • Wireless card and kernel panic

    So for no apparent reason my airport has failed in my powerbook 17" 1.5 w/1.5. It just has no strength to start and seems to loose juice as time in a given session passes. so I threw a wireless card I had in to see how it would fare. The good news is

  • Can Someone explain Apple's Notes App to me?

    I have a couple of questions about Apple's Notes app. For one, why do I have two different notes accounts. One is from my Gmail, and the other says "From my Mac." I created neither of these directly. I have forwarded some notes to myself and I think

  • Free download of PSE 5

    i saw a link where to download this old software. anyone know where it is now? thanks PS what is CS2 cos it is free also does anyone USE this forum? sure don't look like it!