Recent content by dcs1953
-
D
MHB Using constants in expressions.
import java.util.Scanner; public class ShippingCalculator { public static void main (String [] args) { int shipWeightPounds = 10; int shipCostCents = 0; final int FLAT_FEE_CENTS = 75; shipWeightPound = shipCostCost / shipWeightPound; final int CENTS_PER_POUND...- dcs1953
- Thread
- Constants Expressions
- Replies: 11
- Forum: Programming and Computer Science
-
D
MHB Gravity Calculation: Calculate Accel Gravity
public class GravityCalculation { public static void main (String [] args) { double G = 6.673e-11; double M = 5.98e24; double accelGravity = 0.0; double distCenter = 0.0; distCenter = 6.38e6; /* Your solution goes here */...- dcs1953
- Thread
- Calculation Gravity
- Replies: 1
- Forum: Programming and Computer Science
-
D
MHB Calculate Sphere Volume Using (4.0/3.0) Division
Given sphereRadius and piVal, compute the volume of a sphere and assign to sphereVolume. Use (4.0 / 3.0) to perform floating-point division, instead of (4 / 3) which performs integer division. public class SphereVolumeCalculator { public static void main (String [] args) { double piVal...- dcs1953
- Thread
- Division Sphere Volume
- Replies: 1
- Forum: Programming and Computer Science