I NEED HELP WITH HOMEWORK AS SOON AS POSSIBLE PLEASE IF POSSIBLE EVEN TODAY

I HAVE A COUPLE OF PROBLEMS I DON'T REALLY HOW TO EVEN START AND I DON'T REALLY KNOW WHAT TYPE OF PROBLEMS THEY ARE. HERE IS AN EXAMPLE!!
Given 2 ints, a and b, return their sum. However, "teen" values in the range 13..19 inclusive, are extra lucky. So if either value is a teen, just return 19.
teenSum(3, 4) → 7
teenSum(10, 13) → 19
teenSum(13, 2) → 19
THIS IS ALL THEY GAVE ME
public int teenSum(int a, int b) {
}

This is all i have done so far!
public int teenSum(int a, int b) { 
int sum;
sum = a + b;
if ( 14 < sum || 20 < sum ) { 
return 19;
return sum;
but then i have a chart that tells me in what parts i have passed it and in what parts i failed.
Function Call     Expected     This Run     Result
teenSum(3, 4)      7     7     PASS     
teenSum(10, 13)     19     19     PASS     
teenSum(13, 2)     19     19     PASS     
teenSum(3, 19)     19     19     PASS     
teenSum(13, 13)     19     19     PASS     
teenSum(10, 10)     20     19     FAIL     
teenSum(6, 14)     19     19     PASS     
teenSum(15, 2)     19     19     PASS     
teenSum(19, 19)     19     19     PASS     
teenSum(19, 20)     19     19     PASS     
teenSum(2, 18)     19     19     PASS     
teenSum(12, 4)     16     19 FAIL     
teenSum(2, 20)     22     19      FAIL     
teenSum(2, 17)     19     19      PASS     
teenSum(2, 16)     19     19      PASS     
teenSum(6, 7)     13     13 PASS     
Score: 13 out of 16 (81.2%)

Similar Messages

  • HT4199 I need help with getting my printer to print, PLEASE.

    I need help with getting my printer to print, Please.

    What have you done so far?
    I suggest you connect it via a usb  cable first.  Once you get the printer working, move to wifi.  You will have to use an existing printer usb cable or purchase a cable.  Be sure to get the correct cable.  Ask for help.
    The warrenty indicates there is phone support.  Give HP a call.
    Warranty
    One-year limited hardware warranty; 24-hour, 7 days a week phone support
    Robert

  • MOVED: need help with my k7n2 delta series motherboard please

    This topic has been moved to AMD SocketA based board.
    need help with my k7n2 delta series motherboard please

    "...the other memory ive been using is  memorymaxx 512mb ddr 3200..." If I understood right, your'e actually using both memories at same time so, your'e lucky if it works. We have said thousand times that mixing dif. brand/make/speed memories is a bad idea, most with this Mobo that is very picky about ram. If you want to avoid slowdown problems, stay with only one stick ( the better one ) until you can buy at same time in same store, 2 identical memories to replace the old one.

  • I need help with reporting as soon as possible!

    How can I do reporting in JDeveloper like in Crystal reports. Is there any extention or tool that can be of help.
    Thanks
    Edited by: Fenoch on Mar 12, 2010 6:34 AM
    Edited by: Fenoch on Mar 12, 2010 6:36 AM

    @Fenoch,
    I'm also new to the JDeveloper world and I haven't gotten into reporting yet, but a couple I've heard about are
    Oracle BI Publisher - http://www.oracle.com/technology/products/xml-publisher/index.html
    Jasper Reports - http://www.jaspersoft.com/
    BIRT - http://www.eclipse.org/birt/phoenix/ (more of an eclipse thing I think)
    I hope that helps, I'd like to hear what you find out about any of these.
    Don't let elitist responses run you out of the community.
    @John,
    John Stegeman wrote:
    If you need help as soon as possible, why didn't you try searching the forums?
    JDeveloper doesn't have reporting capability, per se, but there are a number of Java-based reporting tools out there, which you could find [url http://www.lmgtfy.com/?q=java+reports]here
    John
    Way to be an ass to a newbie. It is posts like this (from an Oracle "Ace" Director no less) that push people away from the platform.
    Maybe you could post a link to a reporting tool you know about, instead of sounding off like an elitists jerk and belittling a new guy. I'm sure you popped into the world full of knowledge and ego, never received any help or asked any "newb" questions.
    I also find it very interesting that your "helpful" search link sends us to GOOGLE and not on a search of these forums. Could it be that the forum search is unreliable and returns garbage results most of the time?
    You could have linked a forum search -
    http://forums.oracle.com/forums/search.jspa?objID=f83&q=java+reports (Typical unhelpful results set)
    http://forums.oracle.com/forums/search.jspa?objID=f83&q=reports (Slightly better, at least has a couple posts talking about Jasper)
    Re: Report Facility
    Or if you just gotta use google at least narrow it to the forum you are suggesting we search in -
    http://www.google.com/search?hl=en&as_q=java+reports&as_epq=&as_oq=&as_eq=&num=100&lr=&as_filetype=&ft=i&as_sitesearch=http%3A%2F%2Fforums.oracle.com%2Fforums%2Fforum.jspa%3FforumID%3D83&as_qdr=all&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images
    It is actually the low quality of the forum search tool that forces people to re-post the same questions as others have. I know I do it all the time after I've attempted multiple searches.
    TL;DR version
    Be helpful or be silent.
    Bullying the new people pushes them away and hurts the community. No new people -> no more JDeveloper.

  • I need help with Importing songs into Creative organizer please help!

    OK now i have a bunch of music files in my documents that all have MPEG4 with the itunes music symbol next to them. My problem is when i try to add them to my Windows media player nothing happens also when i search for the files in the Creative Import Wizard nothing shows up! Do i first need to put all the music i want on my ZVM im Windows Media Player first then add it's or is it something else? do i need to get rid of itunes entirely and just have the music files in my documents? Im really really confused please help!!!!!! Also No tracks show up when i try to add them to Windows Media Player or Creative MediaSource5 even though when i know i put them there
    P.S. What do u guys do ( I mean people with Zen Vison M's) Any know of any guides too? that would be great!Message Edited by Chrismic3 on 03-9-200705:54 PM
    Message Edited by Chrismic3 on 03-9-200706:00 PM

    bump

  • I need help with my nokia 9210...please take just ...

    i have 2 main questions and problems at the same time....
    first...can anyone help me with the all_nokia_9210_data.sis?
    my phone is worthless without them....
    and second...can s60 platform be installed on 9210?because i tried to run s60 apps and is requies is...please help me.......thank you so much...promise i will help you with everything i got for 9210
    Moderator note: E-mail address removed.Message Edited by sphere_s on 10-Dec-2007 05:25 AM

    08-Dec-2007 12:25 PM
    xardas wrote:
    can s60 platform be installed on 9210?Moderator note: E-mail address removed.Message Edited by sphere_s on 10-Dec-2007 05:25 AM
    You can't use S60 apps on 9210. And why would you need to From 3rd party sw, you usually see supported platforms. If S80 or 9210 is not mentioned, no need to buy that sw for 9210. Again, platform can't be updated to different version. 9210 has royal S80 platform, why would you like to downgrade that.

  • I need help with my Zen Vision M.. PLEASE HELP

    Hey, I'm having sooo much trouble with my Zen Vision M... so i was wondering if anyone could help me out.. i hav a couple of ?s that i desperately need answered. . All of my album art is the same and its driving me crazy. How do i change the album art?2. Is the battery in the Vision M removable?3. Can Zen Vision M shuffle songs?4. I used to have an Ipod.. i was wondering if?i could directly transfer songs from itunes to Zen MediaSource?~~~~~~~~~?Any help will be really helpful! Especially if?someone can help me with the album art!! THANKS GUYS!!

    . All of my album art is the same and its driving me crazy. How do i change the album art???Not an easy answer for this one without knowing more about how you are setting the album art.
    There are two types of album art embedding.
    One is where the album art is embedded directly in the tags of every Mp3 file. (a bit waste of space)? The second option (which is the more common method) is where each file has embeded information pointing to an external image for the album art. This is more efficient on space, and is often the one that end up with people having the same art on every song.
    Usually what happens is people put the songs in a common directory and not in subdirectories such as Artist/Album/mysong.mp3. With all the files in one flat directory often the album art (depending on software) gets saved with the same filename such at album.jpg.
    And he album.jpg file gets overwritten, and since all the songs think "their" album art is in the album.jpg file they all end up with the same art being displayed.
    Easiest solution is to copy the files into folders to organize them by album, and then reapply the album art.
    Since doing that on my ZVM I haven't had any problems with art getting lost or duplicated in ways I did not want. ?2. Is the battery in the Vision M removable???Unfortunatly it isn't.
    ?3. Can Zen Vision M shuffle songs???There are several random play options for music.
    In my opinion doesn't really feal that "random" though. 4. I used to have an Ipod.. i was wondering if?i could directly transfer songs from itunes to Zen MediaSource??You will need to export them to MP3 from itunes. Checkout the Creative KB on how to do it. Its solution ID 4653.
    ( tried pasting the URL in here but its so large, go to the knowledge base and search for "SID4653" )Message Edited by gmandual on 2-23-20060:0 PM

  • Need help with completion and debugging...please

    import java.io.*;
    public class DeleteSpaces3
         public static void main (String[] args)
              FileReader inputFile = new File("Omerta.txt");
              FileReader outputFile = new File("omertaEdited.txt");
              FileReader in = new FileReader(inputFile);
              FileWriter out = new FileWriter(outputFile);
         public static void Spaces()     
         try     
              BufferedReader in = new BufferedReader(new FileReader("Omerta.txt"));
              BufferedWriter out = new BufferedWriter(new FileWriter("OmertaEdited.txt"));
              String str;
         while ((str=in.readLine()) != null)
              while(line.indexOf("  ") > -1)
                   line = line.replaceAll("  ", " ");
                   out.println(line);
         in.close();
         out.close();
              catch (IOException e)
              System.err.println(e);
              System.exit(1);
         thats my code and the program is supposed to open a text file called "Omerta" and edit it so that it takes out all the double spaces between the words in the text file...ive been told that this should work.......yet i still am unsucessful in compiling the code....all help will be greatfully appreciated

    ive been told that this should workThe replies to your earlier posting here:
    http://forum.java.sun.com/thread.jspa?threadID=573173&messageID=2844611#2844611
    did not tell you that, they told you what was wrong - and is still wrong. And, in addition, you have introduced another error in your curly braces.
    You need to understand how to construct a Java class; see this tutorial:
    http://java.sun.com/docs/books/tutorial/java/javaOO/classes.html

  • I need help with windows 8 on my pc, PLEASE!

    HI, i have windows 8 on my pc. I've been playing games on my computer for 8 months since I bought it. I woke up the other day got on Big Fish to play my games as always, and ever time I push play it starts up then immediately goes back to the play. What
    is going on? The game won't stay on the screen, I've tried everything to fix it, please help me.

    Hi,
    I guess you're referrring to a game named  "Big Fish" which is installed in your system, and it stops working, right?
    Here're solutions I found on the Big Fish forum:
    Check error message.
    Update your video card driver.
    Kill the game via Task Manager, restart the game.
    Run the game as Administrator.
    Reinstall the game.
    It's recommended to post this issue in Big Fish Forum for they're more familiar with this product.
    http://forums.bigfishgames.com/forums/list.page
    NOTE
    This
    response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft
    does not control these sites and has not tested any software or information found on these sites.
    Yolanda Zhu
    TechNet Community Support

  • Need help with adding arrays to invoice.java please willing to pay?

    Using your Invoice class created in lab02, write a client program that allows the user to input three Invoice objects into an array of Invoice objects. After you have inputted all of the invoices, print a heading and then output all of the array elements (Invoice objects) by calling the method from your Invoice class that displays all of the data members on a single line using uniform field widths to insure that all Invoice objects will line up in column format (created in Lab04). At the end of the loop, display the calculated total retail value of all products entered in the proper currency format.
    Example of possible program execution:
    Part Number : WIDGET
    Part Description : A fictitious product
    Quantity : 100
    Price          : 19.95
    (etc.)
    Example of possible output
    Part Number          Part Description          Quantity          Price     Amount
    WIDGET          A fictitious product     100          19.95     199.95
    Hammer               9 pounds          10          5.00     50.00
    (etc.)
    Total Retail Value:                                   249.95
    This is what i have so far Invoice Test
    //Lab 2 InvoiceTest.java
    //Application to test class Invoice.
    //By Morris Folkes
    public class InvoiceTest
    public static void main( String args[] )
    Invoice invoice1 = new Invoice( "1234", "Hammer", 2, 14.95 );
    // display invoice1
    System.out.println( "Original invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    // change invoice1's data
    invoice1.setPartNumber( "001234" );
    invoice1.setPartDescription( "Blue Hammer" );
    invoice1.setQuantity( 3 );
    invoice1.setPricePerItem( 19.49 );
    // display invoice1 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice1.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice1.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice1.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice1.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice1.getInvoiceAmount() );
    Invoice invoice2 = new Invoice( "5678", "PaintBrush", -5, -9.99 );
    // display invoice2
    System.out.println( "\nOriginal invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    // change invoice2's data
    invoice2.setQuantity( 3 );
    invoice2.setPricePerItem( 9.49 );
    // display invoice2 with new data
    System.out.println( "\nUpdated invoice information" );
    System.out.printf( "Part number: %s\n", invoice2.getPartNumber() );
    System.out.printf( "Description: %s\n",
    invoice2.getPartDescription() );
    System.out.printf( "Quantity: %d\n", invoice2.getQuantity() );
    System.out.printf( "Price: %.2f\n", invoice2.getPricePerItem() );
    System.out.printf( "Invoice amount: %.2f\n",
    invoice2.getInvoiceAmount() );
    } // end main
    } // end class InvoiceTest

    i suck in java There are 2 possible reasons for this:
    1. you haven't studied
    2. you aren't cut out for programming
    and there r hardly any tutors at my school. plus i work 2 jobs day n night. Please, I'm only want help thats allYou have the help of the ENTIRE WORLD COMMUNITY right here, right now. But you're not willing to make any effort whatsoever. You think people will help or even respect you? You may fail your class and you may fail in life!
    Cheaters don't win and winners don't cheat!

  • Need help with embedded cue points in FLV please (quickly/ :-))

    Here is my scenario - I have a flv streaming in a swf. All I
    want to do is to is call the cuepoint (event) in the flv, so that
    it will go to and play somewhere else further down the timeline of
    the swf - I don't think it should require much AS, but I haven't
    done much communication of this sort between an flv and it's parent
    swf. Any help would be greatly appreciated! Thanks.

    I figured it out. If anyone is interested, this the code snippet I found in Adobes help that allows you to access cue points and trigger events on flv's brought in with netstream:
    function onCuePoint(infoObject:Object):void
    trace("onCuePoint:");
    for (var propName:String in infoObject) {
    if (propName != "Run")
    RunCuePoint.visible=true
    else
    trace("parameters =");
    if (infoObject.parameters != undefined) {
    for (var paramName:String in infoObject.parameters)
    trace(" " + paramName + ": " + infoObject.parameters[paramName]);

  • Need help with mi ipad ID iCloud. Please!!!!

    My email provider close. Change my email in the apple ID, update the password. However my ipad mini does not work iCloud account. Update the ID, iMessage, FaceTime correctly but NOT to iCloud. No restores because I enter the old password and ID but does not work or give coon new nor old. The ipad does not sync because all the space I remain locked in Other. Please help. In Colombia the technical support is not online or by phone or chat.

    Hi germanbl,
    Welcome to the Apple Support Communities!
    If you were still signed into the iCloud on your iPad mini after editing the Apple ID to new email address, it will be necessary to temporarily edit the Apple ID back to your old email address in order to sign out. Please use the directions in the attached article for more information.
    If you're asked for the password to your previous Apple ID when signing out of iCloud
    Change your Apple ID temporarily
    If signing out and back in to iMessage or FaceTime didn't help, try these steps:
    Change your Apple ID to the Apple ID you used previously. You shouldn't need to verify the email address.
    Tap Settings > iCloud. Complete these steps only if the Find My [Device] setting is turned on:
    Scroll down and tap Sign Out, then tap Sign Out to confirm. If you're using iOS 7 or earlier, tap Delete Account, then tap Delete to confirm.
    Tap Keep on My [Device] or Delete from My [Device]. In either case, your data remains in iCloud and will be updated on your device when you sign in to iCloud again.
    Enter the password for your previous Apple ID.
    Have a great day,
    Joe

  • I need help with my skype not responding. PLEASE H...

    So Ive been having troubles with my skype for a while now and i havent gotten them to stop. Whenever i load up skype it just goes to a white blank window and doesnt respond until i end it in task manager. Any advice or help would be greatly appreciated as this has bothered me for a long time now. 

    Please,  run the DirectX diagnostics tool.
    Go to Windows Start and in the Run box type dxdiag.exe and press the OK button. This will start the DirectX diagnostics program. Run this diagnostics and save the results to a file. Please, attach this file to your post.
    Be aware that you will have to zip this file before attaching it here.

  • Need help with linking text to nav bar please

    Basically, i designed a layout in photoshop7.0. I sliced it
    all, but left areas for where i wanted to type in text, then saved
    for web and opened it up in dreamweaver 8. The thing is, i dont
    know how to write the text in the area i left empty and it only
    shows when i click a certain nav bar. I usually use iframes, but
    this isnt gonna' be iframe friendly !!
    Just to reiterate, i know how to type in the boxes, just dont
    know how to link them to the nav bar buttons..
    Any help would be appreciated,
    Kind Regards,
    Shyam Tanna.

    This tutorial will show you how to do what you want.
    http://www.communitymx.com/content/article.cfm?cid=A0C1CA697A4E9774

  • Need Help with J2EE Connector Architecture!! Please!

    Scenario:
    We are trying to establish connectivity to a CTG using the new JCA connector specifications.
    We have our input in the form of a string but the Interaction.execute(ioRecord, ioRecord object specifies record object as parameters.
    How do we create a record that correctly represents our current input string?
    Is there a predetermined record format that we must use for out connection or can we create our own record?
    If we can create our own record how is it converted and padded properly for a byte stream that is required by the CTG?

    Send a message to [email protected] they help answer tough questions for a fee.

Maybe you are looking for

  • Cannot access a PDF with a link in IE 9.

    We have an application that shows a list of PDF Documents as links with in an aspx page.  When you click on a link it should open the PDF, and it does on XP pcs.  As of tuesday of this week the windows 7 pcs no longer function.   The Windows 7 machin

  • Problem starting with NWDS

    Dear All, i have a problem starting with netweaver developer studio. once it is opened , it is not responding......same application is staring again......keep not responding......... can anyone help me to solve this

  • CProjects - Issue related to WFM & Project role

    Hello All, Immediately after log-on I see two errors: "Communication with the WFM Core system is not possible" "Unable to establish connection to LiveCache" Ignoring these message, if I go ahead creating project, system allows me to create the projec

  • How can I eye dropper a color??

    When I use the eye dropper it doesn't pick up a color, it picks up the setting of the object selected. So for example if I have two objects and the one on top has a style, a blend mode and opacity and where two areas of the two objects intersect I wa

  • File to file scenario. Pls help

    Hi All, I have to make file to file scenario. XI will pick file from File Sender System and put file at File Receiver System. From there file will go to printer. File name has to be constant at receiveing system like "ABC.txt" There is one condition: