38 lines
1.0 KiB
Java
Executable File
38 lines
1.0 KiB
Java
Executable File
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package programmingexam1_calebfontenot;
|
|
|
|
import java.util.Scanner;
|
|
|
|
|
|
/**
|
|
*
|
|
* @author ar114
|
|
*/
|
|
public class QuotientAndRemainder {
|
|
public static void main(String[] args) {
|
|
// Define variables
|
|
int number1, number2, quotient, remainder;
|
|
|
|
// Create scanner
|
|
Scanner input = new Scanner(System.in);
|
|
|
|
// Prompt for variables
|
|
System.out.print("Enter 2 variables and I will calculate the "
|
|
+ "quotient and the remainder: ");
|
|
number1 = input.nextInt();
|
|
number2 = input.nextInt();
|
|
|
|
// Compute!
|
|
quotient = number1 / number2;
|
|
remainder = number1 % number2;
|
|
|
|
// Print output:
|
|
System.out.println("The quotient is: " + quotient);
|
|
System.out.println("The remainder is: " + remainder);
|
|
}
|
|
}
|