Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Write a java program that reads an integer n from the key board and compute the value (https://www.askmehelpdesk.com/showthread.php?t=629584)

  • Jan 22, 2012, 03:08 PM
    other5
    Write a java program that reads an integer n from the key board and compute the value
    Write a java program that reads an integer n from the key board and compute the value of 2^n and output it to the screen
  • Jan 22, 2012, 03:12 PM
    ScottGem
    Thank you for asking our help with your homework assignment. However, there are some rules we have for doing so.
    Do not simply retype or paste a question from your book or study material

    We won't do your homework questions for you. You were given the assignment for you to learn.

    If you come up with your own answer or process and post it for us to critique that is acceptable. If you have some SPECIFIC questions that you couldn't find or didn't understand, we may help with that.
    But this is your assignment, so show us you have at least attempted to complete it on your own.

    Thank you.
  • Jan 22, 2012, 03:20 PM
    other5
    public class interger
    public static void main ( string [] args{
    int value n=1
    System.outprintin(" enter the value of the integer")

    then I can't seem to finish it :(
  • Jan 22, 2012, 03:23 PM
    ScottGem
    I don't know Java, but you need to provide a way to input the value and assign it to a variable. From there it should be simple to compute the value of 2^n and output it.

  • All times are GMT -7. The time now is 11:38 PM.