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

$18.00

or $1 if you
register a new account!

Assisting Tutor

Related Homework Solutions

Java Programming Assignment
Homework Solution
$30.00
Java Programming
Variables
ToString Method
Equals Method
Overload
Computer Science
Generic Method For Java Arrays
Homework Solution
$20.00
Java
Programming
Coding
Computer Science
Arrays
Items
Generic Method
Integers
WordList
Strings
Testing
Primitive Types
Input
Output
Wordlist Generator in Java (Using OOP)
Homework Solution
$125.00
Java
Programming
OOP
Wordlist Generator
Inheritance
Polymorphism
Arrays
String Class Methods
Charlist
Input
Output
Statements
Variables
Loops
Conditions
Maze Problem in Java
Homework Solution
$50.00
Java
Programming
Codes
Algorithms
Maze Problem
Classes
Constructor
Stack
Positions
Points
Push
Pop
Symbols
Statements
Variables
Rows
Columns
Strings
Integers
Commands
Pseudo-Code
Odd Numbers Problem in Java
Homework Solution
$10.00
Java
Programming
Computer Science
Mathematics
Integers
Odd Values
Even Values
Output
Input
Range
Loops
Conditions
Statements
Samples
Get help from a qualified tutor
Live Chats