Please help me with my projectiles and angles program!!!!

I am having problems lining things up correctly. my program generates a table telling you how far an object will travel based upon its angle and its velocity. the chart has the angles along the top and the velocites down the side. default angles are 10,20,30,40,50,60,70,80 and default velocities are 20,40,60,80,100. I need the user to be able to enter the smallest angle, the angle increment, and the total number of angles.
My problem is for exmaple if i enter the smallest angle as 20, increment as 5, and total number as 4 it will display the correct calculations but the angles on the top will not line up. It will display angles 0,5,10,15 when its suppose to be showing 20,25,30,35. Anyone know how to fix this?
Also i need the user to be able to enter the minimum initial velocity, maximum initial velocity, and the number of equally spaced initial velocities. for example if the user enter smallest velocity 10, largest velocity 30, and total number 5 it should display the distances for initial velocities 10,15,20,25,30. Any ideas on that one? I will post my code below. Thanks again for any help you can provide!!
import java.util.*;
public class test
/** Main Method**/
     public static void main(String[] args)
          Scanner sc = new Scanner(System.in);
          int smallestAngle, increment, totalAngles,angleDegree = 0, velocity = 0;
          double answer = 0;
          System.out.print("Please enter the smallest angle: ");
          smallestAngle = sc.nextInt();
          System.out.print("Please enter the increment: ");
          increment = sc.nextInt();
          System.out.print("Please enter the total number of angles: ");
          totalAngles = sc.nextInt();
          for(int i = 0; i < totalAngles; i++)
               System.out.print("\t" + (angleDegree + (increment * i)));
          for(int i = 0; i < (totalAngles * 5); i++)
               if((i % totalAngles) == 0)
                    angleDegree = smallestAngle;
                    velocity += 20;
                    System.out.print("\n" + velocity);
               answer = Math.round((Math.pow(velocity, 2) * Math.cos(Math.toRadians(angleDegree)) * Math.sin(Math.toRadians(angleDegree))) / 32);
               System.out.print("\t" + answer);
               angleDegree += increment;
          System.out.println("\n\n");
}

Ok i re wrote my code another way hoping it would help solve things. My prob now is that it will only display the correct degree headings and not produce any form of calculation. I need to find a way for the user to enter the minimum initial velocity they want, the maximum initial velocity they want, and finally the number of equally spaced equally initial velocities. After this I need the program to produce the table with the calcuations. MY CODE SO FAR IS POSTED BELOW!! PLEASE PROVIDE SOME CODE OR INSIGHT TO FIX MY PROBLEM!! :-) THANKS!
import java.util.*;
public class testtwo
/** Main Method**/
public static void main(String[] args)
Scanner sc = new Scanner(System.in);
  int angleDegree = 0;
  int beginningangle = angleDegree;
  int totalangles = 0;
  int angleincrement = 0;
  int velocity = 0;
  int velocityincrement = 20;
  int numberofvelocities = 5;
  int maxvelocity = 0;
  double answer = 0;
  int answerint = 0;
  int tablesize = numberofvelocities * totalangles;
  System.out.print("Please enter the smallest angle: ");
  angleDegree = sc.nextInt();
  System.out.print("Please enter the increment: ");
  angleincrement = sc.nextInt();
  System.out.print("Please enter the total number of angles: ");
  totalangles = sc.nextInt();
  System.out.print("Please enter the minimum initial velocity: ");
  velocity = sc.nextInt();
  System.out.print("Please enter the maximum initial velocity: ");
  maxvelocity = sc.nextInt();
  System.out.print(" Please enter the number of spaced initial velocities: ");
  numberofvelocities = sc.nextInt();
  System.out.print("\t");
  for(int a = 0; a < totalangles; a++)
      System.out.print("\t" + angleDegree  );
      angleDegree += angleincrement;
  for(int i = 0; i < tablesize; i++)
   if((i % totalangles) == 0)
    angleDegree = beginningangle;
    velocity += velocityincrement;
    System.out.print("\n" + velocity + " ft/sec");
   answer = Math.round((Math.pow(velocity, 2) * Math.cos(Math.toRadians(angleDegree)) * Math.sin(Math.toRadians(angleDegree))) / 32);
   answerint = (int)answer;
   System.out.print("\t" + answerint);
   angleDegree += angleincrement;
  System.out.println("\n\n");
}  Message was edited by:
chrisb0486

