Question: Java Programming Intro Class Project Input: 6 and 3 Output: Enter the maximum numerator: 6 Enter the maximum denominator: 3 The maximum numerator is 6

Java Programming Intro Class Project Input: 6 and 3 Output: Enter the maximum numerator: 6 Enter the maximum denominator: 3 The maximum numerator is 6 and the maximum denominator is 3. Remainders n n%1 n%2 n%3 1 0 1 1 2 0 0 2 3 0 1 0 4 0 0 1 5 0 1 2 6 0 0 0

Here is my code:

import java.util.Scanner;

public class Tables {

public static void main (String args []) {

Scanner console = new Scanner (System.in);

System.out.println("Project 1 written by ANON");

// maximumExponent();

maximumRemainders();

}

static void maximumRemainders() {

Scanner console = new Scanner (System.in);

System.out.println("Enter the maximum numerator: ");

int maximumNumerator = console.nextInt();

System.out.println("Enter the maximum denominator: ");

int maximumDenominator = console.nextInt();

System.out.println("The maximum numerator is " + maximumNumerator + " and the maximum denominator is " + maximumDenominator);

// n%d

int n = maximumNumerator;

int d = maximumDenominator;

System.out.println("");

System.out.println("Remainders");

System.out.println("");

System.out.print("n");

int remainder = n % d;

for ( d = 1; d <= maximumDenominator; d++) {

System.out.print( "\t" + "n%" + d);

}

System.out.println("");

for ( n = 1; n <= maximumNumerator; n++) {

System.out.println(n);

for ( d = 1; d <= maximumDenominator; d++) {

remainder = n%d;

System.out.print(n%d);

}

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!