How could I compute the equation in java? Please view the image.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter4: Analyzing And Charting Financial Data
Section: Chapter Questions
Problem 1.7CP
icon
Related questions
Question

How could I compute the equation in java? Please view the image.

Mmiles
kg CO2
Total kg of CO2 emitted
miles
N
gallon
x 8.887
(Equation 1)
gallon
Transcribed Image Text:Mmiles kg CO2 Total kg of CO2 emitted miles N gallon x 8.887 (Equation 1) gallon
Expert Solution
Step 1: simplification for java

Computer Science homework question answer, step 1, image 1

above is the given equation that needs to be solved in java.

 

let's simplify it and see how can it be used in java:

total_co2 = ((m*miles)/(n*(miles/gallon)))*(8.887*((kg*co2)/gallon))

 

if miles and kg are just units in the equation, it can be further simplified as

total_co2 = (m/n)*8.887*(co2/gallon)

if they are not just units and have their own value then this equation will be used:

 

total_co2 = ((m*miles)/(n*(miles/gallon)))*(8.887*((kg*co2)/gallon))

 

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Systems Analysis and Design (Shelly Cashman Serie…
Systems Analysis and Design (Shelly Cashman Serie…
Computer Science
ISBN:
9781305494602
Author:
Scott Tilley, Harry J. Rosenblatt
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole