woo boy, crazy day today
This commit is contained in:
14
Semester 2/Assignments/MP4_CalebFontenot/pom.xml
Normal file
14
Semester 2/Assignments/MP4_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</groupId>
|
||||
<artifactId>MP4_CalebFontenot</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<exec.mainClass>com.calebfontenot.mp4_calebfontenot.MP4_CalebFontenot</exec.mainClass>
|
||||
</properties>
|
||||
</project>
|
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
|
||||
package com.calebfontenot.mp4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public abstract class Bicycle {
|
||||
|
||||
private int cadence;
|
||||
private int gear;
|
||||
private int speed;
|
||||
|
||||
public Bicycle(int cadence, int gear, int speed)
|
||||
{
|
||||
this.cadence = cadence;
|
||||
this.gear = gear;
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of speed
|
||||
*
|
||||
* @return the value of speed
|
||||
*/
|
||||
public int getSpeed()
|
||||
{
|
||||
return speed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of speed
|
||||
*
|
||||
* @param speed new value of speed
|
||||
*/
|
||||
public void setSpeed(int speed)
|
||||
{
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of gear
|
||||
*
|
||||
* @return the value of gear
|
||||
*/
|
||||
public int getGear()
|
||||
{
|
||||
return gear;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of gear
|
||||
*
|
||||
* @param gear new value of gear
|
||||
*/
|
||||
public void setGear(int gear)
|
||||
{
|
||||
this.gear = gear;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of cadence
|
||||
*
|
||||
* @return the value of cadence
|
||||
*/
|
||||
public int getCadence()
|
||||
{
|
||||
return cadence;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of cadence
|
||||
*
|
||||
* @param cadence new value of cadence
|
||||
*/
|
||||
public void setCadence(int cadence)
|
||||
{
|
||||
this.cadence = cadence;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Bicycle{" + "cadence=" + cadence + ", gear=" + gear + ", speed=" + speed + '}';
|
||||
}
|
||||
|
||||
abstract Details calculatedDetains();
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.mp4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Details {
|
||||
|
||||
private int rank;
|
||||
private String info;
|
||||
|
||||
public void setRank(int rank)
|
||||
{
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public int getRank()
|
||||
{
|
||||
return rank;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Details getDetails(Bicycle b) {
|
||||
if (b instanceof SpeedBike) {
|
||||
if ((SpeedBike) b.speed) {
|
||||
|
||||
}
|
||||
} else if (b instanceof MountainBike) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.mp4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class MountainBike extends Bicycle {
|
||||
|
||||
private int seatHeight;
|
||||
|
||||
public MountainBike( int seatHeight, int cadence, int gear, int speed)
|
||||
{
|
||||
super(cadence, gear, speed);
|
||||
this.seatHeight = seatHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return super.toString() + "MountainBike{" + "seatHeight=" + seatHeight + '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of seatHeight
|
||||
*
|
||||
* @param seatHeight new value of seatHeight
|
||||
*/
|
||||
public void setSeatHeight(int seatHeight)
|
||||
{
|
||||
this.seatHeight = seatHeight;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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.mp4_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class SpeedBike extends Bicycle{
|
||||
|
||||
private double weight;
|
||||
|
||||
public SpeedBike(double weight, int cadence, int gear, int speed)
|
||||
{
|
||||
super(cadence, gear, speed);
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of weight
|
||||
*
|
||||
* @return the value of weight
|
||||
*/
|
||||
public double getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of weight
|
||||
*
|
||||
* @param weight new value of weight
|
||||
*/
|
||||
public void setWeight(double weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return super.toString() + "SpeedBike{" + "weight=" + weight + '}';
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user