Work some more
This commit is contained in:
parent
b60f974955
commit
953bf14ea4
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.calebfontenot.mp1_calebfontenot;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author caleb
|
||||||
|
*/
|
||||||
|
public class CompoundValue {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// Create Scanner
|
||||||
|
Scanner input = new Scanner(System.in);
|
||||||
|
|
||||||
|
// Define vars
|
||||||
|
double SavingAmount;
|
||||||
|
|
||||||
|
|
||||||
|
// Prompt for input
|
||||||
|
|
||||||
|
// Compute
|
||||||
|
|
||||||
|
// Print result
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
@ -31,6 +32,9 @@ public class NumberOfYears {
|
|||||||
NumberOfDays = (NumberOfHours / 24);
|
NumberOfDays = (NumberOfHours / 24);
|
||||||
NumberOfYears = (NumberOfDays / 365);
|
NumberOfYears = (NumberOfDays / 365);
|
||||||
|
|
||||||
|
// Big brain math time
|
||||||
|
// Check if double "NumberOfYears" equals int "NumberOfYears"
|
||||||
|
//If it isn't, subtract 365 from "NumberOfDays" until the number is under 365
|
||||||
|
|
||||||
// Print output
|
// Print output
|
||||||
System.out.println((int) NumberOfMinutes+" minutes is approx. :");
|
System.out.println((int) NumberOfMinutes+" minutes is approx. :");
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.calebfontenot.mp1_calebfontenot;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author caleb
|
||||||
|
*/
|
||||||
|
public class WindChill {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner input = new Scanner(System.in);
|
||||||
|
//> Enter the new temperature in Fahrenheit
|
||||||
|
System.out.print("Enter the temperature in Fahrenheit between -58∞F and 41∞F: ");
|
||||||
|
double fahrenheit = input.nextDouble();
|
||||||
|
|
||||||
|
//> Enter the wind speed miles per hour
|
||||||
|
System.out.print("Enter the wind speed miles per hour "+
|
||||||
|
"(must be greater or equal to 2):");
|
||||||
|
double speed = input.nextDouble();
|
||||||
|
|
||||||
|
//> Compute wind and chill index
|
||||||
|
double windChillIndex = 35.74 + 0.6215 * fahrenheit - 35.75
|
||||||
|
* Math.pow(speed, 0.16) + 0.4275 * fahrenheit
|
||||||
|
* Math.pow(speed, 0.16);
|
||||||
|
|
||||||
|
//> Display the result
|
||||||
|
System.out.println("The wind chill index is "+ windChillIndex);
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user