Skip to content

Commit

Permalink
Finalized Model Class for input
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusjordan committed Apr 26, 2019
0 parents commit 210cb41
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-11.0.2">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Input</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
12 changes: 12 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11
Binary file added bin/model/Input.class
Binary file not shown.
42 changes: 42 additions & 0 deletions src/model/Input.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package model;

import java.util.Scanner;

public abstract class Input {
private static Scanner read = new Scanner(System.in);

public static Integer Int(String menssage) {
System.out.printf(menssage);
return Integer.parseInt(read.next());
}

public static Long Long(String menssage) {
System.out.printf(menssage);
return Long.parseLong(read.next());
}

public static Character Char(String menssage) {
System.out.printf(menssage);
return read.next().charAt(0);
}

public static String Str(String menssage) {
System.out.printf(menssage);
return read.nextLine();
}

public static Float Float(String menssage) {
System.out.printf(menssage);
return Float.parseFloat(read.next());
}

public static Double Double(String menssage) {
System.out.printf(menssage);
return Double.parseDouble(read.next());
}

public static Boolean Bool(String menssage) {
System.out.printf(menssage);
return Boolean.parseBoolean(read.next());
}
}

0 comments on commit 210cb41

Please sign in to comment.