Gender Studies homework help

(1) Question:For this java coding challenge, you will ask the user for the name of an output file to save the data.You will expand the java program that asks for a start number and stop number, and tells you if the numbers in the inclusive range are prime, perfect, imperfect deficient, or imperfect abundant. You will next add a check for Perfect Squares. A perfect square is the square of an integer (e.g., 1,4,9,16, 25, etc.)Note 1: For this project, the number 1 will be considered a prime number, but it is not a perfect number (since its only factor is just 1, which by definition is an improper factor, thus disqualifying it from being perfect)Note 2: All Prime Numbers and Perfect Squares are also Imperfect Deficient. But a positive check for “Prime” or “Perfect Square” supersedes a check for “Imperfect Deficient”Note 3: You do not need to add any error testing code on the numbers; the code will be tested with strictly positive integers. You must add error checking for the creation of the external file (per Java’s insistence)Below is my Java code:import java.io.*;import java.util.Scanner;public class CodingChallenge4CRM {  public static void main(String[] args){    Scanner sc = new Scanner(System.in);    System.out.println(“Welcome to the Prime, Perfect Square, and Perfect Number Tester “);    System.out.println(“Please enter the name of the output file to save your data:”);    String name = sc.nextLine();    PrintWriter pw = null;    try {      FileOutputStream fout = new FileOutputStream(name);      pw = new PrintWriter(fout);    }    catch (Exception e){      e.printStackTrace();    }    System.out.print(“Enter a start number:”);    int a = Integer.parseInt(sc.nextLine());    System.out.print(“Enter a stop number:”);    int b = Integer.parseInt(sc.nextLine());    for (int i = a; i i){        System.out.println(“The number ” + i+ ” is: Imperfect Abundant”);        pw.println(“The number ” + i+ ” is: Imperfect Abundant”);      }      else{        System.out.println(“The number ” + i+ ” is: Imperfect Defficient”);        pw.println(“The number ” + i+ ” is: Imperfect Defficient”);      }    }     }}The output needs to look like the following: Welcome to the Prime, Perfect Square, and Perfect Number TesterEnter the name of the output file: MyNumData.txtEnter a start number: 20Enter a stop number : 30The number 20 is: Imperfect AbundantThe number 21 is: Imperfect DeficientThe number 22 is: Imperfect DeficientThe number 23 is: PrimeThe number 24 is: Imperfect AbundantThe number 25 is: Perfect SquareThe number 26 is: Imperfect DeficientThe number 27 is: Imperfect DeficientThe number 28 is: PerfectThe number 29 is: PrimeThe number 30 is: Imperfect AbundantResults: my program stops one less–stops at 29 and it incorrectly reports 28 as imperfect deficient when in fact it is perfect. I can’t figure out where I went wrong.(2) Plus, next I need to ask the user for a string to search in the file, and the program will print all lines that contain that string. The search will be case insensitive.This builds on the previous question above.The output format must look like the following:”Welcome to the Prime, Perfect Square, and Perfect Number TesterEnter the name of the output file: MyNumData.txtEnter a start number: 20Enter a stop number : 30The number 20 is: Imperfect AbundantThe number 21 is: Imperfect DeficientThe number 22 is: Imperfect DeficientThe number 23 is: PrimeThe number 24 is: Imperfect AbundantThe number 25 is: Perfect SquareThe number 26 is: Imperfect DeficientThe number 27 is: Imperfect DeficientThe number 28 is: PerfectThe number 29 is: PrimeThe number 30 is: Imperfect AbundantEnter the name of the input file to search: MyNumData.txtEnter the string to search: primThe following lines were found:The number 23 is: PrimeThe number 29 is: Prime”Any assistance will be greatly appreciated.

 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"

"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!":

Get started