Lab6
This commit is contained in:
parent
feeaa48005
commit
a4e1c932b4
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
/lab4_CalebFontenot/target/
|
/lab4_CalebFontenot/target/
|
||||||
/lab5_CalebFontenot/target/
|
/lab5_CalebFontenot/target/
|
||||||
/LabClass_Sep6_CalebFontenot/target/
|
/LabClass_Sep6_CalebFontenot/target/
|
||||||
|
/lab6_CalebFontenot/target/
|
||||||
|
BIN
lab6_CalebFontenot/lab6-1-1.pdf
Normal file
BIN
lab6_CalebFontenot/lab6-1-1.pdf
Normal file
Binary file not shown.
14
lab6_CalebFontenot/pom.xml
Normal file
14
lab6_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.lab6_calebfontenot</groupId>
|
||||||
|
<artifactId>lab6_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.lab6_calebfontenot.Lab6_CalebFontenot</exec.mainClass>
|
||||||
|
</properties>
|
||||||
|
</project>
|
@ -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.lab6_calebfontenot;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author caleb
|
||||||
|
*/
|
||||||
|
public class If1 {
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
System.out.println("Please type a positive number: ");
|
||||||
|
|
||||||
|
/*
|
||||||
|
Observe that the varible scan is eliminated
|
||||||
|
Explanation: We create a new object by using "new Scanner" and
|
||||||
|
then the DOT (.) nextInt() uses that new object (new varibale) to read
|
||||||
|
*/
|
||||||
|
int number = new Scanner(System.in).nextInt();
|
||||||
|
|
||||||
|
if ( number >= 0 )
|
||||||
|
System.out.println("You typed a positive number! It was number " + number + "!");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Project/Maven2/JavaApp/src/main/java/${packagePath}/${mainClassName}.java to edit this template
|
||||||
|
*/
|
||||||
|
package com.calebfontenot.lab6_calebfontenot;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author caleb
|
||||||
|
*/
|
||||||
|
public class Lab6_CalebFontenot {
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
System.out.println("Please type a positive number: ");
|
||||||
|
Scanner scan = new Scanner(System.in);
|
||||||
|
int number = scan.nextInt();
|
||||||
|
|
||||||
|
if (number >= 0) {
|
||||||
|
System.out.println("You typed a positive number! It was number " + number + "!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* 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.lab6_calebfontenot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author caleb
|
||||||
|
*/
|
||||||
|
public class Triangle {
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user