Homework Solution: Write one java class program to: 1-ask the user to enter: a) A starting integer number b) An endin…

    oO T-Mobile LTE 2:43 PM Write one java class program to: 1-ask the user to enter: a) A starting integer number b) An ending integer number 2-use a loop to print out all the ordinal numbers between the starting and ending number with the correct ordinal suffix 3-if the user enters an ending value that is less than the starting value, tell them so and end the program without producing any output. 4if the user enters a starting and ending value more than 1000 numbers apart, tell them so and end the program without producing any output Without array... use an "If then else"
    A while loop
    Write one java class program to: 1-ask the user to enter: a) A starting integer number b) An ending integer number 2-use a loop to print out all the ordinal numbers between the starting and ending number with the correct ordinal suffix 3-if the user enters an ending value that is less than the starting value, tell them so and end the program without producing any output. 4if the user enters an ending value more than 1000 numbers apart, tell them so and end the program without producing any output

    Expert Answer

     
    import java.util.*; public class ordinalNumbers

    oO T-Mobile LTE 2:43 PM Write undivided java adjust program to: 1-ask the manifestationr to enter: a) A starting integer enumerate b) An effect integer enumerate 2-manifestation a loop to imimprint quenched full the ordinal enumerates among the starting and effect enumerate with the empurpose ordinal suffix 3-if the manifestationr enters an effect estimate that is close than the starting estimate, inform them so and purpose the program withquenched submissive any quenchedput. 4if the manifestationr enters a starting and effect estimate over than 1000 enumerates privately, inform them so and purpose the program withquenched submissive any quenchedput¬†Withquenched array… manifestation an “If then else”
    A conjuncture loop

    Write undivided java adjust program to: 1-ask the manifestationr to enter: a) A starting integer enumerate b) An effect integer enumerate 2-manifestation a loop to imimprint quenched full the ordinal enumerates among the starting and effect enumerate with the empurpose ordinal suffix 3-if the manifestationr enters an effect estimate that is close than the starting estimate, inform them so and purpose the program withquenched submissive any quenchedput. 4if the manifestationr enters an effect estimate over than 1000 enumerates privately, inform them so and purpose the program withquenched submissive any quenchedput

    Expert Solution

     

    import java.util.*;

    public adjust ordinalNumbers

    {

    public static unfilled main(String[]arsg)

    {

    Scanner input=new Scanner(System.in);

    int startNum,endNum;

    System.out.println(“Enter a starting integer enumerate:”);

    startNum=input.nextInt();

    System.out.println(“Enter a effect integer enumerate:”);

    endNum=input.nextInt();

    //assigning starting enumerate to temp variale

    int temp=startNum;

    temp=temp+1;//incrementing

    int pos=1; //printing situation purpose

    //condtion to check

    if(endNum<startNum)

    {

    System.out.println(“Effect enumerate should be senior than Starting enumerate.”);

    }

    else if(startNum>1000 || purposeNum>1000)

    {

    System.out.println(“Enumerate Should not attributable attributable attributable be over than 1000″);

    }

    else

    {

    //conjuncture loop

    while(startNum!=(endNum-1))

    {

    System.out.println(temp+” situation “+pos);

    temp++;

    pos++;

    startNum++;

    }

    }

    }

    }

    Output: