ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 Jun 2017 My Price 8.00

Factoring.java

I need this to be written in very simple code. The code needs to be something a first semester student would know and you can't use any short cuts. The instructions are below and please try to incorporate this:

The variable declaration and assignment, System.out.print/println, if-else, for-loops, and method

 

 

Factoring.java: 

import java.util.*;
     
/**
 * Factor number
 */
public class Factoring {
  /**
   * Normal factoring
   * @param input long integer
   */
  public static void factor(long input) {
    long number, divisor;
    System.out.print(input + " =");
    /*
     * Fill this area
     */
    System.out.println();
  }
  public static void factor2(long input) {
  }
  public static void main(String[] args) {
    long input;
    Scanner scan = new Scanner(System.in);
    while ((input = Tools.getLong(scan, "Enter number: ")) > 0) {
      factor(input);
      factor2(input);
    }
  }
}

Tools.java: 

import java.util.*;

public class Tools {
  public static String getNextLine(Scanner keyboard, String prompt) {
    System.out.print(prompt);
    return keyboard.nextLine();
  }
  public static String getString(Scanner keyboard, String prompt) {
    System.out.print(prompt);
    return keyboard.next();
  }
  public static int getInt(Scanner keyboard, String prompt) {
    System.out.print(prompt);
    return keyboard.nextInt();
  }
  public static double getDouble(Scanner keyboard, String prompt) {
    System.out.print(prompt);
    return keyboard.nextDouble();
  }
}

Answers

(11)
Status NEW Posted 06 Jun 2017 07:06 AM My Price 8.00

-----------

Not Rated(0)