Note that there are some explanatory texts on larger screens.

plurals
  1. POhomework and overloading in java
    primarykey
    data
    text
    <p>Ok so this is my homework assignment, and I am having a heck of a time figuring out how to correctly use overloading to allow for a certain number of terms to print out.</p> <p>"Create a class that contains a method that accepts an integer from the user to display the next 5 terms in the following pattern: (n-7) * 3.</p> <p>So, if the user enters 5, the output should be:</p> <p>-6</p> <p>-39</p> <p>-138</p> <p>-435</p> <p>-1326</p> <p>Add an overloaded method so the user can enter how many termss they want to print out in a pattern:</p> <p>So, the user would enter 5 as the starting number and 3 as the number of terms to print out in the pattern.</p> <p>The output would be:</p> <p>-6</p> <p>-39</p> <p>-435</p> <p>Add different method that displays the formula and provides calculation to the formula: (should get starting number from user input) and prints out the next 5 terms.</p> <p>(5-7) * 3 = -6</p> <p>(-6-7) * 3= -39</p> <p>(-39-7) * 3 = -435</p> <p>Add an overloaded method that displays the formula and the calculation to the formula and takes in how many times it should print: (should get from user input). </p> <p>For example: User enters 5 as the starting number and print out 4 times.</p> <p>(5-7) * 3 = -6</p> <p>(-6-7) * 3= -39</p> <p>(-39-7) * 3 = -435</p> <p>(-435-7) * 3 = -1326</p> <p>Specifics:</p> <p>You have a separate class that contains all your methods. You should have 4 methods in this class. Your main should call these four methods getting user input where appropriate. "</p> <p>I'm not asking for anyone to do this for me, I just would appreciate a steer in the right direction. At the moment trying to collect the number of terms wanted by the user in the main class then pass it to the Numberpattern class and then from their have the program determine which Calc method to use is not working.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload