Question: CS 1083 Project 1: Integer Operation Tables - Use local variables. - Use arithmetic expressions. - Use Scanner to input values. - Use constant variables

CS 1083 Project 1: Integer Operation Tables

- Use local variables.

- Use arithmetic expressions.

- Use Scanner to input values.

- Use constant variables or also known as final variables.

- Use for loops.

Hand-in Requirements

All projects and laboratories will be submitted electronically through Blackboard. Zip up your entire project directory to submit as the source. (Right click on the project folder and follow 7-Zip > Add to "lol456_prj1.zip" where lol456 should be yours.) The project folder should include at least the following two files:

- IntegerTables.java

- IntegerTablesOutput.txt

Tasks

Write a program that prints

Project 1 written by YOURNAME

and presents the tables of the operations listed below of an integer number (greater than 0) that will be requested to the user:

 

1. Addition

2. Substraction

3. Multiplication

4. Division

5. Mod (Remainder)

If the execution of the program is as follows (user input is in bold and underlined, while YOURNAME should be your name):

Project 1 written by YOURNAME Please enter an integer number (1-99):  5  1. Addition table 5 + 0 = 5 5 + 1 = 6 5 + 2 = 7 5 + 3 = 8 5 + 4 = 9 5 + 5 = 10 5 + 6 = 11 5 + 7 = 12 5 + 8 = 13 5 + 9 = 14 2. Substraction table 5 - 1 = 4 5 - 2 = 3 5 - 3 = 2 5 - 4 = 1 5 - 5 = 0 5 - 6 = -1 5 - 7 = -2 5 - 8 = -3 5 - 9 = -4 5 - 10 = -5 3. Multiplication table 5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 5 * 4 = 20 5 * 5 = 25 5 * 6 = 30 5 * 7 = 35 5 * 8 = 40 5 * 9 = 45 5 * 10 = 50 4. Division table 5 / 1 = 5 5 / 2 = 2 5 / 3 = 1 5 / 4 = 1 5 / 5 = 1 5 / 6 = 0 5 / 7 = 0 5 / 8 = 0 5 / 9 = 0 5 / 10 = 0 5. Remainder table 5 % 1 = 0 5 % 2 = 1 5 % 3 = 2 5 % 4 = 1 5 % 5 = 0 5 % 6 = 5 5 % 7 = 5 5 % 8 = 5 5 % 9 = 5 5 % 10 = 5 > 

It will be assumed that the number that the user will input will be between 1 and 99 as it is shown above. In order to show each table in columns use the special character for tab "\t" after each of the numbers of the operands in every line.

Details

The Console

You will need to use Scanner to obtain input from the keyboard. You should declare a class constant of type Scanner named CONSOLE at the beginning of your class; you should store new Scanner(System.in) in CONSOLE. See examples in the Chapter 2 lecture notes and in the Laboratory 2 assignment.

Rubric

[1 Point] If your program asks for the integer number.

[15 Points] If your program performs correctly the calculations and displays the corresponding tables.

[3 Points] For correctly calculate and display the addition table.

[3 Points] For correctly calculate and display the substraction table.

[3 Points] For correctly calculate and display the multiplication table.

[3 Points] For correctly calculate and display the division table.

[3 Points] For correctly calculate and display the residual operation.

[4 points]

If the main method of your program prints "Project 1 written by [...]" and calls the two other methods.

If your Java program was in a file named IntegerTable.java.

If the output of your Java program was in a file named IntegerTableOutput.txt containing the execution of the program using 5 as the user input.

If your program is indented properly.

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!