master
Chloe Fontenot 🏳️‍⚧️ 2022-09-08 15:44:16 +07:00
parent feeaa48005
commit a4e1c932b4
6 changed files with 81 additions and 0 deletions

1
.gitignore vendored

@ -1,3 +1,4 @@
/lab4_CalebFontenot/target/
/lab5_CalebFontenot/target/
/LabClass_Sep6_CalebFontenot/target/
/lab6_CalebFontenot/target/

Binary file not shown.

@ -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 {
}