Similar Messages

  • Could someone please help me with itunes update and backing up old ipod?

    Hello, was attempting to back up old ipod touch to laptop (in order to set up new ipod) but message read that cannot connect because it requires itunes version 10.6.3 or later. itunes will not update on laptop. Any ideas? your help would be much appreciated as I'm new to all of this and don't know how else to transfer old ipod content over to new one. Thanks

    iOS 6 requires iTunes 10.7 or later. Install the latest version of iTunes which is 11.
    Trouble installing iTunes or QuickTime for Windows

  • Please help me with export settings and format

    I'll try to explain my problem the best I can. I recently captured some footage from old VHS tapes to use in a Christmas video. I imported one of the MPGs that I captured to AE and applied a grain removal plus a couple other lighting effects to the video to improve the quality as well as I could. When I went to export it (through the render que) I found myself confronted with a huge amount of format options and after doing some reading online thought a Quicktime .MOV file with Photo JPEG compression would give me a reasonable size video but after doing the math (an a bit of the rendering) realized that my 2 hour video, that was originally only around 6GB was being converted into a .MOV file that was around 80GB, which is too large for my HDD. Now, I would love to go out and purchase a 1TB SSD right now but I can't currently afford it. I need to end up with a file as close to the original file size as possible but with the grain removed, and the highest quality (for the file size) and just need to know the best settings to use to accomplish that. I looked around for several hours and couldn't find a quick and easy answer like "just export a MPEG 2 file" with ..... settings. The file is going to be imported into Premiere for final edit with several others that are probably going to need the same adjustments. It will then be exported to a 1080p BluRay (with an HD photo slideshow). Also I am using Production Premium CS4, if that makes any difference.
    Any quick tips about the grain removal effect would be greatly appreciated as well. I'm currently using a removal amount of .8 with the effect running 6 passes. I also changed the texture setting under "fine tuning" to .4.  It's a little blury but MUCH better than grainy, and about as good as I can expect from a 25 year old VHS. If you've used this effect before and know a couple little tweaks I could apply to make the video a little sharper (without the grain) that would be amazing.
    Thanks in advance.

    The file size is defined by bitrate. The winners among production codecs regard to 'quality / render time / file size' ratio, DNxHD and ProRes, utilise almost identical bitrate: up to 440 Mbps while encoding with 4:4:4 colour subsampling and up to 220 Mbps while encoding to 4:2:2. Do some math, and you'll end up with 90-200 GB/hour.
    So, the only option to save on disk space is to utilise highly compressed codec like H.264. With target bitrate set to 100 Mbps (you can set the bitrate in the Export Settings dialog) the quality loss might look affordable (don't remember if you can encode to Level 5 on CS4 though).
    If you eventually choose H.264 (working with which on CS4 might in turn result in a nightmare), do not export to H.264 from AE directly. Export to H.264 via AME...

  • Please help me with this - IE and Reports

    Including an Oracle reporting Activex Control in a commonly Html file for Internet Explorer it works fine (generate the report) but it does'nt generate the events (BeforeRunReport,AfterRunReport).
    I mention that in other development tools (Visual C++,VB,Devloper6,...) It is OK.
    Example code :
    <OBJECT ID="XREP" CLASSID="CLSID:289D6F9F-2A7D-11CF-AD05-0020AF0BA9E2">
    <PARAM NAME="ReportName" VALUE="d:\temp\test.rep">
    <PARAM NAME="OutputDestination" VALUE="2">
    <PARAM NAME="OutputName" VALUE="d:\temp\test1.htm">
    <PARAM NAME="DatabaseUser" VALUE="adi/adi@adi">
    <PARAM NAME="OutputDriver" VALUE="HTMLCSSIE">
    </OBJECT>
    <SCRIPT LANGUAGE="VBScript">
    <!--
    Sub XREP_BeforeRunReport(x)
    document.write("Before")
    End Sub
    Sub XREP_AfterRunReport(x, y)
    document.write("After")
    End Sub
    DIM XXX
    XXX = XREP.RunReportSimple()
    -->
    </SCRIPT>
    Please tell me what it is wrong in this code because the events "BeforeRunReport","AfterRunReport" does not fire at all.I'm interested only for a solution using Oracle Reporting ActiveX Control and VBScript.

    ?

  • Please Help me with Oracle Reports (10G)

    Hi ,
    I have created a report in Oracle 10G and save it as .JSP file, while i tried to open
    that .jsp file through edit plus i observed that reportbuilder have generated a code for what i have done in Layout but all the code is commented, why was it happened so , Do it effect the functionality of my report.
    Please help me with this
    Thanks and Regards
    Kalyan Chitti

    Hello Chris90909,
    switch width an height properties as Inol mentioned.
    http://nycapex.blogspot.com/2010/03/landscape.html
    If you have any question about the issue, let us know.
    Don't forget to mark Correct or Helpful accordingly.

  • I bought a movie the movie Godzilla 2014 recently but it didn't show up in my library. I went check the itunes store and it wants me to buy it again. Please help me with this problem.

    I just bought this movie "Godzilla 2014" but it won't show in my Movie Library. I closed my Itunes and put it back on again but still won't show up. I checked my purchased list and it shows that I recently bought the movie but when I checked the itunes store it wants to buy the movie again. Please help me with this right away Apple.

    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Contacting Apple for support and service - this includes
    international calling numbers..
    For Mac App Store: Apple - Support - Mac App Store.
    For iTunes: Apple - Support - iTunes.

  • HELP!!!! My Hotmail no longer works with Safari v. 5.0.6 and my Imac Leopard operating system 10.5.8.  Please help me with any suggestions on what to do.  Thank you.

    HELP!!!! My Hotmail no longer works with Safari v. 5.0.6 and my Imac Leopard operating system 10.5.8.  Please help me with any suggestions on what to do.  Thank you.  I cannot find any new downloads for Safari that work with Leopard.  The newest ones only work with Lion.  My Firefox browser still works though but I would rather use Safari and cannot access any e-mails or send any e-mails via Safari.  This happened about 3 weeks ago and I thought it was just a glitch on Hotmail's site.  Now I realize Hotmail must have released an update that no longer works with Leopard 10.5.8.  PLEASE HELP ME!!!!  Thanks to anyone and everyone who reads this and attempts to help me.  I do not know what to do....

    Hi Sue,
    What exactly happens when trying Safari?
    They did change it to Outlook recently, but while not pretty, I can access mine with Safari 4.0 still...
    You can also set it up in Mail so you don't need a browser at all if you want.

  • Please help , I have iPhone 4S and have updated to iso6, don't know if that has anything to do with the problem but I can't set the year on date and time to the correct year, it automatically goes to 2578 ? Plz help

    Subject:
    Please help , I have iPhone 4S and have updated to iso6, don't know if that has anything to do with the problem but I can't set the year on date and time to the correct year, it automatically goes to 2578 ? Plz help

    Settings>General>International.
    Set the calendar to "Gregorian". You have it set to Buddhist.

  • Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    See these previous discussions help.
    App Store Updates (but only Updates)...: Apple Support Communities
    Apps suddenly don't update: Apple Support Communities

  • I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    I just bought a new iPhone and accidentally backed it up with my old iPhone backup, I do not want this. I lost everything on my new phone and I need it back. PLEASE HELP! This includes pictures and texts, etc.

    So just to be clear, when you say "just bought" how long ago was that? Is it on this new iPhone that you had pictures, texts, etc that you want? Were you backing up to iCloud or onto iTunes?
    This may not help for everything but if you go to iCloud.com and log in, are you able to find your pictures there?

  • I recently upgraded to IOS 10.9.5 and now I can't export anything from final cut Pro X. Could somebody please help me with this?

    I recently upgraded to IOS 10.9.5 and now I can't export anything from final cut Pro X. Could somebody please help me with this?

    SSign in to the App Store using the Apple ID that was used to purchase the software.

  • HT1338 Could you please help me with the problem. I have mac os 10.7.4 on my macbook pro retina and want to update it to 10.7.5. I had been waiting for 2 hours to do it, but then it appeared that it was impossible. What should I do?

    Could you please help me with the problem. I have macbook with retina with mac os 10.7.4 ann want to update it to mac os 10.7.5. I had been waiting for 2 hours to do it and had tried 3 times but it appeared that it was impossible. What should I do?

    You can download the standalone updates:
    OS X Lion Update 10.7.5 (Client Combo)
    OS X Lion 10.7.5 Supplemental Update

  • HT201318 I tried to downgrade my iCloud and when i did it never refunded me can you please help me with this thank you James

    I tried to downgrade my iCloud and when i did it never refunded me can you please help me with this thank you James
    <Personal Information Edited by Host>

    How did you try to downgrade
    (Don't post your telephone number in public places, unless you need more useless phone calls) I will ask for it to be removed.

  • I brought a iTunes card and the the code on the back is not there it has faded away can u please help me with this problem

    i brought a iTunes card and the the code on the back is not there it has faded away can u please help me with this problem

    Hi Daniel ...
    Try here > iTunes Store: Invalid, inactive, or illegible codes

  • I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    I have unlocked my iphone and when tried to upgrade it, i got an error, so i restored it.But i was not able to activate my iphone 3gs now...it is showing a message like ' sim card not found'..please help me with this regard

    Try popping out the SIM card and turn off the phone.
    Pop in the SIM card once again and turn on the phone, make sure that the SIM card is placed and seated perfectly in the tray!
    Tell me how did you unlock your phone!?

Maybe you are looking for

  • How do I turn off the feature in iTunes that automatically starts up iTunes when I press the mic button on my headphones?

    Okay, so I guess the mic button in my headphones is broken and so it acts like I have pressed it even though I have not. So everytime I have my head phones plugged in itunes shows up and everytime I try close out or pause iTunes, it just starts right

  • I need to flip, move and duplicate a group in InDesign CS4 JS

    Hi, I need fo flip, move and duplicate grouped objects in InDesign. So far I have those lines from OMV: var myGroup2 = myGroup.duplicate ([".0625 in", myPageHeight/2]); myGroup.flip (Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR); or myGroup.flipItem (F

  • I phone 5 problem with SIM

    i bought a iphone 5 should have been unlocked to accept any sim in any country. the Cyprus sim i put in allowed me to open it after inserting my pass key and it shows a signal. then it comes up with this message and wont let me go any further..  "onl

  • 10.2.0.4 patch on single instance standby database

    Hi All, We have production database 10.2.0.3 running with RAC having 2 nodes on Solaris 10. We have patched this databases to 10.2.0.4 (both nodes) on production without any issue. We have a physical standby database (10.2.0.3) with 2 nodes on solari

  • I get and error message when I sign in

    When I open Adobe I sign in but I get a error maessage which reads " Am error occurred when signing in " this appears in a yellow box but my name appears in the top left corner as signed in.