Init
This commit is contained in:
14
Lab3_1_CalebFontenot/pom.xml
Normal file
14
Lab3_1_CalebFontenot/pom.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.calebfontenot.lab3_1_calebfontenot</groupId>
|
||||
<artifactId>Lab3_1_CalebFontenot</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>18</maven.compiler.source>
|
||||
<maven.compiler.target>18</maven.compiler.target>
|
||||
<exec.mainClass>com.calebfontenot.lab3_1_calebfontenot.Lab3_1_CalebFontenot</exec.mainClass>
|
||||
</properties>
|
||||
</project>
|
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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.lab3_1_calebfontenot;
|
||||
import java.util.Scanner;
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Lab3 {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// Create a scanner object
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
// Prompt for hight in feet
|
||||
System.out.print("Enter the height (feet): ");
|
||||
double height;
|
||||
height = input.nextDouble();
|
||||
|
||||
// Prompt for width in feet
|
||||
System.out.print("Enter the width (feet):");
|
||||
double width;
|
||||
width = input.nextDouble();
|
||||
|
||||
// Calculate the area
|
||||
double area;
|
||||
area = height * width;
|
||||
// Print area calculated
|
||||
System.out.println("Calculated area is "+area);
|
||||
//create constants
|
||||
final double GALLONS_PER_SQUARE_FEET = 150.0;
|
||||
|
||||
// calculate the gallons
|
||||
double gallons;
|
||||
gallons = area/GALLONS_PER_SQUARE_FEET;
|
||||
//calculate the number of gallons needed to paint the wall
|
||||
System.out.println("The amount of paint is " + gallons +" gallons.");
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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.lab3_1_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class MilesToKilometers {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
double miles;
|
||||
double km;
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
|
||||
//> 1. Prompt the user to enter the number of miles
|
||||
System.out.println("Please enter miles to convert into kilometers");
|
||||
//> 2. Read the miles and store it into a variable
|
||||
miles = scanner.nextDouble();
|
||||
//> 3. Calculate the KM from the entered miles
|
||||
km = miles * 1.67;
|
||||
//> 4. Display the result
|
||||
System.out.println("You entered "+miles+" miles which is "+km+" kilometers");
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package com.calebfontenot.lab3_1_calebfontenot;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class RunwayLength {
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
//Define data objects
|
||||
double length;
|
||||
double acceleration;
|
||||
double velocity;
|
||||
|
||||
//Create scanner
|
||||
Scanner input = new Scanner(System.in);
|
||||
|
||||
//Prompt for input
|
||||
System.out.print("Enter velocity: ");
|
||||
velocity = input.nextDouble();
|
||||
System.out.print("Enter acceleration: ");
|
||||
acceleration = input.nextDouble();
|
||||
|
||||
//Calculate
|
||||
length = Math.pow(velocity, 2) / (2 * acceleration);
|
||||
|
||||
//Print calculation
|
||||
System.out.println("The minimum runway length for this airplane is "+length);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
com/calebfontenot/lab3_1_calebfontenot/MilesToKilometers.class
|
||||
com/calebfontenot/lab3_1_calebfontenot/Lab3_1_CalebFontenot.class
|
@@ -0,0 +1,2 @@
|
||||
/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/Lab3_1_CalebFontenot.java
|
||||
/home/caleb/NetBeansProjects/ADSV Java/Lab3_1_CalebFontenot/src/main/java/com/calebfontenot/lab3_1_calebfontenot/MilesToKilometers.java
|
Reference in New Issue
Block a user