Computers and Technology

Java Eclipse homework. I need help coding this Project 5A - Mixed Results

package: proj5A
class: MixedResults

Create a new project called MixedResults with a class called Tester. Within the main method of Tester you will eventually printout the result of the following problems. However, you should first calculate by hand what you expect the answers to be. For example, in the parenthesis of the first problem, you should realize that strictly integer arithmetic is taking place that results in a value of 0 for the parenthesis.

double d1 = 37.9; //Initialize these variables at the top of your program
double d2 = 1004.128;
int i1 = 12;
int i2 = 18;

Problem 1: 57.2 * (i1 / i2) +1
Problem 2: 57.2 * ( (double)i1 / i2 ) + 1
Problem 3: 15 – i1 * ( d1 * 3) + 4
Problem 4: 15 – i1 * (int)( d1 * 3) + 4
Problem 5: 15 – i1 * ( (int)d1 * 3) + 4

Your printout should look like the following:

Problem 1: 1.0
Problem 2: 39.13333333333333
Problem 3: -1345.39999999999
Problem 4: -1337
Problem 5: -1313

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, robert7248
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, Janznznz1121
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
image
Computers and Technology, 23.06.2019 18:30, sawyerfauver
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
image
Computers and Technology, 24.06.2019 00:40, dheydar3506
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
Do you know the correct answer?
Java Eclipse homework. I need help coding this Project 5A - Mixed Results

package: proj...

Questions in other subjects: