Scanner class needs to be imported at the very beginning of your program before your class declaration for all three mini-programs with:

import java.util.Scanner;

Part 1. Program #1: Numbers

Write a complete program that prompts the user for two integers and then calculates and prints the following report to the screen, exactly as shown.

For example, using 23 and 18 as the user input:

Your numbers are: 23 and 7.

Sum: 30
Subtraction: 16
Multiplication: 161
Division: 3
Remainder of Division: 2

Use the Scanner method nextInt() to read the user's numbers. Include in the declaration area:

// instantiate a new scanner and assign it to variable 'keyboard'
Scanner keyboard = new Scanner(System.in);

// initialize both operands to 0;
int firstNumber = 0;
int secondNumber = 0;
...
// Prompt the user to get the first operand then read in an integer
System.out.print("Enter the first number: ");
firstNumber = keyboard.nextInt();
...

Part 2. Program #2: Initials

Write a complete progrma that prompts users to enter their first name, middle name, and last name (separately). Print out their name and initials, exactly as shown:

Your name is: John Paul Chavez.
Your initials are: J.P.C

Use the Scanner method nextLine() to read the user's names:

Scanner keyboard = new Scanner(System.in)
// Prompt user here
String firstName = keyboard.nextLine();

Use the String method charAt() to extract the first (zero-th) character from each name part (the name parts are String type):

char firstInitial = firstName.charAt(0)

Part 3. Program #3: PACE (Physical Activity Calorie Equivalent) and Calories

Write a complete program that prompts the user to enter a food item and the number of calories it contains. The program computes and outputs how many minutes the user would need to walk to burn off those calories.

Formula (truncate the result): walking time in minutes = (int)(calories / 5.4).

Use the Scanner methods nextLine() and nextInt() to read the input values:

Scanner keyboard = new Scanner(System.in);

Sample output:

// Prompt user here
Food: York Peppermint Pattie // Food
Calories: 150 // Calories

Minutes to walk: 27 // Calculated
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.