Subject Computer Science Java Programming

Question

Design, write, and test a Java program to do the following. Call your class Project1 and save it in the file “Project1.java”.
1. Print your name and Project 1, each on their own line.
2. Print a blank line.
3. Prompt the user to enter 2 integer values. Read the integers and then print the
sum, difference, product and result of division including the remainder. The difference should be calculated as the first value minus the second value input and the division should be calculated as the first value divided by the second value.
4. Print a blank line.
5. Prompt the user to enter 3 integers. Read the integers and then calculate and print
their average as an integer and as a double. Print the double results with 3 places
to the right of the decimal point.
6. Print a blank line.
7. Prompt the user to enter one 3 digit integer. Read the value and then print the
integer in reverse order. Do not use a String for this – use the arithmetic
operations.
8. Print a blank line.
9. Print “Program complete”
Sample Input and Output
Debra Calliss Project 1
Please enter 2 integers 67
6 + 7 = 13
6 – 7 = -1
6 * 7 = 42
6 / 7 = 0 rem 6
Please enter 3 integers
374
Integer average = 4
Floating point average = 4.667
Please enter a 3 digit integer 123
The number backwards is 321
Program complete
Processing requirements:
Use only the Java statements that have been covered in class to date. This means declaration, assignment, input and output. Do not use other statements (if-else, loops, etc). If in doubt, ask.
Use only the following types: int and double. Do not use Strings.
There is no error checking in this program. You can assume that the input is valid.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

ystem.out.println(integer1 + " + " + integer2 + " = " + (integer1 + integer2));
       System.out.println(integer1 + " - " + integer2 + " = " + (integer1 - integer2));
       System.out.println(integer1 + " * " + integer2 + " = " + (integer1 * integer2));
       System.out.println(integer1 + " / " + integer2 + " = " + (integer1 / integer2) + " rem " + (integer1 % integer2));
System.out.print("The number backwards is ");      
                  
       System.out.print(integer3 % 10);
       integer3 = integer3 / 10;      ...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

The Problem Solver in Java
Homework Solution
$30.00
Java
Programming
Codes
Algorithms
Lists
Tasks
Computer Science
Conversions
Celsius
Fahrenheit
Odd Numbers
Even Numbers
User Choices
Input
Output
Statements
Strings
Mathematical Equations
Variables
Java Program With Strings & Integers
Homework Solution
$20.00
Java
Programming
Coding
Strings
Integers
Computer Science
Symbols
Special Characters
Reading
Writing
Rows
Columns
Statements
Conditions
Loops
Arrays in Programming Language Java
Homework Solution
$20.00
Java
Programming
Computer Science
Arrays
Integers
Random Numbers
Methods
Functions
Even Elements
Odd Elements
Prime Numbers
Minimum Values
Maximum Values
Average Values
Loops
Conditions
Statements
Accounting Problems Using Java
Homework Solution
$45.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Interest Rates
Account Balance
Display Messages
Compounding Interest
Strings
Dates
Analysis
Get help from a qualified tutor
Live Chats