Identifying Largest Integer Beginner Project

/*

  • Name: Carter Hendrick
  • Course Name: IT_205_Object Oriented Programming w/ Java
  • Date: 09/24/2025
  • Pledge: This program is entirely written by me (Carter Hendrick) without help from anyone
    / package it205_mod1assignmentpt1; import java.util.;
    /**
    *
  • @author hendr
    */
    public class IT205_Mod1AssignmentPt1 { /**
    • @param args the command line arguments
      */
      public static void main(String[] args) {
      // TODO code application logic here
      Scanner input = new Scanner(System.in); //create scanner
    int num1; //Variables for each integer
    int num2;
    int num3;
    int num4;
    int num5; System.out.println(“Please enter five integers: “); //prompt for integers
    num1 = input.nextInt(); //Store value for first integer
    num2 = input.nextInt(); //Store value for Second integer
    num3 = input.nextInt(); //Store value for third integer
    num4 = input.nextInt(); //Store value for fourth integer
    num5 = input.nextInt(); //Store value for fifth integer int Large = num1; //initializing the small and large variables
    int Small = num1; if (Small > num2 ) //if statement for identifying the smallest integer
    {
    Small = num2;
    }
    if (Small > num3) {
    Small = num3;
    }
    if (Small > num4) {
    Small = num4;
    }
    if (Small > num5) {
    Small = num5;
    } if (Large < num2 ) //if statement for identifying the Largest integer
    {
    Large = num2;
    }
    if (Large < num3) {
    Large = num3;
    }
    if (Large < num4) {
    Large = num4;
    }
    if (Large < num5) {
    Large = num5;
    }
    System.out.printf(“%s%s%s%s%s%s%s%s%s%n%s%n%s%n”,
    “The set of numbers was: ” + num1,” “,num2,” “,num3,” “,num4,” “,num5,
    “The lowest number of the set is: ” + Small,
    “The largest number of the set is: ” + Large);
    }
    }

Leave a Reply

Your email address will not be published.