Need help with java assignment
MarioIturrino_Lab9/build.xml
Builds, tests, and runs the project MarioIturrino_Lab9.
MarioIturrino_Lab9/manifest.mf
Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build
MarioIturrino_Lab9/nbproject/build-impl.xml
Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
MarioIturrino_Lab9/nbproject/genfiles.properties
build.xml.data.CRC32=0e424819 build.xml.script.CRC32=c0be9448 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=0e424819 nbproject/build-impl.xml.script.CRC32=0e985573 nbproject/[email protected]
MarioIturrino_Lab9/nbproject/project.properties
annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Files in build.classes.dir which should be excluded from distribution jar dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/MarioIturrino_Lab9.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath=\ ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=marioiturrino_lab9.MarioIturrino_Lab9 manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test
MarioIturrino_Lab9/nbproject/project.xml
org.netbeans.modules.java.j2seproject MarioIturrino_Lab9
MarioIturrino_Lab9/src/marioiturrino_lab9/Clock.java
MarioIturrino_Lab9/src/marioiturrino_lab9/Clock.java
package
marioiturrino_lab9
;
public
class
Clock
{
int
minutes
;
int
hours
;
Clock
()
{
minutes
=
0
;
hours
=
0
;
}
Clock
(
int
hour
,
int
min
)
{
setminutes
(
min
);
sethours
(
hour
);
}
void
setminutes
(
int
min
)
{
minutes
=
min
%
60
;
}
void
sethours
(
int
hour
)
{
hours
=
hour
%
24
;
}
int
gethours
()
{
return
hours
;
}
int
getminutes
()
{
return
minutes
;
}
String
printTime
()
{
if
(
hours
<
10
&&
minutes
<
10
)
{
return
(
"0"
+
gethours
()
+
":0"
+
getminutes
());
}
else
if
(
minutes
<
10
)
{
return
(
gethours
()
+
":0"
+
getminutes
());
}
else
if
(
hours
<
10
)
{
return
(
"0"
+
gethours
()
+
":"
+
getminutes
());
}
else
return
(
gethours
()
+
":"
+
getminutes
());
}
int
advanceClock
(
int
minute
)
{
if
(
minute
>
720
)
{
return
-
1
;
}
else
if
((
minutes
+
minute
)
<
60
)
{
setminutes
(
minutes
+
minute
);
}
else
{
int
hour
=
minutes
+
minute
;
hour
=
hour
/
60
;
minutes
=
(
minutes
+
minute
)
%
60
;
hours
=
(
hours
+
hour
)
%
24
;
}
return
1
;
}
}
MarioIturrino_Lab9/src/marioiturrino_lab9/MarioIturrino_Lab9.java
MarioIturrino_Lab9/src/marioiturrino_lab9/MarioIturrino_Lab9.java
package
marioiturrino_lab9
;
import
java
.
util
.
Scanner
;
public
class
MarioIturrino_Lab9
{
public
static
void
main
(
String
[]
args
)
{
int
hour
=
0
,
minutes
=
0
;
System
.
out
.
println
(
"Our Clock tells Time Based on 24-hour Clock"
);
System
.
out
.
println
(
"Enter Hours (0-23): "
);
Scanner
input
=
new
Scanner
(
System
.
in
);
hour
=
Integer
.
parseInt
(
input
.
nextLine
());
System
.
out
.
println
(
"Enter Minutes (0-59)"
);
Scanner
input2
=
new
Scanner
(
System
.
in
);
minutes
=
Integer
.
parseInt
(
input2
.
nextLine
());
int
inp
=
0
;
Clock
C
=
new
Clock
(
hour
,
minutes
);
System
.
out
.
println
(
"Initial Time: "
+
C
.
printTime
());
System
.
out
.
println
(
"Hours Getter: "
+
C
.
gethours
());
System
.
out
.
println
(
"Minutes Getter: "
+
C
.
getminutes
());
while
(
inp
!=-
1
)
{
System
.
out
.
println
(
"Enter Number of minutes to advance the clock(up to 720 minutes) or -1 to exit"
);
input
=
new
Scanner
(
System
.
in
);
minutes
=
Integer
.
parseInt
(
input
.
nextLine
());
if
(
C
.
advanceClock
(
minutes
)
==-
1
)
{
System
.
out
.
println
(
"Invalid Input! Please Enter Again"
);
}
System
.
out
.
println
(
"New Time: "
+
C
.
printTime
());
}
}
}