Creating classes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • setfree4eva
    New Member
    • Nov 2007
    • 1

    Creating classes

    The program should help u work out basic Math tasks, factorials, powers and primes. The option should be placed in a menu



    When the program starts it should read:



    Welcome to the Math Calculator

    Pick the problem you want help with



    a) Factorial

    b) Powers

    c) Prime number

    d) Quit



    Enter your choice:



    If the user selects (a), you prompt the use for a number and then calculate factorial.

    (N.B Factorial is calculated by multiplying every number between 1 and X. So if 4 is entered factorial of 4 is 1*2*3*4



    If the user selects (b), you prompt the use for two numbers and then calculate the power.



    Etc



    N.B Program should take either capital or common letter
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by setfree4eva
    The program should help u work out basic Math tasks, factorials, powers and primes. The option should be placed in a menu



    When the program starts it should read:



    Welcome to the Math Calculator

    Pick the problem you want help with



    a) Factorial

    b) Powers

    c) Prime number

    d) Quit



    Enter your choice:



    If the user selects (a), you prompt the use for a number and then calculate factorial.

    (N.B Factorial is calculated by multiplying every number between 1 and X. So if 4 is entered factorial of 4 is 1*2*3*4



    If the user selects (b), you prompt the use for two numbers and then calculate the power.



    Etc



    N.B Program should take either capital or common letter
    Don't be too lazy to do your homework.
    Read about the Scanner class, try the code and post back if you get problems with the code.

    Comment

    Working...