Question: it is a problem for Java Pt. 1: Write a Java program that takes any quantity of a number between 0 and 99 and creates

it is a problem for Javait is a problem for Java Pt. 1: Write a Java programthat takes any quantity of a number between 0 and 99 and

Pt. 1: Write a Java program that takes any quantity of a number between 0 and 99 and creates a String of numbers from 0 to n(inclusive). Example: n 5 should generate this String "012345" Note: This program should check that n = 0 Pt. 2: Next, utilizing the information within the String just created in Pt.1 012345"), generate separate strings for each of the following specifications Odd numbers: Should generate a new String containing ONLY odd numbers>"135 Even numbers: Should generate a new String containing ONLY even numbers->"024 Note: You will be handling two different types of numbers: 1 digit (EX: 1 2345678 9) numbers and 2 digit (EX: 10 11 12 13 14...99 numbers. OddAndEven.java Load default template... 3 public class OddAndEvent 4 5 PART 1: Create a nonstatic method that takes in an int number quantity (n) and returns a returns a String of numbers from 0 to n (inclusive) as the example above demonstrates. Call this quantityToString In this method you should check that n is between 0(inclusive) and 100(inclusive) If n is outside these boundaries return and empty String ("" 10 12 13 ****Student Code Here*1 16 * PART 2: Next, you wil1 implement oddAndEvenNumbers method that generates two string's (odd and even) and 17 18 19 20 21 then prints the results at the end. -A String which holds Odd Numbers -A String which holds Even Numbers Use if statements to check whether numInfo is less than 10 or greater than 10 because single digit numbers and double digit numbers need to be checked for differently 24 25 26 27 28 single digit numbers: can be checked at am index since single digit numbers are only 1 digit long double digit numbers: have to be checked as a double digit numbers, therefore, when fetching a double digit number at an inde Use two loops, one loop will be for single digit numbers (0 -9) and the other will be for double digit numbers. (10 99) 30 31 32 public void oddAndEvenNumbers (int num) t//Start of method 34 35 36 37 38 39 40 //Variables String numInfo"";//reassign to the String that quantityToString returns string odd ""; String even"; 1Student Code Here**// 42 43 //Prints the results *Do not need to change this part System.out.println("Odd Numbers odd) System.out.println("Even Numbers"even); 45 46 //End of method 48 public static void main(Stringl] args) 49 50 51 /Testing Uncommented when done// 52 53 /* 54 OddAndEven obj- new OddAndEvenO; 55 System.out.println("Testing n-5"; 56 obj.oddAndEvenNumbers(5) 57 System.out.println("Testing n-10"; 58 obj.oddAndEvenNumbers (10) 59 System.out.println("Testing n-15"); 60 obj.oddAndEvenNumbers (15); 61 System.out.println("Testing n=99"); 62 obj.oddAndEvenNumbers (99); 63 64

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!