diff --git a/murach/.metadata/.lock b/murach/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/murach/.metadata/.lock_info b/murach/.metadata/.lock_info new file mode 100644 index 0000000..cbc2ad8 --- /dev/null +++ b/murach/.metadata/.lock_info @@ -0,0 +1,4 @@ +#Thu Dec 26 09:17:18 EST 2024 +host=L914 +process-id=33180 +user=DagostiT diff --git a/murach/.metadata/.log b/murach/.metadata/.log new file mode 100644 index 0000000..71fa01d --- /dev/null +++ b/murach/.metadata/.log @@ -0,0 +1,99 @@ +!SESSION 2024-12-26 09:15:39.973 ----------------------------------------------- +eclipse.buildId=4.34.0.20241128-0756 +java.version=23.0.1 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:15:41.800 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:15:43.363 +!MESSAGE Logback config file: C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml + +!ENTRY org.eclipse.ui 4 4 2024-12-26 09:15:44.057 +!MESSAGE Invalid workspace location to be set for Edge browser. +!STACK 0 +java.net.URISyntaxException: Illegal character in path at index 32: file:/C:/Users/Dagostit/OneDrive - The Mental Health Association of Westchester Inc/Documents/Code/java/.metadata/.plugins/org.eclipse.swt + at java.base/java.net.URI$Parser.fail(URI.java:2995) + at java.base/java.net.URI$Parser.checkChars(URI.java:3166) + at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) + at java.base/java.net.URI$Parser.parse(URI.java:3196) + at java.base/java.net.URI.(URI.java:645) + at java.base/java.net.URL.toURI(URL.java:1220) + at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530) + at org.eclipse.ui.internal.Workbench.(Workbench.java:461) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.egit.ui 2 0 2024-12-26 09:15:50.594 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Dagostit'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.oomph.setup.ui 1 0 2024-12-26 09:15:58.250 +!MESSAGE Setup tasks were performed during startup updating 5 preferences. See 'C:\Users\Dagostit\eclipse\java-2024-12\eclipse\configuration\org.eclipse.oomph.setup\setup.log' for details +!SESSION 2024-12-26 09:17:16.245 ----------------------------------------------- +eclipse.buildId=4.34.0.20241128-0756 +java.version=23.0.1 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\Java + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:17:18.093 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:17:19.392 +!MESSAGE Logback config file: C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml + +!ENTRY org.eclipse.ui 4 4 2024-12-26 09:17:20.494 +!MESSAGE Invalid workspace location to be set for Edge browser. +!STACK 0 +java.net.URISyntaxException: Illegal character in path at index 32: file:/C:/Users/Dagostit/OneDrive - The Mental Health Association of Westchester Inc/Documents/Code/java/.metadata/.plugins/org.eclipse.swt + at java.base/java.net.URI$Parser.fail(URI.java:2995) + at java.base/java.net.URI$Parser.checkChars(URI.java:3166) + at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) + at java.base/java.net.URI$Parser.parse(URI.java:3196) + at java.base/java.net.URI.(URI.java:645) + at java.base/java.net.URL.toURI(URL.java:1220) + at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530) + at org.eclipse.ui.internal.Workbench.(Workbench.java:461) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.egit.ui 2 0 2024-12-26 09:17:24.730 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Dagostit'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/murach/.metadata/.mylyn/.taskListIndex/segments_1 b/murach/.metadata/.mylyn/.taskListIndex/segments_1 new file mode 100644 index 0000000..de59c0d Binary files /dev/null and b/murach/.metadata/.mylyn/.taskListIndex/segments_1 differ diff --git a/murach/.metadata/.mylyn/.taskListIndex/write.lock b/murach/.metadata/.mylyn/.taskListIndex/write.lock new file mode 100644 index 0000000..e69de29 diff --git a/murach/.metadata/.mylyn/.tasks.xml.zip b/murach/.metadata/.mylyn/.tasks.xml.zip new file mode 100644 index 0000000..a9a3992 Binary files /dev/null and b/murach/.metadata/.mylyn/.tasks.xml.zip differ diff --git a/murach/.metadata/.mylyn/repositories.xml.zip b/murach/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000..f29afc6 Binary files /dev/null and b/murach/.metadata/.mylyn/repositories.xml.zip differ diff --git a/murach/.metadata/.mylyn/tasks.xml.zip b/murach/.metadata/.mylyn/tasks.xml.zip new file mode 100644 index 0000000..bfb30ef Binary files /dev/null and b/murach/.metadata/.mylyn/tasks.xml.zip differ diff --git a/murach/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location b/murach/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location new file mode 100644 index 0000000..dfdc20e Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location differ diff --git a/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/murach/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree new file mode 100644 index 0000000..9228d1f Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.core.resources/.root/2.tree differ diff --git a/murach/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/murach/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000..c3c5c54 Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..c5f59ce --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.ui.formatterprofiles.version=23 +spelling_locale_initialized=true +typefilter_migrated_2=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000..2b60c21 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +migrated.task.repositories.secure.store=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true +org.eclipse.mylyn.tasks.ui.welcome.message=true diff --git a/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..6266dd5 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +platformState=907520816282796 +quickStart=false +tipsAndTricks=true diff --git a/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..5e87d05 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,13 @@ +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; +RUN_IN_BACKGROUND=false +eclipse.preferences.version=1 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=41,41,41 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=43,44,45 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=204,204,204 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=41,41,41 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=43,44,45 +org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR=221,221,221 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_END=49,53,56 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=59,64,66 +org.eclipse.ui.workbench.INACTIVE_TAB_TEXT_COLOR=187,187,187 diff --git a/murach/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/murach/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..d75234e --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2433 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + + + + + + + + topLevel + + + Minimized + MinimizedByZoom + + + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.text.quicksearch.actionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.jdt.ui.PackageExplorer + persp.viewSC:org.eclipse.jdt.ui.TypeHierarchy + persp.viewSC:org.eclipse.jdt.ui.SourceView + persp.viewSC:org.eclipse.jdt.ui.JavadocView + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.TaskList + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.texteditor.TemplatesView + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.jdt.ui.wizards.JavaProjectWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewEnumCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewRecordCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.showIn:org.eclipse.jdt.ui.PackageExplorer + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks + persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.jdt.debug.ui.JDTDebugActionSet + persp.showIn:org.eclipse.egit.ui.RepositoriesView + persp.newWizSC:org.eclipse.m2e.core.wizards.Maven2ProjectWizard + persp.actionSet:org.eclipse.eclemma.ui.CoverageActionSet + persp.showIn:org.eclipse.eclemma.ui.CoverageView + persp.viewSC:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.showIn:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.viewSC:org.eclipse.jdt.bcoview.views.BytecodeOutlineView + persp.newWizSC:org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard + persp.actionSet:org.eclipse.jdt.junit.JUnitActionSet + persp.viewSC:org.eclipse.ant.ui.views.AntView + persp.editorOnboardingImageUri:platform:/plugin/org.eclipse.jdt.ui/$nl$/icons/full/onboarding_jperspective.png + persp.editorOnboardingText:Open a file or drop files here to open them. + persp.editorOnboardingCommand:Find Actions$$$Ctrl+3 + persp.editorOnboardingCommand:Show Key Assist$$$Ctrl+Shift+L + persp.editorOnboardingCommand:New$$$Ctrl+N + persp.editorOnboardingCommand:Open Type$$$Ctrl+Shift+T + + + + org.eclipse.e4.primaryNavigationStack + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + + + + + + View + categoryTag:Mylyn + + + + org.eclipse.e4.secondaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Ant + + + + + + org.eclipse.e4.secondaryDataStack + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Terminal + + + + + + + + active + Maximized + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + + + + View + categoryTag:Help + + + + + + View + categoryTag:General + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + EditorStack + org.eclipse.e4.primaryDataStack + + + + + + + View + categoryTag:Java + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + View + categoryTag:Mylyn + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Git + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Ant + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + + + toolbarSeparator + + + + Draggable + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + NoRestore + + + + + View + categoryTag:Git + + + + + View + categoryTag:Help + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Oomph + + + + + View + categoryTag:General + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:Version Control (Team) + + + View + categoryTag:Help + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Other + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + glue + move_after:PerspectiveSpacer + SHOW_RESTORE_MENU + + + move_after:Spacer Glue + HIDEABLE + SHOW_RESTORE_MENU + + + glue + move_after:SearchField + SHOW_RESTORE_MENU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/murach/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache differ diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/murach/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache differ diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/murach/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/murach/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache differ diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/murach/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/murach/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/murach/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/murach/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml new file mode 100644 index 0000000..47a29f5 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -0,0 +1,10 @@ + +
+
+ + + + + +
+
diff --git a/murach/.metadata/.plugins/org.eclipse.m2e.logback/0.log b/murach/.metadata/.plugins/org.eclipse.m2e.logback/0.log new file mode 100644 index 0000000..19f711b --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.m2e.logback/0.log @@ -0,0 +1,2 @@ +2024-12-26 09:15:50,435 [Worker-7: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is not available. Remote download required. +2024-12-26 09:17:24,563 [Worker-5: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read. diff --git a/murach/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser b/murach/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser new file mode 100644 index 0000000..1e9a069 Binary files /dev/null and b/murach/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser differ diff --git a/murach/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml b/murach/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml new file mode 100644 index 0000000..23724b8 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml @@ -0,0 +1,13 @@ + +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/murach/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml b/murach/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/murach/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/murach/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml new file mode 100644 index 0000000..35602b1 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -0,0 +1,11 @@ + +
+
+ + +
+
+ + +
+
diff --git a/murach/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/murach/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..6bd4086 --- /dev/null +++ b/murach/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/murach/.metadata/version.ini b/murach/.metadata/version.ini new file mode 100644 index 0000000..e6e3fa1 --- /dev/null +++ b/murach/.metadata/version.ini @@ -0,0 +1,3 @@ +#Thu Dec 26 09:17:18 EST 2024 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.34.0.v20241120-1800 diff --git a/murach/db/products.sql b/murach/db/products.sql new file mode 100644 index 0000000..1577c04 --- /dev/null +++ b/murach/db/products.sql @@ -0,0 +1,69 @@ +-- Drop the tables if they already exist in order to start with a fresh +-- database. You will lose any changes you have made to this data. + +DROP TABLE IF EXISTS Products; +DROP TABLE IF EXISTS LineItems; + +-- Create the tables +CREATE TABLE Products ( + ProductCode TEXT PRIMARY KEY NOT NULL, + Description TEXT UNIQUE NOT NULL, + Price REAL NOT NULL +); + +CREATE TABLE LineItems ( + LineItemID INTEGER PRIMARY KEY NOT NULL, + InvoiceID INTEGER NOT NULL, + ProductCode TEXT NOT NULL, + Quantity INTEGER NOT NULL, + FOREIGN KEY(ProductCode) REFERENCES Products(ProductCode) +); + + +-- Populate the Products table +INSERT INTO Products VALUES +('java', 'Murach''s Java Programming', 57.50); + +INSERT INTO Products VALUES +('jsp', 'Murach''s Java Servlets and JSP', 57.50); + +INSERT INTO Products VALUES +('mysql', 'Murach''s MySQL', 54.50); + +INSERT INTO Products VALUES +('orac', 'Murach''s Oracle and PL/SQL', 54.50); + +INSERT INTO Products VALUES +('andr', 'Murach''s Android Programming', 57.50); + +INSERT INTO Products VALUES +('html', 'Murach''s HTML and CSS', 54.50); + +INSERT INTO Products VALUES +('jscr', 'Murach''s JavaScript and jQuery', 54.50); + + +-- Populate the LineItems table +INSERT INTO LineItems VALUES +(1, 1, 'java', 5); + +INSERT INTO LineItems VALUES +(2, 1, 'jsp', 5); + +INSERT INTO LineItems VALUES +(3, 2, 'mysql', 1); + +INSERT INTO LineItems VALUES +(4, 3, 'andr', 1); + +INSERT INTO LineItems VALUES +(5, 3, 'orac', 2); + +INSERT INTO LineItems VALUES +(6, 4, 'html', 1); + +INSERT INTO LineItems VALUES +(7, 5, 'java', 1); + +INSERT INTO LineItems VALUES +(8, 5, 'mysql', 5); diff --git a/murach/db/products.sqlite b/murach/db/products.sqlite new file mode 100644 index 0000000..4e159f8 Binary files /dev/null and b/murach/db/products.sqlite differ diff --git a/murach/db/sqlite-jdbc.jar b/murach/db/sqlite-jdbc.jar new file mode 100644 index 0000000..9e40219 Binary files /dev/null and b/murach/db/sqlite-jdbc.jar differ diff --git a/murach/eclipse/.metadata/.lock b/murach/eclipse/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/murach/eclipse/.metadata/.lock_info b/murach/eclipse/.metadata/.lock_info new file mode 100644 index 0000000..f751163 --- /dev/null +++ b/murach/eclipse/.metadata/.lock_info @@ -0,0 +1,4 @@ +#Thu Dec 26 12:10:11 EST 2024 +host=L914 +process-id=30968 +user=DagostiT diff --git a/murach/eclipse/.metadata/.log b/murach/eclipse/.metadata/.log new file mode 100644 index 0000000..eebec16 --- /dev/null +++ b/murach/eclipse/.metadata/.log @@ -0,0 +1,5330 @@ +!SESSION 2021-10-19 10:11:57.977 ----------------------------------------------- +eclipse.buildId=4.21.0.I20210906-0500 +java.version=16.0.2 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ +Command-line arguments: -data C:\Users\Joel\Dropbox\Java 6ed\java\eclipse -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ + +!ENTRY org.eclipse.jface 2 0 2021-10-19 10:12:06.883 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-10-19 10:12:06.883 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@12a6e8ed, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@63b4b9c6, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2021-10-19 10:12:18.929 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Joel'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2021-11-08 15:27:55.608 ----------------------------------------------- +eclipse.buildId=4.21.0.I20210906-0500 +java.version=16.0.2 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ + +!ENTRY org.eclipse.jface 2 0 2021-11-08 15:28:28.761 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-08 15:28:28.761 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@64ed18ec, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1dfcf85a, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2021-11-08 15:28:57.268 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Joel'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jdt.ui 4 2 2021-11-08 15:38:01.904 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ui". +!STACK 0 +java.lang.NullPointerException + at java.base/java.util.Objects.requireNonNull(Objects.java:208) + at java.base/java.util.Arrays$ArrayList.(Arrays.java:4136) + at java.base/java.util.Arrays.asList(Arrays.java:4121) + at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getTryWithResourceProposals(QuickAssistProcessor.java:3459) + at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getAssists(QuickAssistProcessor.java:358) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeAssistCollector.safeRun(JavaCorrectionProcessor.java:404) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:341) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:330) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectAssists(JavaCorrectionProcessor.java:506) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectProposals(JavaCorrectionProcessor.java:291) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeQuickAssistProposals(JavaCorrectionProcessor.java:247) + at org.eclipse.jface.text.quickassist.QuickAssistAssistant$ContentAssistProcessor.computeCompletionProposals(QuickAssistAssistant.java:71) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2022) + at java.base/java.util.Collections$SingletonSet.forEach(Collections.java:4872) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2021) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2018) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:577) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:507) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:502) + at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1832) + at org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(QuickAssistAssistant.java:113) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibleQuickAssists(JavaCorrectionAssistant.java:194) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.runWithEvent(JavaSelectAnnotationRulerAction.java:101) + at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.runWithEvent(AbstractRulerActionDelegate.java:112) + at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:281) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) + at org.eclipse.ui.actions.ContributedAction.runWithEvent(ContributedAction.java:176) + at org.eclipse.ui.texteditor.AbstractTextEditor$1.triggerAction(AbstractTextEditor.java:3031) + at org.eclipse.ui.texteditor.AbstractTextEditor$1.lambda$0(AbstractTextEditor.java:3045) + at org.eclipse.swt.widgets.Display.runTimer(Display.java:4152) + at org.eclipse.swt.widgets.Display.messageProc(Display.java:3256) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3624) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.jdt.ui 4 4 2021-11-08 15:38:01.962 +!MESSAGE An error occurred while computing quick assists. Check log for details. +!SUBENTRY 1 org.eclipse.jdt.ui 4 0 2021-11-08 15:38:01.962 +!MESSAGE Exception while processing quick fixes or quick assists +!SUBENTRY 2 org.eclipse.jdt.ui 4 4 2021-11-08 15:38:01.962 +!MESSAGE Exception while processing quick fixes or quick assists +!STACK 0 +java.lang.NullPointerException + at java.base/java.util.Objects.requireNonNull(Objects.java:208) + at java.base/java.util.Arrays$ArrayList.(Arrays.java:4136) + at java.base/java.util.Arrays.asList(Arrays.java:4121) + at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getTryWithResourceProposals(QuickAssistProcessor.java:3459) + at org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor.getAssists(QuickAssistProcessor.java:358) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeAssistCollector.safeRun(JavaCorrectionProcessor.java:404) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.run(JavaCorrectionProcessor.java:341) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor$SafeCorrectionProcessorAccess.process(JavaCorrectionProcessor.java:330) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectAssists(JavaCorrectionProcessor.java:506) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.collectProposals(JavaCorrectionProcessor.java:291) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.computeQuickAssistProposals(JavaCorrectionProcessor.java:247) + at org.eclipse.jface.text.quickassist.QuickAssistAssistant$ContentAssistProcessor.computeCompletionProposals(QuickAssistAssistant.java:71) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.lambda$0(ContentAssistant.java:2022) + at java.base/java.util.Collections$SingletonSet.forEach(Collections.java:4872) + at org.eclipse.jface.text.contentassist.ContentAssistant$2.run(ContentAssistant.java:2021) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:2018) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:577) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.lambda$0(CompletionProposalPopup.java:507) + at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74) + at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:502) + at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1832) + at org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(QuickAssistAssistant.java:113) + at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant.showPossibleQuickAssists(JavaCorrectionAssistant.java:194) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:200) + at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.runWithEvent(JavaSelectAnnotationRulerAction.java:101) + at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.runWithEvent(AbstractRulerActionDelegate.java:112) + at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:281) + at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488) + at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) + at org.eclipse.ui.actions.ContributedAction.runWithEvent(ContributedAction.java:176) + at org.eclipse.ui.texteditor.AbstractTextEditor$1.triggerAction(AbstractTextEditor.java:3031) + at org.eclipse.ui.texteditor.AbstractTextEditor$1.lambda$0(AbstractTextEditor.java:3045) + at org.eclipse.swt.widgets.Display.runTimer(Display.java:4152) + at org.eclipse.swt.widgets.Display.messageProc(Display.java:3256) + at org.eclipse.swt.internal.win32.OS.DispatchMessage(Native Method) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3624) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.egit.core 4 0 2021-11-08 15:41:15.082 +!MESSAGE Could not delete file C:\Users\Joel\Dropbox\Java 6ed\java\eclipse\.metadata\.plugins\org.eclipse.core.resources\.projects\ch01_FutureValueGUI\org.eclipse.egit.core +!STACK 0 +java.io.IOException: Could not delete file C:\Users\Joel\Dropbox\Java 6ed\java\eclipse\.metadata\.plugins\org.eclipse.core.resources\.projects\ch01_FutureValueGUI\org.eclipse.egit.core + at org.eclipse.jgit.util.FileUtils.handleDeleteException(FileUtils.java:232) + at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:225) + at org.eclipse.egit.core.project.GitProjectData.deletePropertyFiles(GitProjectData.java:586) + at org.eclipse.egit.core.project.GitProjectData.delete(GitProjectData.java:239) + at org.eclipse.egit.core.project.GitProjectData$RCL.resourceChanged(GitProjectData.java:91) + at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:305) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:295) + at org.eclipse.core.internal.events.NotificationManager.handleEvent(NotificationManager.java:271) + at org.eclipse.core.internal.resources.Workspace.broadcastEvent(Workspace.java:376) + at org.eclipse.core.internal.resources.Resource.broadcastPreDeleteEvent(Resource.java:1851) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:747) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +Caused by: java.nio.file.FileSystemException: C:\Users\Joel\Dropbox\Java 6ed\java\eclipse\.metadata\.plugins\org.eclipse.core.resources\.projects\ch01_FutureValueGUI\org.eclipse.egit.core: The process cannot access the file because it is being used by another process + at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92) + at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) + at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) + at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:275) + at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105) + at java.base/java.nio.file.Files.delete(Files.java:1146) + at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:191) + ... 24 more + +!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2021-11-08 15:41:15.433 +!MESSAGE Internal Error +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:775) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +Contains: Error deleting resource '/ch01_FutureValueGUI' from the workspace tree. +org.eclipse.core.internal.resources.ResourceException(/ch01_FutureValueGUI)[569]: java.lang.Exception: Could not delete metadata for '/ch01_FutureValueGUI'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +!SUBENTRY 1 org.eclipse.core.resources 1 273 2021-11-08 15:41:15.434 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 2 org.eclipse.core.resources 1 4 2021-11-08 15:41:15.434 +!MESSAGE Error deleting resource '/ch01_FutureValueGUI' from the workspace tree. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException(/ch01_FutureValueGUI)[569]: java.lang.Exception: Could not delete metadata for '/ch01_FutureValueGUI'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +!SUBENTRY 3 org.eclipse.core.resources 4 569 2021-11-08 15:41:15.434 +!MESSAGE Could not delete metadata for '/ch01_FutureValueGUI'. +!STACK 0 +java.lang.Exception: Could not delete metadata for '/ch01_FutureValueGUI'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) + +!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2021-11-08 15:41:34.179 +!MESSAGE Internal Error +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: Problems encountered while deleting resources. + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:775) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +Contains: Error deleting resource '/ch01_FutureValueConsole' from the workspace tree. +org.eclipse.core.internal.resources.ResourceException(/ch01_FutureValueConsole)[569]: java.lang.Exception: Could not delete metadata for '/ch01_FutureValueConsole'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +!SUBENTRY 1 org.eclipse.core.resources 1 273 2021-11-08 15:41:34.180 +!MESSAGE Problems encountered while deleting resources. +!SUBENTRY 2 org.eclipse.core.resources 1 4 2021-11-08 15:41:34.180 +!MESSAGE Error deleting resource '/ch01_FutureValueConsole' from the workspace tree. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException(/ch01_FutureValueConsole)[569]: java.lang.Exception: Could not delete metadata for '/ch01_FutureValueConsole'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) +!SUBENTRY 3 org.eclipse.core.resources 4 569 2021-11-08 15:41:34.180 +!MESSAGE Could not delete metadata for '/ch01_FutureValueConsole'. +!STACK 0 +java.lang.Exception: Could not delete metadata for '/ch01_FutureValueConsole'. + at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42) + at org.eclipse.core.internal.resources.ResourceException.(ResourceException.java:38) + at org.eclipse.core.internal.resources.LocalMetaArea.delete(LocalMetaArea.java:109) + at org.eclipse.core.internal.resources.Project.deleteResource(Project.java:335) + at org.eclipse.core.internal.resources.ResourceTree.deletedProject(ResourceTree.java:179) + at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:890) + at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1792) + at org.eclipse.core.internal.resources.Resource.delete(Resource.java:762) + at org.eclipse.core.internal.resources.Project.delete(Project.java:320) + at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:155) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:281) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.lambda$0(PerformChangeOperation.java:258) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:295) + at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:94) + at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:219) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313) + at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338) + at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:89) + at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122) + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-08 16:17:20.271 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:400) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-08 16:17:20.271 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-08 16:17:20.284 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:401) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-08 16:17:20.284 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-08 16:17:20.291 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationChanged(LaunchManager.java:2128) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:376) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:259) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:229) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:187) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:402) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-08 16:17:20.292 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!SESSION 2021-11-17 07:35:05.786 ----------------------------------------------- +eclipse.buildId=4.21.0.I20210906-0500 +java.version=17 +java.vendor=Oracle Corporation +BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Users/joelmurach/.eclipse_keyring +Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/joelmurach/.eclipse_keyring + +!ENTRY org.eclipse.jface 2 0 2021-11-17 07:35:18.899 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-17 07:35:18.899 +!MESSAGE A conflict occurred for COMMAND+SHIFT+T: +Binding(COMMAND+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1eb6037d, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(COMMAND+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@335b3d6, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.ui 4 4 2021-11-17 07:35:23.268 +!MESSAGE Unable to create part +!STACK 1 +org.eclipse.ui.PartInitException: Cannot determine URI for '/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java'. + at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3204) + at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215) + at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527) + at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:51) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:82) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:64) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1078) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) +Caused by: org.eclipse.core.runtime.CoreException: Cannot determine URI for '/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java'. + at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.create(ResourceFileBuffer.java:239) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.connect(TextFileBufferManager.java:115) + at org.eclipse.ui.editors.text.TextFileDocumentProvider.createFileInfo(TextFileDocumentProvider.java:563) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:1018) + at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:481) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1284) + at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4183) + at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:262) + at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1479) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2554) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2527) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1410) + at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3173) + at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2290) + at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3190) + ... 114 more +!SUBENTRY 1 org.eclipse.core.filebuffers 4 0 2021-11-17 07:35:23.270 +!MESSAGE Cannot determine URI for '/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java'. +!STACK 1 +org.eclipse.core.runtime.CoreException: Cannot determine URI for '/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java'. + at org.eclipse.core.internal.filebuffers.ResourceFileBuffer.create(ResourceFileBuffer.java:239) + at org.eclipse.core.internal.filebuffers.TextFileBufferManager.connect(TextFileBufferManager.java:115) + at org.eclipse.ui.editors.text.TextFileDocumentProvider.createFileInfo(TextFileDocumentProvider.java:563) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:1018) + at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:481) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1284) + at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4183) + at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:262) + at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1479) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2554) + at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2527) + at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1410) + at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3173) + at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2290) + at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3190) + at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3215) + at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353) + at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:960) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:330) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1209) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527) + at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:994) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:51) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:82) + at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:116) + at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:64) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:150) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:71) + at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:658) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1078) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) +!SUBENTRY 2 org.eclipse.core.filebuffers 4 0 2021-11-17 07:35:23.271 +!MESSAGE Cannot determine URI for '/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java'. + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:41:33.705 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeDetailsLabelProvider.getImage(DebugTypeSelectionDialog.java:163) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.refresh(FilteredItemsSelectionDialog.java:2882) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.inputChanged(FilteredItemsSelectionDialog.java:2851) + at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refreshDetails(FilteredItemsSelectionDialog.java:771) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleSelected(FilteredItemsSelectionDialog.java:838) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$5(FilteredItemsSelectionDialog.java:662) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2130) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:41:33.706 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.getImage(FilteredItemsSelectionDialog.java:1518) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1568) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:396) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1499) + at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2625) + at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:499) + at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:472) + at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:987) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:42:56.378 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.getImage(FilteredItemsSelectionDialog.java:1518) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1568) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:396) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1499) + at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2625) + at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:499) + at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:472) + at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:987) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:42:56.379 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeDetailsLabelProvider.getImage(DebugTypeSelectionDialog.java:163) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.refresh(FilteredItemsSelectionDialog.java:2882) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.inputChanged(FilteredItemsSelectionDialog.java:2851) + at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refreshDetails(FilteredItemsSelectionDialog.java:771) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleSelected(FilteredItemsSelectionDialog.java:838) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$5(FilteredItemsSelectionDialog.java:662) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2130) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 07:44:27.961 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:400) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 07:44:27.961 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 07:44:27.963 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:401) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 07:44:27.963 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 07:44:27.968 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationChanged(LaunchManager.java:2128) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:376) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:259) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:229) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:187) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:402) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 07:44:27.968 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:44:55.594 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.getImage(FilteredItemsSelectionDialog.java:1518) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1568) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:396) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1499) + at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2625) + at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:499) + at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:472) + at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:987) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:44:55.595 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeDetailsLabelProvider.getImage(DebugTypeSelectionDialog.java:163) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.refresh(FilteredItemsSelectionDialog.java:2882) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.inputChanged(FilteredItemsSelectionDialog.java:2851) + at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refreshDetails(FilteredItemsSelectionDialog.java:771) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleSelected(FilteredItemsSelectionDialog.java:838) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$5(FilteredItemsSelectionDialog.java:662) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2130) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:46:52.826 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeDetailsLabelProvider.getImage(DebugTypeSelectionDialog.java:163) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.refresh(FilteredItemsSelectionDialog.java:2882) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.inputChanged(FilteredItemsSelectionDialog.java:2851) + at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refreshDetails(FilteredItemsSelectionDialog.java:771) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleSelected(FilteredItemsSelectionDialog.java:838) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$5(FilteredItemsSelectionDialog.java:662) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2130) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:46:52.827 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.getImage(FilteredItemsSelectionDialog.java:1518) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1568) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:396) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1499) + at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2625) + at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:499) + at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:472) + at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:987) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:46:52.829 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeDetailsLabelProvider.getImage(DebugTypeSelectionDialog.java:163) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.refresh(FilteredItemsSelectionDialog.java:2882) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$DetailsContentViewer.inputChanged(FilteredItemsSelectionDialog.java:2851) + at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refreshDetails(FilteredItemsSelectionDialog.java:771) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.handleSelected(FilteredItemsSelectionDialog.java:838) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.lambda$5(FilteredItemsSelectionDialog.java:662) + at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:151) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:148) + at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2130) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + +!ENTRY org.eclipse.ui.ide 4 4 2021-11-17 07:46:52.830 +!MESSAGE Not properly disposed SWT resource +!STACK 0 +java.lang.Error: SWT Resource was not properly disposed + at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) + at org.eclipse.swt.graphics.Resource.(Resource.java:120) + at org.eclipse.swt.graphics.Image.(Image.java:824) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:338) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:287) + at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:265) + at org.eclipse.jdt.internal.debug.ui.launcher.DebugTypeSelectionDialog$DebugTypeLabelProvider.getImage(DebugTypeSelectionDialog.java:68) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.getImage(FilteredItemsSelectionDialog.java:1518) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ItemsListLabelProvider.update(FilteredItemsSelectionDialog.java:1568) + at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144) + at org.eclipse.jface.viewers.AbstractTableViewer.doUpdateItem(AbstractTableViewer.java:396) + at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:427) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174) + at org.eclipse.jface.viewers.StructuredViewer.refreshItem(StructuredViewer.java:1499) + at org.eclipse.jface.viewers.AbstractTableViewer.replace(AbstractTableViewer.java:1014) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$ContentProvider.updateElement(FilteredItemsSelectionDialog.java:2625) + at org.eclipse.jface.viewers.AbstractTableViewer.getVirtualSelection(AbstractTableViewer.java:499) + at org.eclipse.jface.viewers.AbstractTableViewer.getSelectionFromWidget(AbstractTableViewer.java:472) + at org.eclipse.jface.viewers.StructuredViewer.getSelection(StructuredViewer.java:987) + at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1176) + at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1205) + at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:242) + at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:400) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.refresh(FilteredItemsSelectionDialog.java:884) + at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$RefreshJob.runInUIThread(FilteredItemsSelectionDialog.java:1307) + at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4262) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3885) + at org.eclipse.jface.window.Window.runEventLoop(Window.java:823) + at org.eclipse.jface.window.Window.open(Window.java:799) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.chooseType(JavaLaunchShortcut.java:152) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.searchAndLaunch(JavaLaunchShortcut.java:132) + at org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut.launch(JavaLaunchShortcut.java:281) + at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:430) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:267) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:188) + at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:100) + at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.runInternal(AbstractLaunchToolbarAction.java:90) + at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:422) + at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:229) + at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:218) + at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580) + at org.eclipse.jface.action.ActionContributionItem.lambda$5(ActionContributionItem.java:453) + at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) + at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4524) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545) + at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530) + at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324) + at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4310) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3883) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1041) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) +!SESSION 2021-11-17 09:22:13.958 ----------------------------------------------- +eclipse.buildId=4.21.0.I20210906-0500 +java.version=16.0.2 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 09:23:50.994 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ArrangeWindowHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ArrangeWindowHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.processActiveHandler(HandlerProcessingAddon.java:141) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.postConstruct(HandlerProcessingAddon.java:55) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:344) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:94) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 09:23:51.082 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.MinimizeWindowHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.MinimizeWindowHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.processActiveHandler(HandlerProcessingAddon.java:141) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.postConstruct(HandlerProcessingAddon.java:55) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:344) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:94) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 09:23:51.085 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ZoomWindowHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ZoomWindowHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.processActiveHandler(HandlerProcessingAddon.java:141) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.postConstruct(HandlerProcessingAddon.java:55) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:344) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:94) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 09:23:51.089 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.processActiveHandler(HandlerProcessingAddon.java:141) + at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon.postConstruct(HandlerProcessingAddon.java:55) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) + at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:995) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:140) + at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:403) + at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:344) + at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:227) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:94) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 09:23:51.206 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.jface 2 0 2021-11-17 09:24:01.175 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-17 09:24:01.175 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@67f8f5a6, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@141b011a, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2021-11-17 09:25:49.628 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Joel'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jdt.launching 1 0 2021-11-17 09:25:49.835 +!MESSAGE Installed JRE 'Java SE 17 [17]' removed due to missing VM type extension. + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2021-11-17 09:25:51.002 +!MESSAGE Removing HandlerImpl with the "org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ArrangeWindowHandler" id.It points to the non available "bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ArrangeWindowHandler" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2021-11-17 09:25:51.007 +!MESSAGE Removing HandlerImpl with the "org.eclipse.e4.ui.workbench.renderers.swt.cocoa.MinimizeWindowHandler" id.It points to the non available "bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.cocoa.MinimizeWindowHandler" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2021-11-17 09:25:51.014 +!MESSAGE Removing HandlerImpl with the "org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ZoomWindowHandler" id.It points to the non available "bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.cocoa.ZoomWindowHandler" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2021-11-17 09:25:51.038 +!MESSAGE Removing HandlerImpl with the "org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler" id.It points to the non available "bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CloseDialogHandler" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.core.resources 4 2 2021-11-17 09:26:26.731 +!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". +!STACK 0 +java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null + at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:173) + at org.eclipse.jdt.internal.core.JavaProject.loadModulesInJimage(JavaProject.java:983) + at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:782) + at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:686) + at org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:345) + at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2127) + at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:501) + at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:305) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:295) + at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:158) + at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:381) + at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1503) + at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:49) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:26:37.381 +!MESSAGE Exception while reading last build state for: P/ch01_FutureValueConsole +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch01_FutureValueConsole + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:26:37.382 +!MESSAGE Error reading last build state for project ch01_FutureValueConsole +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:26:37.382 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:26:43.575 +!MESSAGE Exception while reading last build state for: P/ch01_FutureValueGUI +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch01_FutureValueGUI + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:26:43.575 +!MESSAGE Error reading last build state for project ch01_FutureValueGUI +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:26:43.575 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:04.749 +!MESSAGE Exception while reading last build state for: P/ch02_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch02_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:04.925 +!MESSAGE Error reading last build state for project ch02_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:04.926 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:07.470 +!MESSAGE Exception while reading last build state for: P/ch02_TestScore +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch02_TestScore + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:07.650 +!MESSAGE Error reading last build state for project ch02_TestScore +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:07.650 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:08.597 +!MESSAGE Exception while reading last build state for: P/ch03_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch03_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:08.597 +!MESSAGE Error reading last build state for project ch03_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:08.597 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:09.739 +!MESSAGE Exception while reading last build state for: P/ch04_FutureValue +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch04_FutureValue + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:09.740 +!MESSAGE Error reading last build state for project ch04_FutureValue +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:09.740 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:10.039 +!MESSAGE Exception while reading last build state for: P/ch04_GuessNumber +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch04_GuessNumber + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:10.039 +!MESSAGE Error reading last build state for project ch04_GuessNumber +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:10.039 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:25.680 +!MESSAGE Exception while reading last build state for: P/ch04_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch04_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:25.718 +!MESSAGE Error reading last build state for project ch04_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:25.718 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:27.213 +!MESSAGE Exception while reading last build state for: P/ch05_FutureValueWithMethod +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch05_FutureValueWithMethod + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:27.213 +!MESSAGE Error reading last build state for project ch05_FutureValueWithMethod +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:27.213 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:27.332 +!MESSAGE Exception while reading last build state for: P/ch05_FutureValueWithValidation +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch05_FutureValueWithValidation + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:27.333 +!MESSAGE Error reading last build state for project ch05_FutureValueWithValidation +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:27.333 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:27.964 +!MESSAGE Exception while reading last build state for: P/ch07_LineItem +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch07_LineItem + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:27.965 +!MESSAGE Error reading last build state for project ch07_LineItem +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:27.965 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:29.076 +!MESSAGE Exception while reading last build state for: P/ch07_Product +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch07_Product + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:29.076 +!MESSAGE Error reading last build state for project ch07_Product +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:29.076 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:29.331 +!MESSAGE Exception while reading last build state for: P/ch08_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch08_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:29.331 +!MESSAGE Error reading last build state for project ch08_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:29.331 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:30.669 +!MESSAGE Exception while reading last build state for: P/ch08_NumberCruncher +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch08_NumberCruncher + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:30.669 +!MESSAGE Error reading last build state for project ch08_NumberCruncher +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:30.669 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:30.950 +!MESSAGE Exception while reading last build state for: P/ch09_ProductManager +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch09_ProductManager + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:30.950 +!MESSAGE Error reading last build state for project ch09_ProductManager +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:30.951 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:31.551 +!MESSAGE Exception while reading last build state for: P/ch10_Product +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch10_Product + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:31.551 +!MESSAGE Error reading last build state for project ch10_Product +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:31.551 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:32.407 +!MESSAGE Exception while reading last build state for: P/ch11_LineItem +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch11_LineItem + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:32.408 +!MESSAGE Error reading last build state for project ch11_LineItem +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:32.408 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:33.490 +!MESSAGE Exception while reading last build state for: P/ch12_FutureValue +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch12_FutureValue + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:33.490 +!MESSAGE Error reading last build state for project ch12_FutureValue +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:33.490 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:36.080 +!MESSAGE Exception while reading last build state for: P/ch12_FutureValueValidation +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch12_FutureValueValidation + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:36.080 +!MESSAGE Error reading last build state for project ch12_FutureValueValidation +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:36.080 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:38.449 +!MESSAGE Exception while reading last build state for: P/ch13_SocialMediaSignup +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch13_SocialMediaSignup + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:38.449 +!MESSAGE Error reading last build state for project ch13_SocialMediaSignup +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:38.450 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:45.860 +!MESSAGE Exception while reading last build state for: P/ch14_CreateAccount +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch14_CreateAccount + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:45.860 +!MESSAGE Error reading last build state for project ch14_CreateAccount +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:45.860 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:46.035 +!MESSAGE Exception while reading last build state for: P/ch14_Hangman +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch14_Hangman + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:46.036 +!MESSAGE Error reading last build state for project ch14_Hangman +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:46.036 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:47.068 +!MESSAGE Exception while reading last build state for: P/ch15_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch15_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:47.068 +!MESSAGE Error reading last build state for project ch15_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:47.069 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:47.837 +!MESSAGE Exception while reading last build state for: P/ch15_WordCounter +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch15_WordCounter + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:47.839 +!MESSAGE Error reading last build state for project ch15_WordCounter +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:47.840 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:48.532 +!MESSAGE Exception while reading last build state for: P/ch17_DirectorySearch +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch17_DirectorySearch + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:48.533 +!MESSAGE Error reading last build state for project ch17_DirectorySearch +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:48.533 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:48.777 +!MESSAGE Exception while reading last build state for: P/ch18_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch18_Invoice + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:48.777 +!MESSAGE Error reading last build state for project ch18_Invoice +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:48.777 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) + +!ENTRY org.eclipse.jdt.core 4 4 2021-11-17 09:27:49.612 +!MESSAGE Exception while reading last build state for: P/ch19_ProductManager +!STACK 1 +org.eclipse.core.runtime.CoreException: Error reading last build state for project ch19_ProductManager + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4125) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + ... 15 more +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 1 org.eclipse.jdt.core 4 2 2021-11-17 09:27:49.613 +!MESSAGE Error reading last build state for project ch19_ProductManager +!STACK 1 +org.eclipse.core.runtime.CoreException: Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:80) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +Caused by: java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + ... 20 more +!SUBENTRY 2 org.eclipse.jdt.core 4 0 2021-11-17 09:27:49.615 +!MESSAGE Failed to init ct.sym for /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +!STACK 0 +java.io.FileNotFoundException: File \Library\Java\JavaVirtualMachines\jdk-17.jdk\Contents\Home\lib\ct.sym does not exist + at org.eclipse.jdt.internal.compiler.util.CtSym.init(CtSym.java:127) + at org.eclipse.jdt.internal.compiler.util.CtSym.(CtSym.java:121) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.lambda$1(JRTUtil.java:136) + at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916) + at org.eclipse.jdt.internal.compiler.util.JRTUtil.getCtSym(JRTUtil.java:133) + at org.eclipse.jdt.internal.core.builder.ClasspathJrtWithReleaseOption.(ClasspathJrtWithReleaseOption.java:78) + at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:163) + at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:378) + at org.eclipse.jdt.internal.core.builder.State.read(State.java:266) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161) + at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4117) + at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2263) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:449) + at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:189) + at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281) + at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337) + at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389) + at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410) + at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160) + at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SESSION 2021-11-17 10:27:15.702 ----------------------------------------------- +eclipse.buildId=4.21.0.I20210906-0500 +java.version=16.0.2 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -Dosgi.requiredJavaVersion=11 -Dosgi.instance.area.default=@user.home/eclipse-workspace -Dsun.java.command=Eclipse -XX:+UseG1GC -XX:+UseStringDeduplication --add-modules=ALL-SYSTEM -Dosgi.requiredJavaVersion=11 -Dosgi.dataAreaRequiresExplicitInit=true -Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -Declipse.p2.max.threads=10 -Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest -Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/ + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2021-11-17 10:27:58.766 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '115' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.15.200.v20210816-1658 + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:506) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:170) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:616) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:89) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:276) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:573) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:567) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) + at org.eclipse.equinox.launcher.Main.run(Main.java:1467) + at org.eclipse.equinox.launcher.Main.main(Main.java:1440) + +!ENTRY org.eclipse.jface 2 0 2021-11-17 10:28:04.888 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-11-17 10:28:04.888 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7e89eba7, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6bc25ac2, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2021-11-17 10:28:23.334 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Joel'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:31:32.497 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:400) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:31:32.614 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:31:32.642 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:401) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:31:32.642 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:31:33.306 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationChanged(LaunchManager.java:2128) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:376) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:259) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:229) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:187) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:402) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:31:33.306 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:33:43.667 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:400) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:33:43.667 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:33:43.670 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:401) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:33:43.670 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:33:43.678 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration App references non-existing project ch01_FutureValueGUI. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationChanged(LaunchManager.java:2128) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:376) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:259) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:229) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:187) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:402) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:33:43.678 +!MESSAGE Launch configuration App references non-existing project ch01_FutureValueGUI. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:35:21.370 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:400) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:35:21.370 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:35:21.373 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setDirty(LaunchConfigurationWorkingCopy.java:523) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.setAttribute(LaunchConfigurationWorkingCopy.java:411) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:401) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:35:21.373 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + +!ENTRY org.eclipse.m2e.logback.appender 4 0 2021-11-17 10:35:21.382 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!STACK 1 +org.eclipse.core.runtime.CoreException: Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. + at org.eclipse.jdt.launching.JavaRuntime.abort(JavaRuntime.java:1861) + at org.eclipse.jdt.launching.JavaRuntime.getJavaProject(JavaRuntime.java:1736) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.updateLaunchConfiguration(MavenLaunchConfigurationListener.java:59) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.launchConfigurationChanged(MavenLaunchConfigurationListener.java:46) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.run(LaunchManager.java:225) + at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) + at org.eclipse.debug.internal.core.LaunchManager$ConfigurationNotifier.notify(LaunchManager.java:209) + at org.eclipse.debug.internal.core.LaunchManager.launchConfigurationChanged(LaunchManager.java:2128) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.writeNewFile(LaunchConfigurationWorkingCopy.java:376) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave0(LaunchConfigurationWorkingCopy.java:259) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:229) + at org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy.doSave(LaunchConfigurationWorkingCopy.java:187) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:402) + at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.disable(MavenRuntimeClasspathProvider.java:426) + at org.eclipse.m2e.jdt.internal.launch.MavenLaunchConfigurationListener.mavenProjectChanged(MavenLaunchConfigurationListener.java:130) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:824) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:991) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:149) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:179) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:153) + at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:101) + at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1374) + at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:84) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) +!SUBENTRY 1 org.eclipse.jdt.launching 4 107 2021-11-17 10:35:21.382 +!MESSAGE Launch configuration FutureValueApplication references non-existing project ch13_ex1_FutureValue_sol. +!SESSION 2024-12-26 09:16:15.692 ----------------------------------------------- +eclipse.buildId=4.34.0.20241128-0756 +java.version=23.0.1 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:16:18.386 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:16:55.003 +!MESSAGE Logback config file: C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2024-12-26 09:16:56.169 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '140' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.16.600.v20241008-1401 + at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:562) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:557) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:643) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:88) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:273) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:592) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.ui 4 4 2024-12-26 09:16:56.196 +!MESSAGE Invalid workspace location to be set for Edge browser. +!STACK 0 +java.net.URISyntaxException: Illegal character in path at index 32: file:/C:/Users/Dagostit/OneDrive - The Mental Health Association of Westchester Inc/Documents/Code/java/eclipse/.metadata/.plugins/org.eclipse.swt + at java.base/java.net.URI$Parser.fail(URI.java:2995) + at java.base/java.net.URI$Parser.checkChars(URI.java:3166) + at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) + at java.base/java.net.URI$Parser.parse(URI.java:3196) + at java.base/java.net.URI.(URI.java:645) + at java.base/java.net.URL.toURI(URL.java:1220) + at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530) + at org.eclipse.ui.internal.Workbench.(Workbench.java:461) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.egit.ui 2 0 2024-12-26 09:16:59.340 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Dagostit'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2024-12-26 09:16:59.392 +!MESSAGE Removing PartDescriptorImpl with the "org.eclipse.search.SearchResultView" id and the "Classic Search" label.It points to the non available "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2024-12-26 09:16:59.396 +!MESSAGE Removing PartDescriptorImpl with the "org.eclipse.ui.views.ResourceNavigator" id and the "Navigator (Deprecated)" label.It points to the non available "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2024-12-26 09:16:59.398 +!MESSAGE Removing PartDescriptorImpl with the "org.eclipse.wst.xml.ui.views.annotations.XMLAnnotationsView" id and the "Documentation" label.It points to the non available "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.e4.ui.workbench 2 0 2024-12-26 09:16:59.399 +!MESSAGE Removing PartDescriptorImpl with the "org.eclipse.wst.xml.ui.contentmodel.view" id and the "Content Model" label.It points to the non available "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" class. Bundle might have been uninstalled + +!ENTRY org.eclipse.oomph.setup.ui 1 0 2024-12-26 09:17:06.563 +!MESSAGE Setup tasks were performed during startup updating 5 preferences. See 'C:\Users\Dagostit\eclipse\java-2024-12\eclipse\configuration\org.eclipse.oomph.setup\setup.log' for details +!SESSION 2024-12-26 09:17:50.807 ----------------------------------------------- +eclipse.buildId=4.34.0.20241128-0756 +java.version=23.0.1 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:17:53.315 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 09:17:54.386 +!MESSAGE Logback config file: C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2024-12-26 09:17:55.290 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '140' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.16.600.v20241008-1401 + at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:562) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:557) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:643) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:88) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:273) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:592) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.ui 4 4 2024-12-26 09:17:55.312 +!MESSAGE Invalid workspace location to be set for Edge browser. +!STACK 0 +java.net.URISyntaxException: Illegal character in path at index 32: file:/C:/Users/Dagostit/OneDrive - The Mental Health Association of Westchester Inc/Documents/Code/java/eclipse/.metadata/.plugins/org.eclipse.swt + at java.base/java.net.URI$Parser.fail(URI.java:2995) + at java.base/java.net.URI$Parser.checkChars(URI.java:3166) + at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) + at java.base/java.net.URI$Parser.parse(URI.java:3196) + at java.base/java.net.URI.(URI.java:645) + at java.base/java.net.URL.toURI(URL.java:1220) + at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530) + at org.eclipse.ui.internal.Workbench.(Workbench.java:461) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.egit.ui 2 0 2024-12-26 09:17:58.216 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Dagostit'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2024-12-26 12:10:08.730 ----------------------------------------------- +eclipse.buildId=4.34.0.20241128-0756 +java.version=23.0.1 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.java.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 12:10:10.515 +!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized. + +!ENTRY ch.qos.logback.classic 1 0 2024-12-26 12:10:11.824 +!MESSAGE Logback config file: C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.7.0.20241001-1350.xml + +!ENTRY org.eclipse.e4.ui.workbench 4 0 2024-12-26 12:10:12.603 +!MESSAGE Unable to load class 'org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler' from bundle '140' +!STACK 0 +java.lang.ClassNotFoundException: org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler cannot be found by org.eclipse.e4.ui.workbench.renderers.swt_0.16.600.v20241008-1401 + at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:562) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:557) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174) + at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528) + at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:643) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:88) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) + at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:37) + at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:273) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:592) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.ui 4 4 2024-12-26 12:10:12.620 +!MESSAGE Invalid workspace location to be set for Edge browser. +!STACK 0 +java.net.URISyntaxException: Illegal character in path at index 32: file:/C:/Users/Dagostit/OneDrive - The Mental Health Association of Westchester Inc/Documents/Code/java/eclipse/.metadata/.plugins/org.eclipse.swt + at java.base/java.net.URI$Parser.fail(URI.java:2995) + at java.base/java.net.URI$Parser.checkChars(URI.java:3166) + at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248) + at java.base/java.net.URI$Parser.parse(URI.java:3196) + at java.base/java.net.URI.(URI.java:645) + at java.base/java.net.URL.toURI(URL.java:1220) + at org.eclipse.ui.internal.Workbench.setEdgeDataDirectory(Workbench.java:530) + at org.eclipse.ui.internal.Workbench.(Workbench.java:461) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:598) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:570) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:178) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) + at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) + at java.base/java.lang.reflect.Method.invoke(Method.java:580) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) + at org.eclipse.equinox.launcher.Main.run(Main.java:1481) + +!ENTRY org.eclipse.egit.ui 2 0 2024-12-26 12:10:16.947 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\Dagostit'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/murach/eclipse/.metadata/.mylyn/repositories.xml.zip b/murach/eclipse/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000..70d6195 Binary files /dev/null and b/murach/eclipse/.metadata/.mylyn/repositories.xml.zip differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.buildship.core/gradle/versions.json b/murach/eclipse/.metadata/.plugins/org.eclipse.buildship.core/gradle/versions.json new file mode 100644 index 0000000..f67aba7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.buildship.core/gradle/versions.json @@ -0,0 +1,5788 @@ +[ { + "version" : "8.13-20241225002435+0000", + "buildTime" : "20241225002435+0000", + "current" : false, + "snapshot" : true, + "nightly" : true, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.13-20241225002435+0000-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.13-20241225002435+0000-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.13-20241225002435+0000-wrapper.jar.sha256" +}, { + "version" : "8.12", + "buildTime" : "20241220154653+0000", + "current" : true, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.12-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-wrapper.jar.sha256" +}, { + "version" : "8.12-rc-2", + "buildTime" : "20241217162852+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.12", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.12-20241214011652+0000", + "buildTime" : "20241214011652+0000", + "current" : false, + "snapshot" : true, + "nightly" : false, + "releaseNightly" : true, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.12-20241214011652+0000-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.12-20241214011652+0000-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions-snapshots/gradle-8.12-20241214011652+0000-wrapper.jar.sha256" +}, { + "version" : "8.12-rc-1", + "buildTime" : "20241212152352+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.12", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.12-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.11.1", + "buildTime" : "20241120165646+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11.1-wrapper.jar.sha256" +}, { + "version" : "8.11", + "buildTime" : "20241111135801+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-wrapper.jar.sha256" +}, { + "version" : "8.11-rc-3", + "buildTime" : "20241107134628+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.11-rc-2", + "buildTime" : "20241031150259+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.11-rc-1", + "buildTime" : "20241017104024+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.11-milestone-1", + "buildTime" : "20241006083426+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.11", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.11-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.11-milestone-1-wrapper.jar.sha256" +}, { + "version" : "8.10.2", + "buildTime" : "20240923212839+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-wrapper.jar.sha256" +}, { + "version" : "8.10.2-milestone-1", + "buildTime" : "20240919234735+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.10.2", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.2-milestone-1-wrapper.jar.sha256" +}, { + "version" : "8.10.1", + "buildTime" : "20240909074256+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.10.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.10.1-wrapper.jar.sha256" +}, { + "version" : "8.10", + "buildTime" : "20240814110745+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.10-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.10-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.10-wrapper.jar.sha256" +}, { + "version" : "8.10-rc-1", + "buildTime" : "20240808060755+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.10-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.10-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.10-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.9", + "buildTime" : "20240711143741+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-wrapper.jar.sha256" +}, { + "version" : "8.9-rc-2", + "buildTime" : "20240705153825+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.9-rc-1", + "buildTime" : "20240621131308+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.9-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.8", + "buildTime" : "20240531214656+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-wrapper.jar.sha256" +}, { + "version" : "8.8-rc-2", + "buildTime" : "20240527070937+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.8-rc-1", + "buildTime" : "20240426151958+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.8-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.7", + "buildTime" : "20240322155246+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-wrapper.jar.sha256" +}, { + "version" : "8.7-rc-4", + "buildTime" : "20240320140334+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.7-rc-3", + "buildTime" : "20240311171310+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.7-rc-2", + "buildTime" : "20240229125337+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.7-rc-1", + "buildTime" : "20240222213949+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.7-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.6.4", + "buildTime" : "20240205142918+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.4-wrapper.jar.sha256" +}, { + "version" : "8.6", + "buildTime" : "20240202164716+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-wrapper.jar.sha256" +}, { + "version" : "8.6-rc-4", + "buildTime" : "20240131130628+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.6-rc-3", + "buildTime" : "20240123150619+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.6-rc-2", + "buildTime" : "20240112144903+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.6-rc-1", + "buildTime" : "20231228064048+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.6-milestone-1", + "buildTime" : "20231208093905+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.6", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.6-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.6-milestone-1-wrapper.jar.sha256" +}, { + "version" : "8.5", + "buildTime" : "20231129140857+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-wrapper.jar.sha256" +}, { + "version" : "8.5-rc-4", + "buildTime" : "20231124091900+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.5-rc-3", + "buildTime" : "20231117134310+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.5-rc-2", + "buildTime" : "20231114141630+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.5-rc-1", + "buildTime" : "20231107155056+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.5-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.4", + "buildTime" : "20231004205213+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-wrapper.jar.sha256" +}, { + "version" : "7.6.3", + "buildTime" : "20231004155947+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.3-wrapper.jar.sha256" +}, { + "version" : "8.4-rc-3", + "buildTime" : "20230929135700+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.4-rc-2", + "buildTime" : "20230926114721+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.4-rc-1", + "buildTime" : "20230920065917+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.4-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.3", + "buildTime" : "20230817070647+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-wrapper.jar.sha256" +}, { + "version" : "8.3-rc-4", + "buildTime" : "20230814082841+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.3-rc-3", + "buildTime" : "20230802172145+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.3-rc-2", + "buildTime" : "20230726152039+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.3-rc-1", + "buildTime" : "20230719075404+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.3-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.2.1", + "buildTime" : "20230710121235+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2.1-wrapper.jar.sha256" +}, { + "version" : "8.2", + "buildTime" : "20230630180230+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-wrapper.jar.sha256" +}, { + "version" : "7.6.2", + "buildTime" : "20230630154251+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.2-wrapper.jar.sha256" +}, { + "version" : "8.2-rc-3", + "buildTime" : "20230628070204+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.2-rc-2", + "buildTime" : "20230606183136+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.2-rc-1", + "buildTime" : "20230531181205+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.2-milestone-1", + "buildTime" : "20230426164225+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.2", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.2-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.2-milestone-1-wrapper.jar.sha256" +}, { + "version" : "8.1.1", + "buildTime" : "20230421123126+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1.1-wrapper.jar.sha256" +}, { + "version" : "8.1", + "buildTime" : "20230412120745+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-wrapper.jar.sha256" +}, { + "version" : "8.1-rc-4", + "buildTime" : "20230411093751+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.1-rc-3", + "buildTime" : "20230404095841+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.1-rc-2", + "buildTime" : "20230329080943+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.1-rc-1", + "buildTime" : "20230320143921+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.1-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.0.2", + "buildTime" : "20230303164137+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0.2-wrapper.jar.sha256" +}, { + "version" : "7.6.1", + "buildTime" : "20230224135442+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6.1-wrapper.jar.sha256" +}, { + "version" : "6.9.4", + "buildTime" : "20230222084312+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.4-wrapper.jar.sha256" +}, { + "version" : "8.0.1", + "buildTime" : "20230217200948+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0.1-wrapper.jar.sha256" +}, { + "version" : "8.0", + "buildTime" : "20230213131521+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-wrapper.jar.sha256" +}, { + "version" : "8.0-rc-5", + "buildTime" : "20230209233943+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-5-wrapper.jar.sha256" +}, { + "version" : "8.0-rc-4", + "buildTime" : "20230209172637+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-4-wrapper.jar.sha256" +}, { + "version" : "8.0-rc-3", + "buildTime" : "20230206094910+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-3-wrapper.jar.sha256" +}, { + "version" : "8.0-rc-2", + "buildTime" : "20230117102518+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.0-rc-1", + "buildTime" : "20221229123250+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "8.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-rc-1-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-6", + "buildTime" : "20221220081158+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-6-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-5", + "buildTime" : "20221208181122+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-5-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-4", + "buildTime" : "20221201090656+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-4-wrapper.jar.sha256" +}, { + "version" : "7.6", + "buildTime" : "20221125133510+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-wrapper.jar.sha256" +}, { + "version" : "7.6-rc-4", + "buildTime" : "20221122094210+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-4-wrapper.jar.sha256" +}, { + "version" : "7.6-rc-3", + "buildTime" : "20221111142340+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-3-wrapper.jar.sha256" +}, { + "version" : "7.6-rc-2", + "buildTime" : "20221108130606+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-2-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-3", + "buildTime" : "20221028140616+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-3-wrapper.jar.sha256" +}, { + "version" : "7.6-rc-1", + "buildTime" : "20221028075211+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.9.3", + "buildTime" : "20221017074402+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.3-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-2", + "buildTime" : "20221009102113+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-2-wrapper.jar.sha256" +}, { + "version" : "8.0-milestone-1", + "buildTime" : "20220923110128+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "8.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-8.0-milestone-1-wrapper.jar.sha256" +}, { + "version" : "7.6-milestone-1", + "buildTime" : "20220923093944+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "7.6", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.6-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.6-milestone-1-wrapper.jar.sha256" +}, { + "version" : "7.5.1", + "buildTime" : "20220805211756+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5.1-wrapper.jar.sha256" +}, { + "version" : "7.5", + "buildTime" : "20220714124815+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-wrapper.jar.sha256" +}, { + "version" : "7.5-rc-5", + "buildTime" : "20220712114039+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-5-wrapper.jar.sha256" +}, { + "version" : "7.5-rc-4", + "buildTime" : "20220706171202+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-4-wrapper.jar.sha256" +}, { + "version" : "7.5-rc-3", + "buildTime" : "20220629120328+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-3-wrapper.jar.sha256" +}, { + "version" : "7.5-rc-2", + "buildTime" : "20220610165005+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.5-rc-1", + "buildTime" : "20220512190923+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.5-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.4.2", + "buildTime" : "20220331152529+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.4.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.4.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.4.2-wrapper.jar.sha256" +}, { + "version" : "7.4.1", + "buildTime" : "20220309150447+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.4.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.4.1-wrapper.jar.sha256" +}, { + "version" : "7.4", + "buildTime" : "20220208095838+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-wrapper.jar.sha256" +}, { + "version" : "7.4-rc-2", + "buildTime" : "20220202150044+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.4-rc-1", + "buildTime" : "20220117201507+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.4-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.3.3", + "buildTime" : "20211222123754+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-wrapper.jar.sha256" +}, { + "version" : "7.3.3-rc-1", + "buildTime" : "20211222090657+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.3-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.9.2", + "buildTime" : "20211221172537+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.2-wrapper.jar.sha256" +}, { + "version" : "7.3.2", + "buildTime" : "20211215112231+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.2-wrapper.jar.sha256" +}, { + "version" : "7.3.1", + "buildTime" : "20211201154220+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3.1-wrapper.jar.sha256" +}, { + "version" : "7.3", + "buildTime" : "20211109204036+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-wrapper.jar.sha256" +}, { + "version" : "7.3-rc-5", + "buildTime" : "20211105184337+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-5-wrapper.jar.sha256" +}, { + "version" : "7.3-rc-4", + "buildTime" : "20211105160540+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-4-wrapper.jar.sha256" +}, { + "version" : "7.3-rc-3", + "buildTime" : "20211026162420+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-3-wrapper.jar.sha256" +}, { + "version" : "7.3-rc-2", + "buildTime" : "20211020220023+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.3-rc-1", + "buildTime" : "20211012072418+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.3-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.9.1", + "buildTime" : "20210820111518+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9.1-wrapper.jar.sha256" +}, { + "version" : "7.2", + "buildTime" : "20210817095903+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-wrapper.jar.sha256" +}, { + "version" : "7.2-rc-3", + "buildTime" : "20210812075909+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-3-wrapper.jar.sha256" +}, { + "version" : "7.2-rc-2", + "buildTime" : "20210805122137+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.2-rc-1", + "buildTime" : "20210729075128+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.2-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.1.1", + "buildTime" : "20210702121643+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.1.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.1.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.1.1-wrapper.jar.sha256" +}, { + "version" : "7.1", + "buildTime" : "20210614144726+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-wrapper.jar.sha256" +}, { + "version" : "7.1-rc-2", + "buildTime" : "20210608153520+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.1-rc-1", + "buildTime" : "20210531095845+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.1-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.0.2", + "buildTime" : "20210514120231+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0.2-wrapper.jar.sha256" +}, { + "version" : "7.0.1", + "buildTime" : "20210510160858+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0.1-wrapper.jar.sha256" +}, { + "version" : "6.9", + "buildTime" : "20210507072853+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-wrapper.jar.sha256" +}, { + "version" : "6.9-rc-2", + "buildTime" : "20210505141217+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.9-rc-1", + "buildTime" : "20210427125445+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.9-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.0", + "buildTime" : "20210409222731+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-wrapper.jar.sha256" +}, { + "version" : "7.0-rc-2", + "buildTime" : "20210401212639+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-2-wrapper.jar.sha256" +}, { + "version" : "7.0-rc-1", + "buildTime" : "20210323010230+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "7.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-rc-1-wrapper.jar.sha256" +}, { + "version" : "7.0-milestone-3", + "buildTime" : "20210313010321+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "7.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-3-wrapper.jar.sha256" +}, { + "version" : "7.0-milestone-2", + "buildTime" : "20210223230254+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "7.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-2-wrapper.jar.sha256" +}, { + "version" : "6.8.3", + "buildTime" : "20210222161328+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.3-wrapper.jar.sha256" +}, { + "version" : "6.8.2", + "buildTime" : "20210205125300+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.2-wrapper.jar.sha256" +}, { + "version" : "7.0-milestone-1", + "buildTime" : "20210203220023+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "7.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-7.0-milestone-1-wrapper.jar.sha256" +}, { + "version" : "6.8.1", + "buildTime" : "20210122132008+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8.1-wrapper.jar.sha256" +}, { + "version" : "6.8", + "buildTime" : "20210108163846+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-wrapper.jar.sha256" +}, { + "version" : "6.8-rc-5", + "buildTime" : "20210104202203+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-5-wrapper.jar.sha256" +}, { + "version" : "6.8-rc-4", + "buildTime" : "20201222084410+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-4-wrapper.jar.sha256" +}, { + "version" : "6.8-rc-3", + "buildTime" : "20201217142452+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.8-rc-1", + "buildTime" : "20201126092543+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.7.1", + "buildTime" : "20201116170924+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7.1-wrapper.jar.sha256" +}, { + "version" : "6.8-milestone-3", + "buildTime" : "20201115200053+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.8", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-3-wrapper.jar.sha256" +}, { + "version" : "6.8-milestone-2", + "buildTime" : "20201028055518+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.8", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-2-wrapper.jar.sha256" +}, { + "version" : "6.7", + "buildTime" : "20201014161312+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-wrapper.jar.sha256" +}, { + "version" : "6.8-milestone-1", + "buildTime" : "20201013065906+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.8", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.8-milestone-1-wrapper.jar.sha256" +}, { + "version" : "6.7-rc-5", + "buildTime" : "20201012190940+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-5-wrapper.jar.sha256" +}, { + "version" : "6.7-rc-4", + "buildTime" : "20201008165738+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-4-wrapper.jar.sha256" +}, { + "version" : "6.7-rc-3", + "buildTime" : "20200930191651+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.7-rc-2", + "buildTime" : "20200925201444+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.7-rc-1", + "buildTime" : "20200911161705+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.7-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.6.1", + "buildTime" : "20200825162912+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6.1-wrapper.jar.sha256" +}, { + "version" : "6.6", + "buildTime" : "20200810220619+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-6", + "buildTime" : "20200805195744+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-6-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-5", + "buildTime" : "20200803185444+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-5-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-4", + "buildTime" : "20200730144824+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-4-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-3", + "buildTime" : "20200724140409+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-2", + "buildTime" : "20200720214344+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.6-rc-1", + "buildTime" : "20200713135325+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.6-milestone-3", + "buildTime" : "20200707160951+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.6", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-3-wrapper.jar.sha256" +}, { + "version" : "6.5.1", + "buildTime" : "20200630063247+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.5.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.5.1-wrapper.jar.sha256" +}, { + "version" : "6.6-milestone-2", + "buildTime" : "20200623122834+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.6", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-2-wrapper.jar.sha256" +}, { + "version" : "6.6-milestone-1", + "buildTime" : "20200611202418+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.6", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.6-milestone-1-wrapper.jar.sha256" +}, { + "version" : "6.5", + "buildTime" : "20200602204621+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-wrapper.jar.sha256" +}, { + "version" : "6.5-rc-1", + "buildTime" : "20200526200448+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.4.1", + "buildTime" : "20200515194340+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4.1-wrapper.jar.sha256" +}, { + "version" : "6.5-milestone-2", + "buildTime" : "20200515094006+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.5", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-2-wrapper.jar.sha256" +}, { + "version" : "6.5-milestone-1", + "buildTime" : "20200507135506+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.5", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.5-milestone-1-wrapper.jar.sha256" +}, { + "version" : "6.4", + "buildTime" : "20200505191855+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-wrapper.jar.sha256" +}, { + "version" : "6.4-rc-4", + "buildTime" : "20200430212330+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-4-wrapper.jar.sha256" +}, { + "version" : "6.4-rc-3", + "buildTime" : "20200428190039+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.4-rc-2", + "buildTime" : "20200422163205+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.4-rc-1", + "buildTime" : "20200415202839+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.4-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.3", + "buildTime" : "20200324195207+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-wrapper.jar.sha256" +}, { + "version" : "6.3-rc-4", + "buildTime" : "20200320053945+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-4-wrapper.jar.sha256" +}, { + "version" : "6.3-rc-3", + "buildTime" : "20200318152649+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.3-rc-2", + "buildTime" : "20200317124036+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.3-rc-1", + "buildTime" : "20200311214114+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.3-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.2.2", + "buildTime" : "20200304084931+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2.2-wrapper.jar.sha256" +}, { + "version" : "6.2.1", + "buildTime" : "20200224202410+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2.1-wrapper.jar.sha256" +}, { + "version" : "6.2", + "buildTime" : "20200217083201+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-wrapper.jar.sha256" +}, { + "version" : "6.2-rc-3", + "buildTime" : "20200213012914+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.2-rc-2", + "buildTime" : "20200211221400+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.2-rc-1", + "buildTime" : "20200203123003+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.2-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.1.1", + "buildTime" : "20200124223024+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1.1-wrapper.jar.sha256" +}, { + "version" : "6.1", + "buildTime" : "20200115235646+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-wrapper.jar.sha256" +}, { + "version" : "6.1-rc-3", + "buildTime" : "20200113162324+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-3-wrapper.jar.sha256" +}, { + "version" : "6.1-rc-2", + "buildTime" : "20200107211705+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.1-rc-1", + "buildTime" : "20191219215643+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-rc-1-wrapper.jar.sha256" +}, { + "version" : "6.1-milestone-3", + "buildTime" : "20191203141333+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.1", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-3-wrapper.jar.sha256" +}, { + "version" : "6.1-milestone-2", + "buildTime" : "20191128101755+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.1", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-2-wrapper.jar.sha256" +}, { + "version" : "6.1-milestone-1", + "buildTime" : "20191120132405+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "6.1", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.1-milestone-1-wrapper.jar.sha256" +}, { + "version" : "6.0.1", + "buildTime" : "20191118202501+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.0.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.0.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.0.1-wrapper.jar.sha256" +}, { + "version" : "6.0", + "buildTime" : "20191108181212+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-wrapper.jar.sha256" +}, { + "version" : "6.0-rc-3", + "buildTime" : "20191105175639+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-3-wrapper.jar.sha256" +}, { + "version" : "5.6.4", + "buildTime" : "20191101204200+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.4-wrapper.jar.sha256" +}, { + "version" : "6.0-rc-2", + "buildTime" : "20191030160321+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-2-wrapper.jar.sha256" +}, { + "version" : "6.0-rc-1", + "buildTime" : "20191018192416+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "6.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-6.0-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.6.3", + "buildTime" : "20191018002836+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.3-wrapper.jar.sha256" +}, { + "version" : "5.6.2", + "buildTime" : "20190905161354+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.2-wrapper.jar.sha256" +}, { + "version" : "5.6.1", + "buildTime" : "20190828024934+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6.1-wrapper.jar.sha256" +}, { + "version" : "5.6", + "buildTime" : "20190814210525+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-wrapper.jar.sha256" +}, { + "version" : "5.6-rc-2", + "buildTime" : "20190807150342+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-2-wrapper.jar.sha256" +}, { + "version" : "5.6-rc-1", + "buildTime" : "20190729112626+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.6-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.5.1", + "buildTime" : "20190710203812+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5.1-wrapper.jar.sha256" +}, { + "version" : "5.5", + "buildTime" : "20190628173605+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-wrapper.jar.sha256" +}, { + "version" : "5.5-rc-4", + "buildTime" : "20190624152432+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-4-wrapper.jar.sha256" +}, { + "version" : "5.5-rc-3", + "buildTime" : "20190614231538+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-3-wrapper.jar.sha256" +}, { + "version" : "5.5-rc-2", + "buildTime" : "20190607090657+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-2-wrapper.jar.sha256" +}, { + "version" : "5.5-rc-1", + "buildTime" : "20190529115119+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.5-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.4.1", + "buildTime" : "20190426081442+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.4.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.4.1-wrapper.jar.sha256" +}, { + "version" : "5.4", + "buildTime" : "20190416024416+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.4-wrapper.jar.sha256" +}, { + "version" : "5.4-rc-1", + "buildTime" : "20190410011532+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.4-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.4-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.3.1", + "buildTime" : "20190328090923+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.3.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.3.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.3.1-wrapper.jar.sha256" +}, { + "version" : "5.3", + "buildTime" : "20190320110329+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-wrapper.jar.sha256" +}, { + "version" : "5.3-rc-3", + "buildTime" : "20190313202708+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-3-wrapper.jar.sha256" +}, { + "version" : "5.3-rc-2", + "buildTime" : "20190311210726+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-2-wrapper.jar.sha256" +}, { + "version" : "5.3-rc-1", + "buildTime" : "20190305205202+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.3-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.2.1", + "buildTime" : "20190208190010+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.2.1-wrapper.jar.sha256" +}, { + "version" : "5.2", + "buildTime" : "20190204111648+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.2-wrapper.jar.sha256" +}, { + "version" : "5.2-rc-1", + "buildTime" : "20190128225604+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.2-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.2-rc-1-wrapper.jar.sha256" +}, { + "version" : "5.1.1", + "buildTime" : "20190110230502+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1.1-wrapper.jar.sha256" +}, { + "version" : "5.1", + "buildTime" : "20190102185747+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-wrapper.jar.sha256" +}, { + "version" : "5.1-rc-3", + "buildTime" : "20181221230345+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-3-wrapper.jar.sha256" +}, { + "version" : "5.1-rc-2", + "buildTime" : "20181217224201+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-2-wrapper.jar.sha256" +}, { + "version" : "5.1-rc-1", + "buildTime" : "20181213060004+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-rc-1-wrapper.jar.sha256" +}, { + "version" : "4.10.3", + "buildTime" : "20181205005054+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.3-wrapper.jar.sha256" +}, { + "version" : "5.1-milestone-1", + "buildTime" : "20181203174147+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "5.1", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.1-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-milestone-1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.1-milestone-1-wrapper.jar.sha256" +}, { + "version" : "5.0", + "buildTime" : "20181126114843+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-wrapper.jar.sha256" +}, { + "version" : "5.0-rc-5", + "buildTime" : "20181122195845+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-5-bin.zip.sha256" +}, { + "version" : "5.0-rc-4", + "buildTime" : "20181120092642+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-4-bin.zip.sha256" +}, { + "version" : "5.0-rc-3", + "buildTime" : "20181114160147+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-3-bin.zip.sha256" +}, { + "version" : "5.0-rc-2", + "buildTime" : "20181112080541+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-2-bin.zip.sha256" +}, { + "version" : "5.0-rc-1", + "buildTime" : "20181030135922+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "5.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-rc-1-bin.zip.sha256" +}, { + "version" : "5.0-milestone-1", + "buildTime" : "20181002224615+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "5.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-5.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-5.0-milestone-1-bin.zip.sha256" +}, { + "version" : "4.10.2", + "buildTime" : "20180919181015+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.2-wrapper.jar.sha256" +}, { + "version" : "4.10.1", + "buildTime" : "20180912113327+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.10.1-wrapper.jar.sha256" +}, { + "version" : "4.10", + "buildTime" : "20180827183506+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.10-wrapper.jar.sha256" +}, { + "version" : "4.10-rc-3", + "buildTime" : "20180823120756+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-3-bin.zip.sha256" +}, { + "version" : "4.10-rc-2", + "buildTime" : "20180814180001+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-2-bin.zip.sha256" +}, { + "version" : "4.10-rc-1", + "buildTime" : "20180809061937+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.10-rc-1-bin.zip.sha256" +}, { + "version" : "4.9", + "buildTime" : "20180716081403+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.9-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.9-wrapper.jar.sha256" +}, { + "version" : "4.9-rc-2", + "buildTime" : "20180711004640+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.9-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.9-rc-2-bin.zip.sha256" +}, { + "version" : "4.9-rc-1", + "buildTime" : "20180703131446+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.9-rc-1-bin.zip.sha256" +}, { + "version" : "4.8.1", + "buildTime" : "20180621075306+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.8.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.8.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.8.1-wrapper.jar.sha256" +}, { + "version" : "4.8", + "buildTime" : "20180604103958+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.8-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.8-wrapper.jar.sha256" +}, { + "version" : "4.8-rc-3", + "buildTime" : "20180531140436+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-3-bin.zip.sha256" +}, { + "version" : "4.8-rc-2", + "buildTime" : "20180524092821+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-2-bin.zip.sha256" +}, { + "version" : "4.8-rc-1", + "buildTime" : "20180515173233+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.8-rc-1-bin.zip.sha256" +}, { + "version" : "4.7", + "buildTime" : "20180418090912+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.7-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.7-wrapper.jar.sha256" +}, { + "version" : "4.7-rc-2", + "buildTime" : "20180413125323+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.7-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.7-rc-2-bin.zip.sha256" +}, { + "version" : "4.7-rc-1", + "buildTime" : "20180403113602+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.7-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.7-rc-1-bin.zip.sha256" +}, { + "version" : "4.6", + "buildTime" : "20180228133636+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.6-wrapper.jar.sha256" +}, { + "version" : "4.6-rc-2", + "buildTime" : "20180221152842+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.6-rc-2-bin.zip.sha256" +}, { + "version" : "4.6-rc-1", + "buildTime" : "20180216162807+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.6-rc-1-bin.zip.sha256" +}, { + "version" : "4.5.1", + "buildTime" : "20180205132249+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.5.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.5.1-wrapper.jar.sha256" +}, { + "version" : "4.5", + "buildTime" : "20180124170452+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.5-wrapper.jar.sha256" +}, { + "version" : "4.5-rc-2", + "buildTime" : "20180122164244+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.5-rc-2-bin.zip.sha256" +}, { + "version" : "4.5-rc-1", + "buildTime" : "20180109010527+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.5-rc-1-bin.zip.sha256" +}, { + "version" : "4.4.1", + "buildTime" : "20171220154523+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.4.1-wrapper.jar.sha256" +}, { + "version" : "4.4", + "buildTime" : "20171206090506+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-wrapper.jar.sha256" +}, { + "version" : "4.4-rc-6", + "buildTime" : "20171204084815+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-6-bin.zip.sha256" +}, { + "version" : "4.4-rc-5", + "buildTime" : "20171130152137+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-5-bin.zip.sha256" +}, { + "version" : "4.4-rc-4", + "buildTime" : "20171128123659+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-4-bin.zip.sha256" +}, { + "version" : "4.4-rc-3", + "buildTime" : "20171127103138+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-3-bin.zip.sha256" +}, { + "version" : "4.4-rc-2", + "buildTime" : "20171124103528+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-2-bin.zip.sha256" +}, { + "version" : "4.4-rc-1", + "buildTime" : "20171121153105+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.4-rc-1-bin.zip.sha256" +}, { + "version" : "4.3.1", + "buildTime" : "20171108085945+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.3.1-wrapper.jar.sha256" +}, { + "version" : "4.3", + "buildTime" : "20171030154329+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-wrapper.jar.sha256" +}, { + "version" : "4.3-rc-4", + "buildTime" : "20171026162557+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-4-bin.zip.sha256" +}, { + "version" : "4.3-rc-3", + "buildTime" : "20171024142633+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-3-bin.zip.sha256" +}, { + "version" : "4.3-rc-2", + "buildTime" : "20171018073714+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-2-bin.zip.sha256" +}, { + "version" : "4.3-rc-1", + "buildTime" : "20171012161416+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.3-rc-1-bin.zip.sha256" +}, { + "version" : "4.2.1", + "buildTime" : "20171002153621+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.2.1-wrapper.jar.sha256" +}, { + "version" : "4.2", + "buildTime" : "20170920144823+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.2-wrapper.jar.sha256" +}, { + "version" : "4.2-rc-2", + "buildTime" : "20170913122310+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.2-rc-2-bin.zip.sha256" +}, { + "version" : "4.2-rc-1", + "buildTime" : "20170907081216+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.2-rc-1-bin.zip.sha256" +}, { + "version" : "4.1", + "buildTime" : "20170807143848+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-4.1-wrapper.jar.sha256" +}, { + "version" : "4.1-rc-2", + "buildTime" : "20170731142943+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.1-rc-2-bin.zip.sha256" +}, { + "version" : "4.0.2", + "buildTime" : "20170726161918+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0.2-bin.zip.sha256" +}, { + "version" : "4.1-rc-1", + "buildTime" : "20170720152215+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.1-rc-1-bin.zip.sha256" +}, { + "version" : "4.0.1", + "buildTime" : "20170707140241+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0.1-bin.zip.sha256" +}, { + "version" : "4.1-milestone-1", + "buildTime" : "20170620170546+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "4.1", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.1-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.1-milestone-1-bin.zip.sha256" +}, { + "version" : "3.5.1", + "buildTime" : "20170616143627+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.5.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.5.1-bin.zip.sha256" +}, { + "version" : "4.0", + "buildTime" : "20170614151108+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-bin.zip.sha256" +}, { + "version" : "4.0-rc-3", + "buildTime" : "20170612150444+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-3-bin.zip.sha256" +}, { + "version" : "4.0-rc-2", + "buildTime" : "20170607152236+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-2-bin.zip.sha256" +}, { + "version" : "4.0-rc-1", + "buildTime" : "20170530162617+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "4.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-rc-1-bin.zip.sha256" +}, { + "version" : "4.0-milestone-2", + "buildTime" : "20170517143324+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "4.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-milestone-2-bin.zip.sha256" +}, { + "version" : "4.0-milestone-1", + "buildTime" : "20170428074509+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "4.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-4.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-4.0-milestone-1-bin.zip.sha256" +}, { + "version" : "3.5", + "buildTime" : "20170410133725+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.5-bin.zip.sha256" +}, { + "version" : "3.5-rc-3", + "buildTime" : "20170404150413+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-3-bin.zip.sha256" +}, { + "version" : "3.5-rc-2", + "buildTime" : "20170327155623+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-2-bin.zip.sha256" +}, { + "version" : "3.5-rc-1", + "buildTime" : "20170322151607+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.5-rc-1-bin.zip.sha256" +}, { + "version" : "3.4.1", + "buildTime" : "20170303194541+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.4.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.4.1-bin.zip.sha256" +}, { + "version" : "3.4", + "buildTime" : "20170220144926+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.4-bin.zip.sha256" +}, { + "version" : "3.4-rc-3", + "buildTime" : "20170213145527+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-3-bin.zip.sha256" +}, { + "version" : "3.4-rc-2", + "buildTime" : "20170206211728+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-2-bin.zip.sha256" +}, { + "version" : "3.4-rc-1", + "buildTime" : "20170126154849+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.4-rc-1-bin.zip.sha256" +}, { + "version" : "3.3", + "buildTime" : "20170103153104+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.3-bin.zip.sha256" +}, { + "version" : "3.3-rc-1", + "buildTime" : "20161219160724+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.3-rc-1-bin.zip.sha256" +}, { + "version" : "3.2.1", + "buildTime" : "20161122151954+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-3.2.1-wrapper.jar.sha256" +}, { + "version" : "3.2", + "buildTime" : "20161114123259+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-3.2-wrapper.jar.sha256" +}, { + "version" : "3.2-rc-3", + "buildTime" : "20161107153233+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-3-bin.zip.sha256" +}, { + "version" : "3.2-rc-2", + "buildTime" : "20161031160822+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-2-bin.zip.sha256" +}, { + "version" : "3.2-rc-1", + "buildTime" : "20161024194725+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.2-rc-1-bin.zip.sha256" +}, { + "version" : "3.1", + "buildTime" : "20160919105353+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-3.1-wrapper.jar.sha256" +}, { + "version" : "3.1-rc-1", + "buildTime" : "20160912123424+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.1-rc-1-bin.zip.sha256" +}, { + "version" : "3.0", + "buildTime" : "20160815131501+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-wrapper.jar.sha256" +}, { + "version" : "3.0-rc-2", + "buildTime" : "20160808133410+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-rc-2-bin.zip.sha256" +}, { + "version" : "3.0-rc-1", + "buildTime" : "20160802061335+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "3.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-rc-1-bin.zip.sha256" +}, { + "version" : "2.14.1", + "buildTime" : "20160718063837+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-wrapper.jar.sha256" +}, { + "version" : "2.14.1-rc-2", + "buildTime" : "20160711105827+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-rc-2-bin.zip.sha256" +}, { + "version" : "2.14.1-rc-1", + "buildTime" : "20160629051303+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14.1-rc-1-bin.zip.sha256" +}, { + "version" : "3.0-milestone-2", + "buildTime" : "20160621224128+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "3.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.0-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-milestone-2-bin.zip.sha256" +}, { + "version" : "2.14", + "buildTime" : "20160614071637+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-wrapper.jar.sha256" +}, { + "version" : "2.14-rc-6", + "buildTime" : "20160610181946+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-6-bin.zip.sha256" +}, { + "version" : "3.0-milestone-1", + "buildTime" : "20160608013148+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "3.0", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-3.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-3.0-milestone-1-bin.zip.sha256" +}, { + "version" : "2.14-rc-5", + "buildTime" : "20160607135817+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-5-bin.zip.sha256" +}, { + "version" : "2.14-rc-4", + "buildTime" : "20160603110827+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-4-bin.zip.sha256" +}, { + "version" : "2.14-rc-3", + "buildTime" : "20160530112111+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-3-bin.zip.sha256" +}, { + "version" : "2.14-rc-2", + "buildTime" : "20160527175624+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-2-bin.zip.sha256" +}, { + "version" : "2.14-rc-1", + "buildTime" : "20160518093824+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.14", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.14-rc-1-bin.zip.sha256" +}, { + "version" : "2.13", + "buildTime" : "20160425041010+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.13-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.13-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.13-wrapper.jar.sha256" +}, { + "version" : "2.13-rc-2", + "buildTime" : "20160419145240+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.13", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.13-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.13-rc-2-bin.zip.sha256" +}, { + "version" : "2.13-rc-1", + "buildTime" : "20160406110211+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.13", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.13-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.13-rc-1-bin.zip.sha256" +}, { + "version" : "2.12", + "buildTime" : "20160314083203+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.12-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.12-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.12-wrapper.jar.sha256" +}, { + "version" : "2.12-rc-1", + "buildTime" : "20160307174118+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.12", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.12-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.12-rc-1-bin.zip.sha256" +}, { + "version" : "2.11", + "buildTime" : "20160208075916+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.11-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.11-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.11-wrapper.jar.sha256" +}, { + "version" : "2.11-rc-3", + "buildTime" : "20160203190922+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-3-bin.zip.sha256" +}, { + "version" : "2.11-rc-2", + "buildTime" : "20160202162431+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-2-bin.zip.sha256" +}, { + "version" : "2.11-rc-1", + "buildTime" : "20160120084154+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.11-rc-1-bin.zip.sha256" +}, { + "version" : "2.10", + "buildTime" : "20151221211504+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.10-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.10-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.10-wrapper.jar.sha256" +}, { + "version" : "2.10-rc-2", + "buildTime" : "20151218164026+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.10-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.10-rc-2-bin.zip.sha256" +}, { + "version" : "2.10-rc-1", + "buildTime" : "20151208224811+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.10-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.10-rc-1-bin.zip.sha256" +}, { + "version" : "2.9", + "buildTime" : "20151117070217+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.9-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.9-wrapper.jar.sha256" +}, { + "version" : "2.9-rc-1", + "buildTime" : "20151103230218+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.9-rc-1-bin.zip.sha256" +}, { + "version" : "2.8", + "buildTime" : "20151020034636+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.8-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.8-wrapper.jar.sha256" +}, { + "version" : "2.8-rc-2", + "buildTime" : "20151015124208+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.8-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.8-rc-2-bin.zip.sha256" +}, { + "version" : "2.8-rc-1", + "buildTime" : "20150930171102+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.8-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.8-rc-1-bin.zip.sha256" +}, { + "version" : "2.7", + "buildTime" : "20150914072616+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.7-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.7-wrapper.jar.sha256" +}, { + "version" : "2.7-rc-2", + "buildTime" : "20150905140615+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.7-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.7-rc-2-bin.zip.sha256" +}, { + "version" : "2.7-rc-1", + "buildTime" : "20150828140928+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.7-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.7-rc-1-bin.zip.sha256" +}, { + "version" : "2.6", + "buildTime" : "20150810131506+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.6-wrapper.jar.sha256" +}, { + "version" : "2.6-rc-2", + "buildTime" : "20150804104806+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.6-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.6-rc-2-bin.zip.sha256" +}, { + "version" : "2.6-rc-1", + "buildTime" : "20150728171643+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.6-rc-1-bin.zip.sha256" +}, { + "version" : "2.5", + "buildTime" : "20150708073837+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.5-wrapper.jar.sha256" +}, { + "version" : "2.5-rc-2", + "buildTime" : "20150702151559+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.5-rc-2-bin.zip.sha256" +}, { + "version" : "2.5-rc-1", + "buildTime" : "20150623180452+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.5-rc-1-bin.zip.sha256" +}, { + "version" : "2.4", + "buildTime" : "20150505080924+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.4-wrapper.jar.sha256" +}, { + "version" : "2.4-rc-2", + "buildTime" : "20150429045020+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.4-rc-2-bin.zip.sha256" +}, { + "version" : "2.4-rc-1", + "buildTime" : "20150423031523+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.4-rc-1-bin.zip.sha256" +}, { + "version" : "2.3", + "buildTime" : "20150216050933+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-wrapper.jar.sha256" +}, { + "version" : "2.3-rc-4", + "buildTime" : "20150211163922+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-4-bin.zip.sha256" +}, { + "version" : "2.3-rc-3", + "buildTime" : "20150208183759+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-3-bin.zip.sha256" +}, { + "version" : "2.3-rc-2", + "buildTime" : "20150204105413+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-2-bin.zip.sha256" +}, { + "version" : "2.3-rc-1", + "buildTime" : "20150127140232+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.3-rc-1-bin.zip.sha256" +}, { + "version" : "2.2.1", + "buildTime" : "20141124094535+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.2.1-wrapper.jar.sha256" +}, { + "version" : "2.2.1-rc-1", + "buildTime" : "20141117101237+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.2.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.2.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.2.1-rc-1-bin.zip.sha256" +}, { + "version" : "2.2", + "buildTime" : "20141110133144+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.2-wrapper.jar.sha256" +}, { + "version" : "2.2-rc-2", + "buildTime" : "20141103170404+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.2-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.2-rc-2-bin.zip.sha256" +}, { + "version" : "2.2-rc-1", + "buildTime" : "20141020163257+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.2-rc-1-bin.zip.sha256" +}, { + "version" : "2.1", + "buildTime" : "20140908104039+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-wrapper.jar.sha256" +}, { + "version" : "2.1-rc-4", + "buildTime" : "20140903092053+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-4-bin.zip.sha256" +}, { + "version" : "2.1-rc-3", + "buildTime" : "20140901103549+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-3-bin.zip.sha256" +}, { + "version" : "2.1-rc-2", + "buildTime" : "20140828023229+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-2-bin.zip.sha256" +}, { + "version" : "2.1-rc-1", + "buildTime" : "20140819194409+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.1-rc-1-bin.zip.sha256" +}, { + "version" : "2.0", + "buildTime" : "20140701074534+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-2.0-wrapper.jar.sha256" +}, { + "version" : "2.0-rc-2", + "buildTime" : "20140623080236+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.0-rc-2-bin.zip.sha256" +}, { + "version" : "2.0-rc-1", + "buildTime" : "20140606070241+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "2.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-2.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-2.0-rc-1-bin.zip.sha256" +}, { + "version" : "1.12", + "buildTime" : "20140429092431+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.12-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.12-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.12-wrapper.jar.sha256" +}, { + "version" : "1.12-rc-2", + "buildTime" : "20140423112055+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.12", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.12-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.12-rc-2-bin.zip.sha256" +}, { + "version" : "1.12-rc-1", + "buildTime" : "20140416084626+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.12", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.12-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.12-rc-1-bin.zip.sha256" +}, { + "version" : "1.11", + "buildTime" : "20140211113439+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.11-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.11-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.11-wrapper.jar.sha256" +}, { + "version" : "1.11-rc-1", + "buildTime" : "20140131033453+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.11", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.11-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.11-rc-1-bin.zip.sha256" +}, { + "version" : "1.10", + "buildTime" : "20131217092815+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.10-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.10-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.10-wrapper.jar.sha256" +}, { + "version" : "1.10-rc-2", + "buildTime" : "20131211105454+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.10-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.10-rc-2-bin.zip.sha256" +}, { + "version" : "1.10-rc-1", + "buildTime" : "20131204154128+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.10", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.10-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.10-rc-1-bin.zip.sha256" +}, { + "version" : "1.9", + "buildTime" : "20131119082002+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-wrapper.jar.sha256" +}, { + "version" : "1.9-rc-4", + "buildTime" : "20131118093242+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-4-bin.zip.sha256" +}, { + "version" : "1.9-rc-3", + "buildTime" : "20131107122642+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-3-bin.zip.sha256" +}, { + "version" : "1.9-rc-2", + "buildTime" : "20131028093320+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-2-bin.zip.sha256" +}, { + "version" : "1.9-rc-1", + "buildTime" : "20131023094618+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.9-rc-1-bin.zip.sha256" +}, { + "version" : "1.8", + "buildTime" : "20130924073233+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.8-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.8-wrapper.jar.sha256" +}, { + "version" : "1.8-rc-2", + "buildTime" : "20130919053314+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.8-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.8-rc-2-bin.zip.sha256" +}, { + "version" : "1.8-rc-1", + "buildTime" : "20130910130452+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.8", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.8-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.8-rc-1-bin.zip.sha256" +}, { + "version" : "1.7", + "buildTime" : "20130806111956+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.7-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.7-wrapper.jar.sha256" +}, { + "version" : "1.7-rc-2", + "buildTime" : "20130729120421+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.7-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.7-rc-2-bin.zip.sha256" +}, { + "version" : "1.7-rc-1", + "buildTime" : "20130702145630+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.7", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.7-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.7-rc-1-bin.zip.sha256" +}, { + "version" : "1.6", + "buildTime" : "20130507091214+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.6-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.6-wrapper.jar.sha256" +}, { + "version" : "1.6-rc-1", + "buildTime" : "20130430131900+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.6", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.6-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.6-rc-1-bin.zip.sha256" +}, { + "version" : "1.5", + "buildTime" : "20130327140935+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.5-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.5-wrapper.jar.sha256" +}, { + "version" : "1.5-rc-3", + "buildTime" : "20130321155709+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-3-bin.zip.sha256" +}, { + "version" : "1.5-rc-2", + "buildTime" : "20130317011516+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-2-bin.zip.sha256" +}, { + "version" : "1.5-rc-1", + "buildTime" : "20130311120320+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.5", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.5-rc-1-bin.zip.sha256" +}, { + "version" : "1.4", + "buildTime" : "20130128034246+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.4-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.4-wrapper.jar.sha256" +}, { + "version" : "1.4-rc-3", + "buildTime" : "20130125035146+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-3-bin.zip.sha256" +}, { + "version" : "1.4-rc-2", + "buildTime" : "20130122030632+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-2-bin.zip.sha256" +}, { + "version" : "1.4-rc-1", + "buildTime" : "20130117001257+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.4", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.4-rc-1-bin.zip.sha256" +}, { + "version" : "1.3", + "buildTime" : "20121120113738+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.3-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.3-wrapper.jar.sha256" +}, { + "version" : "1.3-rc-2", + "buildTime" : "20121115155343+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.3-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.3-rc-2-bin.zip.sha256" +}, { + "version" : "1.3-rc-1", + "buildTime" : "20121112135252+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.3", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.3-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.3-rc-1-bin.zip.sha256" +}, { + "version" : "1.2", + "buildTime" : "20120912104602+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.2-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.2-wrapper.jar.sha256" +}, { + "version" : "1.2-rc-1", + "buildTime" : "20120904174954+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.2", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.2-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.2-rc-1-bin.zip.sha256" +}, { + "version" : "1.1", + "buildTime" : "20120731132432+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.1-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.1-wrapper.jar.sha256" +}, { + "version" : "1.1-rc-2", + "buildTime" : "20120726075103+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.1-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.1-rc-2-bin.zip.sha256" +}, { + "version" : "1.1-rc-1", + "buildTime" : "20120724134404+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.1", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.1-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.1-rc-1-bin.zip.sha256" +}, { + "version" : "1.0", + "buildTime" : "20120612025621+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-bin.zip.sha256", + "wrapperChecksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-wrapper.jar.sha256" +}, { + "version" : "1.0-rc-3", + "buildTime" : "20120430015152+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-3-bin.zip.sha256" +}, { + "version" : "1.0-rc-2", + "buildTime" : "20120425015237+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-2-bin.zip.sha256" +}, { + "version" : "1.0-rc-1", + "buildTime" : "20120411121324+0100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "1.0", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-rc-1-bin.zip.sha256" +}, { + "version" : "1.0-milestone-9", + "buildTime" : "20120313171009+0100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip.sha256" +}, { + "version" : "1.0-milestone-8a", + "buildTime" : "20120220185357+0100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-8a-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-8a-bin.zip.sha256" +}, { + "version" : "1.0-milestone-8", + "buildTime" : "20120214022451+0100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-8-bin.zip.sha256" +}, { + "version" : "1.0-milestone-7", + "buildTime" : "20120105102443+0000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-7-bin.zip.sha256" +}, { + "version" : "1.0-milestone-6", + "buildTime" : "20111117065412+0100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-6-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-6-bin.zip.sha256" +}, { + "version" : "1.0-milestone-5", + "buildTime" : "20111025055608+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-5-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-5-bin.zip.sha256" +}, { + "version" : "1.0-milestone-4", + "buildTime" : "20110728103822+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : true, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-4-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-4-bin.zip.sha256" +}, { + "version" : "1.0-milestone-3", + "buildTime" : "20110425174011+1000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-3-bin.zip.sha256" +}, { + "version" : "1.0-milestone-2", + "buildTime" : "20110407163255+1000", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-2-bin.zip.sha256" +}, { + "version" : "1.0-milestone-1", + "buildTime" : "20110227141320+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-1.0-milestone-1-bin.zip.sha256" +}, { + "version" : "0.9.2", + "buildTime" : "20110123133421+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9.2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9.2-bin.zip.sha256" +}, { + "version" : "0.9.1", + "buildTime" : "20110102114057+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9.1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9.1-bin.zip.sha256" +}, { + "version" : "0.9", + "buildTime" : "20101219125006+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9-bin.zip.sha256" +}, { + "version" : "0.9-rc-3", + "buildTime" : "20101120131750+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "0.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-3-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-3-bin.zip.sha256" +}, { + "version" : "0.9-rc-2", + "buildTime" : "20101027082405+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "0.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-2-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-2-bin.zip.sha256" +}, { + "version" : "0.9-rc-1", + "buildTime" : "20100804080433+1100", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "0.9", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-1-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.9-rc-1-bin.zip.sha256" +}, { + "version" : "0.8", + "buildTime" : "20090928140159+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.8-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.8-bin.zip.sha256" +}, { + "version" : "0.7", + "buildTime" : "20090720085013+0200", + "current" : false, + "snapshot" : false, + "nightly" : false, + "releaseNightly" : false, + "activeRc" : false, + "rcFor" : "", + "milestoneFor" : "", + "broken" : false, + "downloadUrl" : "https://services.gradle.org/distributions/gradle-0.7-bin.zip", + "checksumUrl" : "https://services.gradle.org/distributions/gradle-0.7-bin.zip.sha256" +} ] \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/3076f6d2f740001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/3076f6d2f740001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/3076f6d2f740001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/60f96216a5c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/60f96216a5c3001f100a9153ada878f0 new file mode 100644 index 0000000..e90bf9f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/60f96216a5c3001f100a9153ada878f0 @@ -0,0 +1,7 @@ +package ch01_Test1; + +public class TestApp { + public static void main(String[] args) { + System.out.println("Success!"); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/9078bad3ee40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/9078bad3ee40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/9078bad3ee40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e0242724a5c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e0242724a5c3001f100a9153ada878f0 new file mode 100644 index 0000000..d975d9a --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e0242724a5c3001f100a9153ada878f0 @@ -0,0 +1,13 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:/n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.out.println(myName); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f0968eecec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f0968eecec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..278512b --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f0968eecec40001c1663dc9f153dfd73 @@ -0,0 +1,71 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + System.out.println("The Invoice Total Calculator\n"); + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + System.out.println(); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + String format = "%-20s%12s%n"; + + System.out.println("INVOICE"); // print blank line + System.out.printf(format, "Subtotal:", + currency.format(subtotal)); + System.out.printf(format, "Discount percent:", + percent.format(discountPercent)); + System.out.printf(format, "Discount amount:", + currency.format(discountAmount)); + System.out.printf(format, "Total:", + currency.format(total)); + System.out.println(); // print blank line + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70255a00a6c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70255a00a6c3001f100a9153ada878f0 new file mode 100644 index 0000000..c4d07f4 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70255a00a6c3001f100a9153ada878f0 @@ -0,0 +1,14 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.console().flush(); + System.out.println("\n" + "Welcome to the Test App, " + myName + "!"); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30ecb302ef40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30ecb302ef40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/30ecb302ef40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/50c5f4f0ee40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/50c5f4f0ee40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/50c5f4f0ee40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/9080e4a4f040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/9080e4a4f040001c1663dc9f153dfd73 new file mode 100644 index 0000000..96dabe7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/9080e4a4f040001c1663dc9f153dfd73 @@ -0,0 +1,129 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox(); + private ListView futureValues = new ListView(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b06b2612a6c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b06b2612a6c3001f100a9153ada878f0 new file mode 100644 index 0000000..eeeda42 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b06b2612a6c3001f100a9153ada878f0 @@ -0,0 +1,15 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.out.print("\033[H\033[2J"); + System.out.flush(); + System.out.println("\n" + "Welcome to the Test App, " + myName + "!"); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/100467b696c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/100467b696c3001f100a9153ada878f0 new file mode 100644 index 0000000..8cea391 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/100467b696c3001f100a9153ada878f0 @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=23 +org.eclipse.jdt.core.compiler.compliance=23 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=23 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c05c63e9ee40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c05c63e9ee40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c05c63e9ee40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/709792f4ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/709792f4ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..cfd2c94 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/709792f4ec40001c1663dc9f153dfd73 @@ -0,0 +1,42 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + String input = sc.nextLine(); + int guess = Integer.parseInt(input); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b08d7bb7ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b08d7bb7ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..7ee4768 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b08d7bb7ec40001c1663dc9f153dfd73 @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/50882ea2f040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/50882ea2f040001c1663dc9f153dfd73 new file mode 100644 index 0000000..ed1da7d --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/50882ea2f040001c1663dc9f153dfd73 @@ -0,0 +1,131 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/60781d30ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/60781d30ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/60781d30ec40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e01e5843f040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e01e5843f040001c1663dc9f153dfd73 new file mode 100644 index 0000000..96dabe7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e01e5843f040001c1663dc9f153dfd73 @@ -0,0 +1,129 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox(); + private ListView futureValues = new ListView(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/60f4ea35ed40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/60f4ea35ed40001c1663dc9f153dfd73 new file mode 100644 index 0000000..b7a9d39 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/60f4ea35ed40001c1663dc9f153dfd73 @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/50a65826f240001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/50a65826f240001c1663dc9f153dfd73 new file mode 100644 index 0000000..5c85313 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/50a65826f240001c1663dc9f153dfd73 @@ -0,0 +1,130 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/70dd6c29ed40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/70dd6c29ed40001c1663dc9f153dfd73 new file mode 100644 index 0000000..235c721 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/70dd6c29ed40001c1663dc9f153dfd73 @@ -0,0 +1,54 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00bf1f36f840001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00bf1f36f840001c1663dc9f153dfd73 new file mode 100644 index 0000000..e1d0973 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/00bf1f36f840001c1663dc9f153dfd73 @@ -0,0 +1,56 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + + // size + + // toppings + + // price output + + // calculate button + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + // calulation code here + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/70f13566f140001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/70f13566f140001c1663dc9f153dfd73 new file mode 100644 index 0000000..fd3bd7e --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/70f13566f140001c1663dc9f153dfd73 @@ -0,0 +1,82 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + private Label milesError; + private Label gallonsError; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + Validation v = new Validation(); + + String errorMsg = ""; + errorMsg += v.isDouble(milesField.getText(), "Miles"); + errorMsg += v.isDouble(gallonsField.getText(), "Gallons"); + + if (errorMsg.isEmpty()) { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/c0286310f240001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/c0286310f240001c1663dc9f153dfd73 new file mode 100644 index 0000000..77c1e2e --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/c0286310f240001c1663dc9f153dfd73 @@ -0,0 +1,128 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox(); + private ListView futureValues = new ListView(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/f09a7eb7ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/f09a7eb7ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..29e678e --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/f09a7eb7ec40001c1663dc9f153dfd73 @@ -0,0 +1,102 @@ +package murach; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class App extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + // get data from text fields + double investment = Double.parseDouble(investmentField.getText()); + double rate = Double.parseDouble(interestRateField.getText()); + int years = Integer.parseInt(yearsField.getText()); + + // calculate future value + double futureValue = calculateFutureValue(investment, rate, years); + + // set data in read-only text field + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate/12/100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/301b2b92f040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/301b2b92f040001c1663dc9f153dfd73 new file mode 100644 index 0000000..77c1e2e --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/301b2b92f040001c1663dc9f153dfd73 @@ -0,0 +1,128 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox(); + private ListView futureValues = new ListView(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0088de39a5c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0088de39a5c3001f100a9153ada878f0 new file mode 100644 index 0000000..af86df2 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0088de39a5c3001f100a9153ada878f0 @@ -0,0 +1,13 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.out.println(myName); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d05c99a7ef40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d05c99a7ef40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d05c99a7ef40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/90937f75a5c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/90937f75a5c3001f100a9153ada878f0 new file mode 100644 index 0000000..6324057 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/90937f75a5c3001f100a9153ada878f0 @@ -0,0 +1,14 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + + System.out.println("\n" + myName); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c04dc01aed40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c04dc01aed40001c1663dc9f153dfd73 new file mode 100644 index 0000000..1b3f7b8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/c04dc01aed40001c1663dc9f153dfd73 @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f0b725fbee40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f0b725fbee40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/f0b725fbee40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0835fe3ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0835fe3ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..a2c14ea --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f0835fe3ec40001c1663dc9f153dfd73 @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To exit, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80b8ceffec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80b8ceffec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..8999ebf --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/80b8ceffec40001c1663dc9f153dfd73 @@ -0,0 +1,162 @@ +package murach.signup; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.TextArea; +import javafx.scene.control.Button; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.SelectionMode; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Alert; +import javafx.scene.control.DatePicker; +import javafx.stage.Stage; + +import java.util.List; +import javafx.scene.text.Font; + +public class SignupApp extends Application { + + private TextField nameField = new TextField(); + private DatePicker dobPicker = new DatePicker(); + private ToggleGroup genderToggle = new ToggleGroup(); + private ListView genreListView = new ListView<>(); + private ComboBox countryCombo = new ComboBox<>(); + private TextArea descriptionArea = new TextArea(); + private CheckBox notifyCheckBox = new CheckBox("Receive notifications"); + + @Override + public void start(Stage stage) { + stage.setTitle("Social Media Signup"); + VBox vbox = new VBox(10); + + // name + HBox nameBox = new HBox(10); + Label nameLabel = new Label("Name: "); + nameField.setMinWidth(209); + nameBox.getChildren().add(nameLabel); + nameBox.getChildren().add(nameField); + vbox.getChildren().add(nameBox); + + // date of birth (DOB) + HBox dobBox = new HBox(10); + Label dobLabel = new Label("Date of Birth: "); + dobBox.getChildren().add(dobLabel); + dobBox.getChildren().add(dobPicker); + vbox.getChildren().add(dobBox); + + // gender + HBox genderBox = new HBox(10); + Label genderLabel = new Label("Gender: "); + + RadioButton maleButton = new RadioButton("Male"); + maleButton.setToggleGroup(genderToggle); + maleButton.setSelected(true); + RadioButton femaleButton = new RadioButton("Female"); + femaleButton.setToggleGroup(genderToggle); + RadioButton otherButton = new RadioButton("Other"); + otherButton.setToggleGroup(genderToggle); + + genderBox.getChildren().add(genderLabel); + genderBox.getChildren().add(maleButton); + genderBox.getChildren().add(femaleButton); + genderBox.getChildren().add(otherButton); + vbox.getChildren().add(genderBox); + + // country + Label countryLabel = new Label("Country: "); + countryCombo.setPromptText("Select Country"); + String[] countries = {"United States", "Canada", "Mexico"}; + for (String country : countries) { + countryCombo.getItems().add(country); + } + vbox.getChildren().add(countryLabel); + vbox.getChildren().add(countryCombo); + + // movie genres + Label movieLabel = new Label("Favorite Movie Genres: "); + genreListView.getSelectionModel() + .setSelectionMode(SelectionMode.MULTIPLE); + String[] genres = {"Action", "Comedy", "Sci-Fi", "Horror", "Drama"}; + for (String genre : genres) { + genreListView.getItems().add(genre); + } + genreListView.setPrefHeight(genres.length * 24); + vbox.getChildren().add(movieLabel); + vbox.getChildren().add(genreListView); + + // description + Label descriptionLabel = new Label("Profile Description: "); + descriptionArea.setPrefColumnCount(35); + descriptionArea.setPrefRowCount(4); + descriptionArea.setWrapText(true); + ScrollPane descriptionScroll = new ScrollPane(descriptionArea); + vbox.getChildren().add(descriptionLabel); + vbox.getChildren().add(descriptionScroll); + + // notification + vbox.getChildren().add(notifyCheckBox); + + // button + Button signUpButton = new Button("Sign Up"); + signUpButton.setOnAction(event -> signUpButtonClicked()); + vbox.getChildren().add(signUpButton); + + vbox.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(vbox, 450, 510); + stage.setScene(scene); + stage.show(); + } + + public void signUpButtonClicked() { + // preprocess a few controls + RadioButton selectedGender = + (RadioButton) genderToggle.getSelectedToggle(); + + String country = countryCombo.getSelectionModel().getSelectedItem(); + + String genresStr = ""; + List genres = + genreListView.getSelectionModel().getSelectedItems(); + for(String genre : genres) { + genresStr += genre + " "; + } + + String notifications; + if(notifyCheckBox.isSelected()) { + notifications = "On"; + } + else { + notifications = "Off"; + } + + // build output string + String outputString = + "Name: " + nameField.getText() + "\n" + + "DOB: " + dobPicker.getValue() + "\n" + + "Gender: " + selectedGender.getText() + "\n" + + "Country: " + country + "\n" + + "Favorite movie genres: " + genresStr + "\n" + + "Profile description: " + descriptionArea.getText() + "\n" + + "Notifications: " + notifications + "\n"; + + // display output string + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle("Signup Info"); + alert.setHeaderText("Signup Confirmation"); + alert.setContentText(outputString); + alert.showAndWait(); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/20de153fec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/20de153fec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/20de153fec40001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c0023e3ff040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c0023e3ff040001c1663dc9f153dfd73 new file mode 100644 index 0000000..ed1da7d --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/c0023e3ff040001c1663dc9f153dfd73 @@ -0,0 +1,131 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/001b4495f040001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/001b4495f040001c1663dc9f153dfd73 new file mode 100644 index 0000000..5c85313 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/001b4495f040001c1663dc9f153dfd73 @@ -0,0 +1,130 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/109677b7ec40001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/109677b7ec40001c1663dc9f153dfd73 new file mode 100644 index 0000000..4bffdb7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/109677b7ec40001c1663dc9f153dfd73 @@ -0,0 +1,48 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class InvoiceApp { + + public static void main(String[] args) { + final double DISCOUNT_PCT = .05; + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + System.out.println(); // print blank line + + // calculate the results + double discountAmount = subtotal * DISCOUNT_PCT; + discountAmount = (double) Math.round(discountAmount * 100) / 100; + double total = subtotal - discountAmount; + + // format and display the discount percent + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.printf("%-20s%12s%n", + "Discount percent:", percent.format(DISCOUNT_PCT)); + + // a debugging statement that has been commented out + /* + System.out.println("UNFORMATTED RESULTS\n" + + "Subtotal: " + subtotal + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n" + + "FORMATTED RESULTS"); + */ + + // format and display the floating-point numbers + String format = "%-20s%,12.2f%n"; + System.out.printf(format, "Subtotal:", subtotal); + System.out.printf(format, "Discount amount:", discountAmount); + System.out.printf(format, "Invoice total:", total); + System.out.println(); // print blank line + + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/90ae18d596c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/90ae18d596c3001f100a9153ada878f0 new file mode 100644 index 0000000..e69de29 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0b5c2fa96c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0b5c2fa96c3001f100a9153ada878f0 new file mode 100644 index 0000000..5994ad7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0b5c2fa96c3001f100a9153ada878f0 @@ -0,0 +1,5 @@ +package ch01_Test1; + +public class TestApp { + +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/30d949b8f740001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/30d949b8f740001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/30d949b8f740001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40c36750f740001c1663dc9f153dfd73 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40c36750f740001c1663dc9f153dfd73 new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40c36750f740001c1663dc9f153dfd73 @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/6070f8a4a5c3001f100a9153ada878f0 b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/6070f8a4a5c3001f100a9153ada878f0 new file mode 100644 index 0000000..85491db --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/6070f8a4a5c3001f100a9153ada878f0 @@ -0,0 +1,13 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.out.println("\n" + "Welcome to the Test App, " + myName); + sc.close(); + } +} diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location new file mode 100644 index 0000000..290446b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.egit.core.cmp/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.location new file mode 100644 index 0000000..bb2db36 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.markers new file mode 100644 index 0000000..a810446 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ac0a702 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueConsole/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.location new file mode 100644 index 0000000..49073c7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..9400503 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_FutureValueGUI/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.location new file mode 100644 index 0000000..e1b41e7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.markers new file mode 100644 index 0000000..55d3696 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..70bcb03 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/af/history.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/af/history.index new file mode 100644 index 0000000..84dfb6e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/af/history.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/e4/9a/history.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/e4/9a/history.index new file mode 100644 index 0000000..b8e65c9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/.indexes/e4/9a/history.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..6060293 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch01_Test1/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.location new file mode 100644 index 0000000..24c8a0b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.markers new file mode 100644 index 0000000..f63efe4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..69294d2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.location new file mode 100644 index 0000000..464b855 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.markers new file mode 100644 index 0000000..38143f3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..7e8c0e5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_TestScore/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.location new file mode 100644 index 0000000..bf57a1c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.markers new file mode 100644 index 0000000..a15eac6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..464a86a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex1_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.location new file mode 100644 index 0000000..b53d663 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.markers new file mode 100644 index 0000000..7feed27 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..dc83ef3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.location new file mode 100644 index 0000000..b2a31d1 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.markers new file mode 100644 index 0000000..065211f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2e2fe67 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.location new file mode 100644 index 0000000..2135483 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.markers new file mode 100644 index 0000000..1792836 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..12325d0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.location new file mode 100644 index 0000000..9aafe0f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.markers new file mode 100644 index 0000000..7e51e78 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..664c0a9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch02_ex3_Invoice_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.location new file mode 100644 index 0000000..052e449 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.markers new file mode 100644 index 0000000..3b34032 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..81ba6be Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.location new file mode 100644 index 0000000..7ccc920 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.markers new file mode 100644 index 0000000..4c642fb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..bc1243f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.location new file mode 100644 index 0000000..e51b855 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.markers new file mode 100644 index 0000000..d8136e7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..b658ec6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex1_MPG_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.location new file mode 100644 index 0000000..9e6cf53 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.markers new file mode 100644 index 0000000..3672111 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..040fcfd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.location new file mode 100644 index 0000000..e68db39 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.markers new file mode 100644 index 0000000..abbde7c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..0622189 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch03_ex2_TestScore_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.location new file mode 100644 index 0000000..29b0f80 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.markers new file mode 100644 index 0000000..e08d8d3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ec71a80 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.location new file mode 100644 index 0000000..19450f3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.markers new file mode 100644 index 0000000..b91ae2a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2aeff1a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_GuessNumber/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.location new file mode 100644 index 0000000..853a71b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.markers new file mode 100644 index 0000000..ce1c148 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..92f84ae Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.location new file mode 100644 index 0000000..933b816 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.markers new file mode 100644 index 0000000..9b5431f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5a26c97 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.location new file mode 100644 index 0000000..de8a153 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.markers new file mode 100644 index 0000000..ba7b121 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1aebd31 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.location new file mode 100644 index 0000000..3cf426a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.markers new file mode 100644 index 0000000..ef244ed Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..0918406 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.location new file mode 100644 index 0000000..7c4bc2d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.markers new file mode 100644 index 0000000..e9d6c54 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..307667e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex2_Invoice_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.location new file mode 100644 index 0000000..f9412eb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.markers new file mode 100644 index 0000000..c0a1d11 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..a375e1f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.location new file mode 100644 index 0000000..b9e37fb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.markers new file mode 100644 index 0000000..d8f4e22 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..fae6078 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex3_GuessNumber_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.location new file mode 100644 index 0000000..6605c96 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.markers new file mode 100644 index 0000000..cb5ae7e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..d5ba745 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.location new file mode 100644 index 0000000..08a4dff Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.markers new file mode 100644 index 0000000..4f3abe3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..045024b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch04_ex4_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.location new file mode 100644 index 0000000..72622c8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.markers new file mode 100644 index 0000000..d82793c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..f150c22 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithMethod/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.location new file mode 100644 index 0000000..432f250 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.markers new file mode 100644 index 0000000..3da6b0e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..571303b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_FutureValueWithValidation/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.location new file mode 100644 index 0000000..0e82d69 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.markers new file mode 100644 index 0000000..be9a90f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ce00a5d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.location new file mode 100644 index 0000000..94ccbcb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.markers new file mode 100644 index 0000000..4d662ad Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..e0d33d2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.location new file mode 100644 index 0000000..5c7d393 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.markers new file mode 100644 index 0000000..c694ada Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..108f17e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.location new file mode 100644 index 0000000..94bc541 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.markers new file mode 100644 index 0000000..e55f51a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..95f6f5e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch05_ex2_GuessNumber_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.location new file mode 100644 index 0000000..0b14c9c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.markers new file mode 100644 index 0000000..f5ff690 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..4e34236 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.location new file mode 100644 index 0000000..eaf550b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.markers new file mode 100644 index 0000000..5fa55ae Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..8980240 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.location new file mode 100644 index 0000000..9dcf9dd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.markers new file mode 100644 index 0000000..804e9a9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ef06492 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.location new file mode 100644 index 0000000..541fd84 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.markers new file mode 100644 index 0000000..bfdf485 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2cf0e06 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch06_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.location new file mode 100644 index 0000000..70960b8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.markers new file mode 100644 index 0000000..7aa0afc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..6b67704 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_LineItem/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.location new file mode 100644 index 0000000..6d83f35 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.markers new file mode 100644 index 0000000..7924f29 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..cddc573 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_Product/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.location new file mode 100644 index 0000000..aa9be72 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.markers new file mode 100644 index 0000000..79c035c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..8edc392 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.location new file mode 100644 index 0000000..5623772 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.markers new file mode 100644 index 0000000..5869b59 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2b12793 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex1_Product_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.location new file mode 100644 index 0000000..e5ec140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.markers new file mode 100644 index 0000000..3b701e2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..a22cfce Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.location new file mode 100644 index 0000000..fdedf05 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.markers new file mode 100644 index 0000000..2b92e6c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1bcad43 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex2_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.location new file mode 100644 index 0000000..403f233 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.markers new file mode 100644 index 0000000..887d470 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5525a7c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.location new file mode 100644 index 0000000..21db749 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.markers new file mode 100644 index 0000000..9a56ae5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5cb2333 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch07_ex3_AreaAndPerimeter_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.location new file mode 100644 index 0000000..d4be4d0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.markers new file mode 100644 index 0000000..fc5f9ba Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..76e3500 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.location new file mode 100644 index 0000000..ab24f55 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.markers new file mode 100644 index 0000000..60de104 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..719131c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_NumberCruncher/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.location new file mode 100644 index 0000000..66270d6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.markers new file mode 100644 index 0000000..5d63db1 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..74aa22d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.location new file mode 100644 index 0000000..915bf5b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.markers new file mode 100644 index 0000000..2f88289 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..9c71f7d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex1_MonthSales_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.location new file mode 100644 index 0000000..0ea1d17 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.markers new file mode 100644 index 0000000..b7acff8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..b9eb4e9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.location new file mode 100644 index 0000000..00ebed3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.markers new file mode 100644 index 0000000..05504e6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..14e37f5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex2_CardDeck_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.location new file mode 100644 index 0000000..d91b00e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.markers new file mode 100644 index 0000000..926edac Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ba9b419 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.location new file mode 100644 index 0000000..92dda95 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.markers new file mode 100644 index 0000000..02c6ebb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..4494692 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch08_ex3_CardDeck_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.location new file mode 100644 index 0000000..fa7138e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.markers new file mode 100644 index 0000000..da7020f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..e0a3a9a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ProductManager/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.location new file mode 100644 index 0000000..818943d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.markers new file mode 100644 index 0000000..bfc6820 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2f4c913 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.location new file mode 100644 index 0000000..c706e48 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.markers new file mode 100644 index 0000000..3f88d79 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..54f1d5c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex1_CustomerManager_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.location new file mode 100644 index 0000000..6079aef Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.markers new file mode 100644 index 0000000..77941b5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..c504d0b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.location new file mode 100644 index 0000000..b0f19df Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.markers new file mode 100644 index 0000000..1b5af0c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..2cc8afe Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex2_ProductManager_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.location new file mode 100644 index 0000000..75d7a50 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.markers new file mode 100644 index 0000000..ce1a403 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..916b6bd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.location new file mode 100644 index 0000000..38ac089 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.markers new file mode 100644 index 0000000..4d540c8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5d8f098 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch09_ex3_ExceptionTester_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.location new file mode 100644 index 0000000..ba8af5a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.markers new file mode 100644 index 0000000..fd896e9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..9da177e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_Product/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.location new file mode 100644 index 0000000..1527cc0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.markers new file mode 100644 index 0000000..353ac78 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..a4f636a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.location new file mode 100644 index 0000000..dd43651 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.markers new file mode 100644 index 0000000..297e3f7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..7218ac0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex1_Product_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.location new file mode 100644 index 0000000..cd9c7d2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.markers new file mode 100644 index 0000000..b1e27b7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..6774d15 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.location new file mode 100644 index 0000000..d6168a5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.markers new file mode 100644 index 0000000..5751940 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..0e25d2f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex2_Product_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.location new file mode 100644 index 0000000..b200908 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.markers new file mode 100644 index 0000000..1c7f84f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1213c3a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.location new file mode 100644 index 0000000..afddd62 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.markers new file mode 100644 index 0000000..b5d097e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..37ff3dc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch10_ex3_EqualsTest_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.location new file mode 100644 index 0000000..b234705 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.markers new file mode 100644 index 0000000..0238f50 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ebf0980 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_LineItem/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.location new file mode 100644 index 0000000..09aef2d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.markers new file mode 100644 index 0000000..344d6dc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..c211f46 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.location new file mode 100644 index 0000000..5a801c5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.markers new file mode 100644 index 0000000..7e3e8ca Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..89d8479 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex1_DisplayableTest_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.location new file mode 100644 index 0000000..e5f8b7d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.markers new file mode 100644 index 0000000..b879dc8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..eb0666c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.location new file mode 100644 index 0000000..ea901b0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.markers new file mode 100644 index 0000000..0f9f96c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..d6dec9b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex2_Enumeration_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.location new file mode 100644 index 0000000..4148b3a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.markers new file mode 100644 index 0000000..517c689 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5c5676d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.location new file mode 100644 index 0000000..87aacf6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.markers new file mode 100644 index 0000000..0bdd813 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1946707 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch11_ex3_LineItem_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.location new file mode 100644 index 0000000..e754097 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.markers new file mode 100644 index 0000000..b0138cf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..849ee39 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.location new file mode 100644 index 0000000..ced40f5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.markers new file mode 100644 index 0000000..59250bc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..6ac9a32 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_FutureValueValidation/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.location new file mode 100644 index 0000000..1aaec8e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.markers new file mode 100644 index 0000000..18ea3cd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..83bf4f8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.location new file mode 100644 index 0000000..07b7841 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.markers new file mode 100644 index 0000000..8aded2e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..8909aea Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex1_MPG_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.location new file mode 100644 index 0000000..45ac946 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.markers new file mode 100644 index 0000000..eb92492 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..fe24ad7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.location new file mode 100644 index 0000000..744ee74 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.markers new file mode 100644 index 0000000..11b6b26 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..32ad157 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch12_ex2_MPG_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.location new file mode 100644 index 0000000..236c947 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.markers new file mode 100644 index 0000000..df421bd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..9ca40a3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_SocialMediaSignup/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.location new file mode 100644 index 0000000..8de39a2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.markers new file mode 100644 index 0000000..57104b0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..8e5455c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.location new file mode 100644 index 0000000..6a40870 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.markers new file mode 100644 index 0000000..f8c9db0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..3e38b9d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.location new file mode 100644 index 0000000..bda9a3c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.markers new file mode 100644 index 0000000..d6d5f16 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ffe35b9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.indexes/properties.index new file mode 100644 index 0000000..7e36140 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.location new file mode 100644 index 0000000..627256d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.markers new file mode 100644 index 0000000..1e5864d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..f85e1e6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch13_ex2_PizzaCalculator_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.location new file mode 100644 index 0000000..9f0dbff Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.markers new file mode 100644 index 0000000..c02e6fa Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..fc296e5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_CreateAccount/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.location new file mode 100644 index 0000000..07c7321 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.markers new file mode 100644 index 0000000..626938c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..5bbc051 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_Hangman/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.location new file mode 100644 index 0000000..7103b39 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.markers new file mode 100644 index 0000000..c85d957 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..e57833a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.location new file mode 100644 index 0000000..8b32a6b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.markers new file mode 100644 index 0000000..df965c0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..a60bf23 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex1_CreateAccount_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.location new file mode 100644 index 0000000..c356a44 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.markers new file mode 100644 index 0000000..ccce070 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..8a46a2b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.location new file mode 100644 index 0000000..e01c701 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.markers new file mode 100644 index 0000000..77cf8bf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..22c9f8f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch14_ex2_Hangman_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.location new file mode 100644 index 0000000..30a037c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.markers new file mode 100644 index 0000000..eeb59d7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1c18ee5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.location new file mode 100644 index 0000000..7d650cf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.markers new file mode 100644 index 0000000..8f2753a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..22b5f3d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_WordCounter/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.location new file mode 100644 index 0000000..5a83afa Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.markers new file mode 100644 index 0000000..33f7e9b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..b191870 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.location new file mode 100644 index 0000000..6814ca7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.markers new file mode 100644 index 0000000..c5b7f8e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..3ef1929 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex1_FutureValue_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.location new file mode 100644 index 0000000..e845b0d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.markers new file mode 100644 index 0000000..1581b1b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..0c22e4d Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.location new file mode 100644 index 0000000..11e6612 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.markers new file mode 100644 index 0000000..95b0af3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..a2380db Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex2_GenericStack_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.location new file mode 100644 index 0000000..01e5292 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.markers new file mode 100644 index 0000000..b811f92 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..3a93f4b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch15_ex3_LoginCounter/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.location new file mode 100644 index 0000000..1891738 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.markers new file mode 100644 index 0000000..bbe72b9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ce6b7a9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.location new file mode 100644 index 0000000..7f76f72 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.markers new file mode 100644 index 0000000..68e6bc2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..ccc30f7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex1_BookCatalog_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.location new file mode 100644 index 0000000..8ff9d0c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.markers new file mode 100644 index 0000000..0f01e0f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..13ff4b7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.location new file mode 100644 index 0000000..e26a9b4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.markers new file mode 100644 index 0000000..5d97bf6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..d4dba92 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch16_ex2_BookCatalog_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.location new file mode 100644 index 0000000..204828c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.markers new file mode 100644 index 0000000..de9e0a0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..468d202 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_DirectorySearch/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.location new file mode 100644 index 0000000..e0c5a02 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.markers new file mode 100644 index 0000000..053fc33 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..21b4ca7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.location new file mode 100644 index 0000000..e5776cd Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.markers new file mode 100644 index 0000000..6c4f32a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..c581f41 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex1_Fibonacci_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.location new file mode 100644 index 0000000..c440b4b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.markers new file mode 100644 index 0000000..f0f92b4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..d773ed0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.location new file mode 100644 index 0000000..27e3af9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.markers new file mode 100644 index 0000000..2245cc8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..c24e578 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex2_StringReversal_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.location new file mode 100644 index 0000000..43d6214 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.markers new file mode 100644 index 0000000..5959232 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..29f4720 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.location new file mode 100644 index 0000000..961ed59 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.markers new file mode 100644 index 0000000..59307a1 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..1fe7732 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch17_ex3_GCD_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.location new file mode 100644 index 0000000..ca297a8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.markers new file mode 100644 index 0000000..cedd954 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..90bd5e0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.location new file mode 100644 index 0000000..2608634 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.markers new file mode 100644 index 0000000..eedde94 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..fff8f4a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.location new file mode 100644 index 0000000..119d4c2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.markers new file mode 100644 index 0000000..b606353 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..e171e6b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex1_Invoice_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.location new file mode 100644 index 0000000..8ab61c6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.markers new file mode 100644 index 0000000..776f251 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..fe02778 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.location new file mode 100644 index 0000000..93ffe0a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.markers new file mode 100644 index 0000000..fed0fa8 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..d1350d2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch18_ex2_AgeCalculator_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.location new file mode 100644 index 0000000..19fe8c5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.markers new file mode 100644 index 0000000..71b38d7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..6ae54aa Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ProductManager/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.location new file mode 100644 index 0000000..f068043 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.markers new file mode 100644 index 0000000..633eea9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex1_SQLStatements_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.location new file mode 100644 index 0000000..83c1de5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.markers new file mode 100644 index 0000000..fbf7aca Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..bd49f84 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.location new file mode 100644 index 0000000..bdf5e32 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.markers new file mode 100644 index 0000000..a4d37b2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..f06810e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex2_DBTester_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.location new file mode 100644 index 0000000..ea597c3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.markers new file mode 100644 index 0000000..68a56bc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..4de77a9 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.location b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.location new file mode 100644 index 0000000..a0fdd25 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.location differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.markers b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.markers new file mode 100644 index 0000000..b4125bc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/.markers differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/org.eclipse.jdt.core/state.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/org.eclipse.jdt.core/state.dat new file mode 100644 index 0000000..03e45a2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/ch19_ex3_ProductManager_sol/org.eclipse.jdt.core/state.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000..ef32070 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/3.tree b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/3.tree new file mode 100644 index 0000000..032fc7b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/3.tree differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000..2b824fb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..30841eb --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding=UTF-8 +version=1 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs new file mode 100644 index 0000000..9dd00d6 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n +preferredTargets=default\:default| diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b1364df --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.classpathVariable.JRE_LIB=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/jrt-fs.jar +org.eclipse.jdt.core.classpathVariable.JRE_SRC=/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/src.zip +org.eclipse.jdt.core.classpathVariable.JRE_SRCROOT= +org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.compliance=16 +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=16 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs new file mode 100644 index 0000000..31df02c --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.junit.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.junit.content_assist_favorite_static_members_migrated=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..5b63cff --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\r\n\r\n \r\n \r\n \r\n\r\n diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..65316ea --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,13 @@ +command=C\:\\Program Files\\Java\\jdk-23\\bin\\javadoc.exe +content_assist_disabled_computers=org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.jdt.ui.javaPostfixProposalCategory\u0000org.eclipse.jdt.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000org.eclipse.jdt.ui.javaChainProposalCategory\u0000 +content_assist_lru_history= +content_assist_number_of_computers=15 +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.formatterprofiles.version=23 +spelling_locale_initialized=true +typefilter_migrated=true +typefilter_migrated_2=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs new file mode 100644 index 0000000..d56c53f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs new file mode 100644 index 0000000..43e97e4 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +mylyn.attention.migrated=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs new file mode 100644 index 0000000..2a6fe50 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.java.ui.run.count.3_10_0=1 +org.eclipse.mylyn.java.ui.run.count.3_1_0=1 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs new file mode 100644 index 0000000..8d462a6 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000..5330e43 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +migrated.task.repositories.secure.store=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..5fbee78 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,7 @@ +IMPORT_FILES_AND_FOLDERS_MODE=prompt +IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt +SHOW_LOCATION=true +eclipse.preferences.version=1 +platformState=907520816282796 +quickStart=false +tipsAndTricks=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..08076f2 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +showIntro=false diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..eeaec3d --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,13 @@ +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; +RUN_IN_BACKGROUND=false +eclipse.preferences.version=1 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=41,41,41 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=43,44,45 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=204,204,204 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=41,41,41 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=43,44,45 +org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR=221,221,221 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_END=49,53,56 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=59,64,66 +org.eclipse.ui.workbench.INACTIVE_TAB_TEXT_COLOR=187,187,187 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs new file mode 100644 index 0000000..855d634 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.urischeme.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +processedSchemes=,eclipse+command,eclipse+mpc diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/App.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/App.launch new file mode 100644 index 0000000..6c9ed2b --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/App.launch @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp (1).launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp (1).launch new file mode 100644 index 0000000..0aa7d91 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp (1).launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp.launch new file mode 100644 index 0000000..f0b7c3a --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/DBTesterApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApp.launch new file mode 100644 index 0000000..ba90d7f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApplication.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApplication.launch new file mode 100644 index 0000000..ba6fb5f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/FutureValueApplication.launch @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/InvoiceApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/InvoiceApp.launch new file mode 100644 index 0000000..c771e4b --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/InvoiceApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (1).launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (1).launch new file mode 100644 index 0000000..1ec5c7d --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (1).launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (2).launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (2).launch new file mode 100644 index 0000000..063b2c4 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp (2).launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp.launch new file mode 100644 index 0000000..2e64b9a --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/ProductManagerApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestApp.launch new file mode 100644 index 0000000..77556e5 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestScoreApp.launch b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestScoreApp.launch new file mode 100644 index 0000000..6026bce --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.core/.launches/TestScoreApp.launch @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..cf26b6b --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml @@ -0,0 +1,13 @@ + +
+
+ + + +
+
+ + + +
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml new file mode 100644 index 0000000..cf7e85e --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/murach/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..d0f4054 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2491 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + + + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.text.quicksearch.actionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaElementCreationActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.jdt.ui.PackageExplorer + persp.viewSC:org.eclipse.jdt.ui.TypeHierarchy + persp.viewSC:org.eclipse.jdt.ui.SourceView + persp.viewSC:org.eclipse.jdt.ui.JavadocView + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.ResourceNavigator + persp.viewSC:org.eclipse.ui.views.TaskList + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.texteditor.TemplatesView + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.jdt.ui.wizards.JavaProjectWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewPackageCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewClassCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewEnumCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewRecordCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard + persp.newWizSC:org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.showIn:org.eclipse.jdt.ui.PackageExplorer + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.actionSet:org.eclipse.jdt.debug.ui.JDTDebugActionSet + persp.showIn:org.eclipse.egit.ui.RepositoriesView + persp.actionSet:org.eclipse.eclemma.ui.CoverageActionSet + persp.showIn:org.eclipse.eclemma.ui.CoverageView + persp.viewSC:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.showIn:org.eclipse.tm.terminal.view.ui.TerminalsView + persp.newWizSC:org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard + persp.actionSet:org.eclipse.jdt.junit.JUnitActionSet + persp.viewSC:org.eclipse.ant.ui.views.AntView + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.editorOnboardingImageUri:platform:/plugin/org.eclipse.jdt.ui/$nl$/icons/full/onboarding_jperspective.png + persp.editorOnboardingText:Open a file or drop files here to open them. + persp.editorOnboardingCommand:Find Actions$$$Ctrl+3 + persp.editorOnboardingCommand:Show Key Assist$$$Ctrl+Shift+L + persp.editorOnboardingCommand:New$$$Ctrl+N + persp.editorOnboardingCommand:Open Type$$$Ctrl+Shift+T + + + + org.eclipse.e4.primaryNavigationStack + active + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + + + + org.eclipse.e4.secondaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Ant + + + + + org.eclipse.e4.secondaryDataStack + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Terminal + + + + + + + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + + + + View + categoryTag:Help + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + org.eclipse.e4.primaryDataStack + EditorStack + + + Editor + removeOnHide + org.eclipse.jdt.ui.CompilationUnitEditor + + + + Editor + removeOnHide + org.eclipse.jdt.ui.CompilationUnitEditor + + + + + + + + View + categoryTag:Java + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Git + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Java + + + + + View + categoryTag:Ant + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + + + toolbarSeparator + + + + Draggable + + + Draggable + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + TrimStack + Draggable + + + TrimStack + Draggable + + + TrimStack + Draggable + + + + + + + + + + + platform:cocoa + + + platform:cocoa + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:cocoa + + + platform:cocoa + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + NoRestore + + + + + View + categoryTag:Git + + + + + View + categoryTag:Help + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Oomph + + + + + View + categoryTag:General + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:Version Control (Team) + + + View + categoryTag:Help + + + + + View + categoryTag:Terminal + + + + + View + categoryTag:Other + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Language Servers + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + + View + categoryTag:Mylyn + + + + glue + move_after:PerspectiveSpacer + SHOW_RESTORE_MENU + + + move_after:Spacer Glue + HIDEABLE + SHOW_RESTORE_MENU + + + glue + move_after:SearchField + SHOW_RESTORE_MENU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project b/murach/eclipse/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project new file mode 100644 index 0000000..3c10856 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project @@ -0,0 +1,11 @@ + + + .org.eclipse.egit.core.cmp + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1037454467.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1037454467.index new file mode 100644 index 0000000..d215e10 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1037454467.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1058546050.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1058546050.index new file mode 100644 index 0000000..3b5b86b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1058546050.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/111226251.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/111226251.index new file mode 100644 index 0000000..37d7198 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/111226251.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1116509779.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1116509779.index new file mode 100644 index 0000000..f1da509 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1116509779.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1168452787.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1168452787.index new file mode 100644 index 0000000..6d91979 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1168452787.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118079239.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118079239.index new file mode 100644 index 0000000..d0cb29a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118079239.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118177265.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118177265.index new file mode 100644 index 0000000..f18205e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118177265.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/123952833.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/123952833.index new file mode 100644 index 0000000..1f18c01 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/123952833.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1248057480.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1248057480.index new file mode 100644 index 0000000..8b0dc87 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1248057480.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1263197505.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1263197505.index new file mode 100644 index 0000000..1cbbb22 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1263197505.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1264401237.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1264401237.index new file mode 100644 index 0000000..65dbb2b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1264401237.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1268387587.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1268387587.index new file mode 100644 index 0000000..bcf3ffb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1268387587.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1276423060.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1276423060.index new file mode 100644 index 0000000..12ba997 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1276423060.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1288848795.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1288848795.index new file mode 100644 index 0000000..4e2b858 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1288848795.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1366528673.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1366528673.index new file mode 100644 index 0000000..a7ea42b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1366528673.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1477564565.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1477564565.index new file mode 100644 index 0000000..cc4d1e2 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1477564565.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1486755727.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1486755727.index new file mode 100644 index 0000000..4dc3398 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1486755727.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1496602457.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1496602457.index new file mode 100644 index 0000000..ad1308b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1496602457.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1498812018.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1498812018.index new file mode 100644 index 0000000..05303d1 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1498812018.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1530863712.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1530863712.index new file mode 100644 index 0000000..653a780 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1530863712.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1583742974.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1583742974.index new file mode 100644 index 0000000..698adc7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1583742974.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1600618069.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1600618069.index new file mode 100644 index 0000000..61a5184 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1600618069.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1630223746.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1630223746.index new file mode 100644 index 0000000..77e31e4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1630223746.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1656198938.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1656198938.index new file mode 100644 index 0000000..c070f8e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1656198938.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/167095799.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/167095799.index new file mode 100644 index 0000000..d42dbe5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/167095799.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/170310106.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/170310106.index new file mode 100644 index 0000000..70c27e0 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/170310106.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1708845102.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1708845102.index new file mode 100644 index 0000000..5387109 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1708845102.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1720041196.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1720041196.index new file mode 100644 index 0000000..86dbbd4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1720041196.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1724015195.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1724015195.index new file mode 100644 index 0000000..f0b297e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1724015195.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1729206139.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1729206139.index new file mode 100644 index 0000000..a7ea42b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1729206139.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1761685600.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1761685600.index new file mode 100644 index 0000000..fa15a95 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1761685600.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/181390952.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/181390952.index new file mode 100644 index 0000000..86ecad3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/181390952.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1838715693.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1838715693.index new file mode 100644 index 0000000..61a2a0a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1838715693.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1856535067.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1856535067.index new file mode 100644 index 0000000..dccf438 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1856535067.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index new file mode 100644 index 0000000..63d8ecb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1865797976.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1926820160.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1926820160.index new file mode 100644 index 0000000..2563cef Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1926820160.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1954745109.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1954745109.index new file mode 100644 index 0000000..462504a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1954745109.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1979030157.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1979030157.index new file mode 100644 index 0000000..6773dcf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1979030157.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1993618118.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1993618118.index new file mode 100644 index 0000000..a117c47 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1993618118.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1996626533.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1996626533.index new file mode 100644 index 0000000..c8fd6aa Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1996626533.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2013921818.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2013921818.index new file mode 100644 index 0000000..27596f5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2013921818.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2057198852.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2057198852.index new file mode 100644 index 0000000..f9e8e2f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2057198852.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2078297833.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2078297833.index new file mode 100644 index 0000000..4d81e60 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2078297833.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2080572071.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2080572071.index new file mode 100644 index 0000000..5806c7c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2080572071.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2083000438.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2083000438.index new file mode 100644 index 0000000..35a7e5e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2083000438.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2120117949.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2120117949.index new file mode 100644 index 0000000..6d91979 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2120117949.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2177911589.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2177911589.index new file mode 100644 index 0000000..4137815 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2177911589.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2226814426.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2226814426.index new file mode 100644 index 0000000..33274cf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2226814426.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2255887820.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2255887820.index new file mode 100644 index 0000000..0004deb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2255887820.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2257654521.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2257654521.index new file mode 100644 index 0000000..b4b7106 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2257654521.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272666844.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272666844.index new file mode 100644 index 0000000..eedd64a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272666844.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272677580.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272677580.index new file mode 100644 index 0000000..2c47671 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2272677580.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2296612334.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2296612334.index new file mode 100644 index 0000000..75a01ec Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2296612334.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2347240131.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2347240131.index new file mode 100644 index 0000000..f3e62fa Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2347240131.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2365729660.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2365729660.index new file mode 100644 index 0000000..fa2fbb7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2365729660.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2405544539.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2405544539.index new file mode 100644 index 0000000..dfe48c3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2405544539.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2430787885.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2430787885.index new file mode 100644 index 0000000..a15d6df Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2430787885.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/243595922.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/243595922.index new file mode 100644 index 0000000..983f66c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/243595922.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2496732948.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2496732948.index new file mode 100644 index 0000000..4d2bb66 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2496732948.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2525857003.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2525857003.index new file mode 100644 index 0000000..7d1eb01 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2525857003.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/253328173.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/253328173.index new file mode 100644 index 0000000..cf763ee Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/253328173.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540692146.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540692146.index new file mode 100644 index 0000000..8adef51 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2540692146.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2587357619.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2587357619.index new file mode 100644 index 0000000..7fe2d66 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2587357619.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2610069676.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2610069676.index new file mode 100644 index 0000000..a672bee Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2610069676.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2662529213.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2662529213.index new file mode 100644 index 0000000..d92b202 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2662529213.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2669585905.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2669585905.index new file mode 100644 index 0000000..f9e8e2f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2669585905.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722967473.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722967473.index new file mode 100644 index 0000000..f1300d5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2722967473.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2761904235.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2761904235.index new file mode 100644 index 0000000..8dae28f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2761904235.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2799562941.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2799562941.index new file mode 100644 index 0000000..3d17eb5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2799562941.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/284091021.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/284091021.index new file mode 100644 index 0000000..5a0544c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/284091021.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2935145643.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2935145643.index new file mode 100644 index 0000000..458ea84 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2935145643.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2952575823.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2952575823.index new file mode 100644 index 0000000..0bf8355 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2952575823.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2973190431.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2973190431.index new file mode 100644 index 0000000..5dd38a7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2973190431.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016126191.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016126191.index new file mode 100644 index 0000000..c9557e6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016126191.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3068134824.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3068134824.index new file mode 100644 index 0000000..0bf8355 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3068134824.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3110080150.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3110080150.index new file mode 100644 index 0000000..19e3122 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3110080150.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3123132306.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3123132306.index new file mode 100644 index 0000000..4d2bb66 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3123132306.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3131650575.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3131650575.index new file mode 100644 index 0000000..17a6c87 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3131650575.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/318969058.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/318969058.index new file mode 100644 index 0000000..cb6bfca Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/318969058.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3236879431.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3236879431.index new file mode 100644 index 0000000..0cd78dc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3236879431.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3242683152.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3242683152.index new file mode 100644 index 0000000..af099f7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3242683152.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3405095476.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3405095476.index new file mode 100644 index 0000000..6581aa7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3405095476.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3417465047.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3417465047.index new file mode 100644 index 0000000..3d17eb5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3417465047.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3553742420.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3553742420.index new file mode 100644 index 0000000..1883acb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3553742420.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3555704746.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3555704746.index new file mode 100644 index 0000000..8adef51 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3555704746.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3636573462.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3636573462.index new file mode 100644 index 0000000..b3b2a67 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3636573462.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3662121327.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3662121327.index new file mode 100644 index 0000000..d9ff5d5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3662121327.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3735579623.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3735579623.index new file mode 100644 index 0000000..7a35f76 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3735579623.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3739896979.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3739896979.index new file mode 100644 index 0000000..a7ea42b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3739896979.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/375613864.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/375613864.index new file mode 100644 index 0000000..00cd71a Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/375613864.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3762385791.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3762385791.index new file mode 100644 index 0000000..5dd38a7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3762385791.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3827799912.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3827799912.index new file mode 100644 index 0000000..717b78b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3827799912.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3842368364.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3842368364.index new file mode 100644 index 0000000..65dbb2b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3842368364.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3853350567.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3853350567.index new file mode 100644 index 0000000..47f9161 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3853350567.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3854355324.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3854355324.index new file mode 100644 index 0000000..02af646 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3854355324.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/392812352.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/392812352.index new file mode 100644 index 0000000..1d1c678 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/392812352.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4079564674.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4079564674.index new file mode 100644 index 0000000..1c67feb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4079564674.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/409104238.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/409104238.index new file mode 100644 index 0000000..d8f9700 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/409104238.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4132463565.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4132463565.index new file mode 100644 index 0000000..da6a508 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4132463565.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4142422520.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4142422520.index new file mode 100644 index 0000000..36f8663 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4142422520.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4146044063.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4146044063.index new file mode 100644 index 0000000..cd7defc Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4146044063.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4172939092.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4172939092.index new file mode 100644 index 0000000..ccb1764 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4172939092.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4182853878.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4182853878.index new file mode 100644 index 0000000..4fc6503 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4182853878.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4212663474.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4212663474.index new file mode 100644 index 0000000..a27abb4 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4212663474.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242027366.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242027366.index new file mode 100644 index 0000000..a2a302e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242027366.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242053052.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242053052.index new file mode 100644 index 0000000..ca6adeb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4242053052.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4292542916.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4292542916.index new file mode 100644 index 0000000..11f95c7 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4292542916.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/430743122.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/430743122.index new file mode 100644 index 0000000..fdd028c Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/430743122.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/461597716.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/461597716.index new file mode 100644 index 0000000..a9c07ec Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/461597716.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/486169147.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/486169147.index new file mode 100644 index 0000000..c067a23 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/486169147.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/494383298.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/494383298.index new file mode 100644 index 0000000..e4027d3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/494383298.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/524378579.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/524378579.index new file mode 100644 index 0000000..5849c8f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/524378579.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/563660861.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/563660861.index new file mode 100644 index 0000000..3ec1ea3 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/563660861.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/592434314.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/592434314.index new file mode 100644 index 0000000..f9e8e2f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/592434314.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/720419634.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/720419634.index new file mode 100644 index 0000000..e4a095b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/720419634.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/73101382.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/73101382.index new file mode 100644 index 0000000..d215e10 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/73101382.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/733884751.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/733884751.index new file mode 100644 index 0000000..0004deb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/733884751.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/755304339.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/755304339.index new file mode 100644 index 0000000..e219d9e Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/755304339.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/761072253.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/761072253.index new file mode 100644 index 0000000..1e30e66 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/761072253.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/783489491.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/783489491.index new file mode 100644 index 0000000..a117c47 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/783489491.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/821402247.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/821402247.index new file mode 100644 index 0000000..2273d72 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/821402247.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/824723253.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/824723253.index new file mode 100644 index 0000000..b3b2a67 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/824723253.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/87823424.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/87823424.index new file mode 100644 index 0000000..5578f32 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/87823424.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/915505756.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/915505756.index new file mode 100644 index 0000000..0004deb Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/915505756.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/93456551.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/93456551.index new file mode 100644 index 0000000..4fa2aaf Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/93456551.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/965781863.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/965781863.index new file mode 100644 index 0000000..bb94bc1 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/965781863.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/972952685.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/972952685.index new file mode 100644 index 0000000..c6a5cf5 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/972952685.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/983264228.index b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/983264228.index new file mode 100644 index 0000000..4f763f6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/983264228.index differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000..a92114b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..7b5af1f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt new file mode 100644 index 0000000..cfc6fb9 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt @@ -0,0 +1 @@ +INDEX VERSION 1.131 diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000..38970f6 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..cca5ea4 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1,129 @@ +INDEX VERSION 1.134+C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\.metadata\.plugins\org.eclipse.jdt.core +1486755727.index +1761685600.index +1530863712.index +563660861.index +2120117949.index +1276423060.index +1993618118.index +111226251.index +4242053052.index +915505756.index +733884751.index +4182853878.index +3405095476.index +1600618069.index +1268387587.index +2257654521.index +2405544539.index +2430787885.index +2799562941.index +1264401237.index +824723253.index +3553742420.index +2083000438.index +1979030157.index +2080572071.index +1496602457.index +2662529213.index +2722967473.index +392812352.index +755304339.index +1263197505.index +253328173.index +4146044063.index +1729206139.index +284091021.index +4142422520.index +1856535067.index +430743122.index +524378579.index +2669585905.index +821402247.index +2078297833.index +1248057480.index +4172939092.index +2272666844.index +1656198938.index +2952575823.index +1288848795.index +494383298.index +3662121327.index +4212663474.index +2296612334.index +118079239.index +2761904235.index +3555704746.index +3131650575.index +1168452787.index +3636573462.index +3842368364.index +1058546050.index +720419634.index +2057198852.index +2347240131.index +1037454467.index +318969058.index +93456551.index +3236879431.index +1708845102.index +3068134824.index +4242027366.index +1366528673.index +243595922.index +1954745109.index +118177265.index +2496732948.index +4132463565.index +123952833.index +3242683152.index +783489491.index +3854355324.index +1996626533.index +983264228.index +3110080150.index +2177911589.index +87823424.index +2013921818.index +2610069676.index +1116509779.index +2365729660.index +4292542916.index +972952685.index +1583742974.index +2587357619.index +1838715693.index +3735579623.index +3827799912.index +2255887820.index +486169147.index +2226814426.index +3123132306.index +1724015195.index +1630223746.index +2540692146.index +1477564565.index +965781863.index +2525857003.index +170310106.index +1720041196.index +409104238.index +3739896979.index +375613864.index +761072253.index +3417465047.index +2935145643.index +3016126191.index +592434314.index +1865797976.index +4079564674.index +1926820160.index +181390952.index +2973190431.index +1498812018.index +3762385791.index +461597716.index +73101382.index +3853350567.index +167095799.index +2272677580.index diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..3a0c2ae Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..7ae6dd4 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml @@ -0,0 +1,14 @@ + +
+
+ + +
+ + + + + +
+
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..0843b16 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..49a2fc1 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..712b513 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml new file mode 100644 index 0000000..a939485 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -0,0 +1,77 @@ + +
+ + + + + + +
+ + + + + +
+
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + +
+
+
+
+ + + + + +
+
+ + + + + +
+
+ +
+
+ + +
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.history b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.history new file mode 100644 index 0000000..33279d2 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.history @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.index b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.index new file mode 100644 index 0000000..2014813 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/10/43/refactorings.index @@ -0,0 +1 @@ +1634663597340 Rename Java project 'NetBeans_ch01_FutureValueConsole' diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.history b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.history new file mode 100644 index 0000000..303f1fc --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.history @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.index b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.index new file mode 100644 index 0000000..80a11f7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/46/refactorings.index @@ -0,0 +1,7 @@ +1636414887885 Delete 25 resources +1636417023993 Delete 17 resources +1636417031823 Delete 11 resources +1636417039245 Delete 17 resources +1636417048042 Delete 2 resources +1636418021245 Delete 8 resources +1636419547800 Delete 48 resources diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.history b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.history new file mode 100644 index 0000000..112f6aa --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.history @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.index b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.index new file mode 100644 index 0000000..74825f3 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2021/11/47/refactorings.index @@ -0,0 +1,8 @@ +1637163691372 Delete 27 resources +1637163866822 Delete 47 resources +1637163997054 Delete 48 resources +1637173891674 Delete 27 resources +1637174023215 Delete 27 resources +1637174120946 Delete 45 resources +1637174126125 Delete 2 resources +1637174419991 Delete 48 resources diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.history b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.history new file mode 100644 index 0000000..e49e2f2 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.history @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.index b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.index new file mode 100644 index 0000000..8003060 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2024/12/52/refactorings.index @@ -0,0 +1,2 @@ +1735223518500 Delete resource 'ch01_ex1_Invoice' +1735223595202 Delete resource 'ch01_ex2_TestScore' diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml new file mode 100644 index 0000000..026efbc --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml @@ -0,0 +1,12 @@ + +
+
+ + +
+
+ + + +
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser new file mode 100644 index 0000000..f64c77b Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspacestate.properties b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspacestate.properties new file mode 100644 index 0000000..d5e0e2b --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.core/workspacestate.properties @@ -0,0 +1,34 @@ +#Thu Dec 26 09:21:51 EST 2024 +Murach\:ch13_SocialMediaSignup\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch13_SocialMediaSignup\\target\\classes +Murach\:ch13_SocialMediaSignup\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch13_SocialMediaSignup\\target\\test-classes +Murach\:ch13_SocialMediaSignup\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch13_SocialMediaSignup\\pom.xml +Murach\:ch13_ex2_PizzaCalculator\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex2_PizzaCalculator\\target\\classes +Murach\:ch13_ex2_PizzaCalculator\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex2_PizzaCalculator_sol\\target\\test-classes +Murach\:ch13_ex2_PizzaCalculator\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex2_PizzaCalculator\\pom.xml +com.murach\:ch01_FutureValueGUI\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch01_FutureValueGUI\\target\\classes +com.murach\:ch01_FutureValueGUI\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch01_FutureValueGUI\\target\\test-classes +com.murach\:ch01_FutureValueGUI\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch01_FutureValueGUI\\pom.xml +com.murach\:ch12_ex1_MPG\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex1_MPG\\target\\classes +com.murach\:ch12_ex1_MPG\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex1_MPG\\target\\test-classes +com.murach\:ch12_ex1_MPG\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex1_MPG\\pom.xml +com.murach\:ch12_ex1_MPG_sol\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex1_MPG_sol\\target\\classes +com.murach\:ch12_ex1_MPG_sol\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex1_MPG_sol\\target\\test-classes +com.murach\:ch12_ex1_MPG_sol\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex1_MPG_sol\\pom.xml +com.murach\:ch12_ex2_MPG\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex2_MPG\\target\\classes +com.murach\:ch12_ex2_MPG\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex2_MPG\\target\\test-classes +com.murach\:ch12_ex2_MPG\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex2_MPG\\pom.xml +com.murach\:ch12_ex2_MPG_sol\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex2_MPG_sol\\target\\classes +com.murach\:ch12_ex2_MPG_sol\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex2_MPG_sol\\target\\test-classes +com.murach\:ch12_ex2_MPG_sol\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex2_MPG_sol\\pom.xml +com.murach\:ch13_ex1_FutureValue\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex1_FutureValue\\target\\classes +com.murach\:ch13_ex1_FutureValue\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex1_FutureValue\\target\\test-classes +com.murach\:ch13_ex1_FutureValue\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex1_FutureValue\\pom.xml +com.murach\:ch13_ex1_FutureValue_sol\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex1_FutureValue_sol\\target\\classes +com.murach\:ch13_ex1_FutureValue_sol\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex1_FutureValue_sol\\target\\test-classes +com.murach\:ch13_ex1_FutureValue_sol\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex1_FutureValue_sol\\pom.xml +murach\:ch12_FutureValue\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValue\\target\\classes +murach\:ch12_FutureValue\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValue\\target\\test-classes +murach\:ch12_FutureValue\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValue\\pom.xml +murach\:ch12_FutureValueValidation\:jar\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValueValidation\\target\\classes +murach\:ch12_FutureValueValidation\:jar\:tests\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValueValidation\\target\\test-classes +murach\:ch12_FutureValueValidation\:pom\:\:1.0-SNAPSHOT=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValueValidation\\pom.xml diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch01_FutureValueGUI.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch01_FutureValueGUI.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch01_FutureValueGUI.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValue.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValue.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValue.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValueValidation.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValueValidation.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_FutureValueValidation.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG_sol.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG_sol.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex1_MPG_sol.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG_sol.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG_sol.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch12_ex2_MPG_sol.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_SocialMediaSignup.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_SocialMediaSignup.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_SocialMediaSignup.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue_sol.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue_sol.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex1_FutureValue_sol.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator_sol.container b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator_sol.container new file mode 100644 index 0000000..aa8758f Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.jdt/ch13_ex2_PizzaCalculator_sol.container differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/0.log b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/0.log new file mode 100644 index 0000000..20db1aa --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/0.log @@ -0,0 +1,536 @@ +2024-12-26 09:16:59,187 [Worker-7: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is not available. Remote download required. +2024-12-26 09:17:58,077 [Worker-5: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read. +2024-12-26 09:21:42,002 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.jar +2024-12-26 09:21:42,042 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.jar +2024-12-26 09:21:42,060 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.1/maven-resources-plugin-3.3.1.jar +2024-12-26 09:21:42,066 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.1/maven-resources-plugin-3.3.1.jar +2024-12-26 09:21:42,079 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.jar +2024-12-26 09:21:42,087 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.jar +2024-12-26 09:21:42,105 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.jar +2024-12-26 09:21:42,112 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.jar +2024-12-26 09:21:42,125 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.jar +2024-12-26 09:21:42,132 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.jar +2024-12-26 09:21:42,149 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/3.1.2/maven-install-plugin-3.1.2.jar +2024-12-26 09:21:42,156 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/3.1.2/maven-install-plugin-3.1.2.jar +2024-12-26 09:21:42,170 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/3.1.2/maven-deploy-plugin-3.1.2.jar +2024-12-26 09:21:42,176 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/3.1.2/maven-deploy-plugin-3.1.2.jar +2024-12-26 09:21:42,189 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.12.1/maven-site-plugin-3.12.1.jar +2024-12-26 09:21:42,200 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.12.1/maven-site-plugin-3.12.1.jar +2024-12-26 09:21:42,246 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.pom +2024-12-26 09:21:42,250 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.pom +2024-12-26 09:21:42,289 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/32/maven-plugins-32.pom +2024-12-26 09:21:42,293 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/32/maven-plugins-32.pom +2024-12-26 09:21:42,305 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/32/maven-parent-32.pom +2024-12-26 09:21:42,311 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/32/maven-parent-32.pom +2024-12-26 09:21:42,329 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom +2024-12-26 09:21:42,333 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/20/apache-20.pom +2024-12-26 09:21:42,419 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom +2024-12-26 09:21:42,423 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom +2024-12-26 09:21:42,437 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven/3.0/maven-3.0.pom +2024-12-26 09:21:42,443 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven/3.0/maven-3.0.pom +2024-12-26 09:21:42,456 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/15/maven-parent-15.pom +2024-12-26 09:21:42,461 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/15/maven-parent-15.pom +2024-12-26 09:21:42,472 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.pom +2024-12-26 09:21:42,476 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/6/apache-6.pom +2024-12-26 09:21:42,494 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/3.0/maven-model-3.0.pom +2024-12-26 09:21:42,498 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/3.0/maven-model-3.0.pom +2024-12-26 09:21:42,522 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom +2024-12-26 09:21:42,525 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom +2024-12-26 09:21:42,537 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom +2024-12-26 09:21:42,541 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom +2024-12-26 09:21:42,554 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom +2024-12-26 09:21:42,558 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom +2024-12-26 09:21:42,574 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom +2024-12-26 09:21:42,578 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom +2024-12-26 09:21:42,590 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom +2024-12-26 09:21:42,594 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom +2024-12-26 09:21:42,606 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom +2024-12-26 09:21:42,611 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom +2024-12-26 09:21:42,622 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom +2024-12-26 09:21:42,627 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom +2024-12-26 09:21:42,639 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom +2024-12-26 09:21:42,643 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom +2024-12-26 09:21:42,656 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/6/forge-parent-6.pom +2024-12-26 09:21:42,662 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/6/forge-parent-6.pom +2024-12-26 09:21:42,678 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.pom +2024-12-26 09:21:42,681 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.pom +2024-12-26 09:21:42,694 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-containers/1.7.1/plexus-containers-1.7.1.pom +2024-12-26 09:21:42,697 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-containers/1.7.1/plexus-containers-1.7.1.pom +2024-12-26 09:21:42,710 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/4.0/plexus-4.0.pom +2024-12-26 09:21:42,714 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/4.0/plexus-4.0.pom +2024-12-26 09:21:42,726 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/10/forge-parent-10.pom +2024-12-26 09:21:42,730 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/10/forge-parent-10.pom +2024-12-26 09:21:42,744 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom +2024-12-26 09:21:42,749 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom +2024-12-26 09:21:42,762 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom +2024-12-26 09:21:42,766 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom +2024-12-26 09:21:42,781 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom +2024-12-26 09:21:42,784 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom +2024-12-26 09:21:42,798 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom +2024-12-26 09:21:42,803 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom +2024-12-26 09:21:42,816 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0/maven-core-3.0.pom +2024-12-26 09:21:42,820 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0/maven-core-3.0.pom +2024-12-26 09:21:42,837 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom +2024-12-26 09:21:42,842 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom +2024-12-26 09:21:42,859 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom +2024-12-26 09:21:42,863 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom +2024-12-26 09:21:42,878 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom +2024-12-26 09:21:42,883 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom +2024-12-26 09:21:42,894 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom +2024-12-26 09:21:42,898 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom +2024-12-26 09:21:42,911 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom +2024-12-26 09:21:42,916 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom +2024-12-26 09:21:42,933 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom +2024-12-26 09:21:42,938 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom +2024-12-26 09:21:42,953 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/12/spice-parent-12.pom +2024-12-26 09:21:42,957 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/12/spice-parent-12.pom +2024-12-26 09:21:42,968 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/4/forge-parent-4.pom +2024-12-26 09:21:42,973 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/4/forge-parent-4.pom +2024-12-26 09:21:42,986 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom +2024-12-26 09:21:42,991 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom +2024-12-26 09:21:43,003 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom +2024-12-26 09:21:43,006 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom +2024-12-26 09:21:43,019 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom +2024-12-26 09:21:43,023 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom +2024-12-26 09:21:43,036 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom +2024-12-26 09:21:43,040 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom +2024-12-26 09:21:43,059 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom +2024-12-26 09:21:43,063 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom +2024-12-26 09:21:43,078 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom +2024-12-26 09:21:43,083 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom +2024-12-26 09:21:43,098 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom +2024-12-26 09:21:43,101 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom +2024-12-26 09:21:43,114 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom +2024-12-26 09:21:43,118 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom +2024-12-26 09:21:43,130 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom +2024-12-26 09:21:43,135 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom +2024-12-26 09:21:43,148 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom +2024-12-26 09:21:43,152 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom +2024-12-26 09:21:43,165 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom +2024-12-26 09:21:43,169 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom +2024-12-26 09:21:43,184 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.pom +2024-12-26 09:21:43,188 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.pom +2024-12-26 09:21:43,202 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/30/maven-shared-components-30.pom +2024-12-26 09:21:43,207 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/30/maven-shared-components-30.pom +2024-12-26 09:21:43,219 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/30/maven-parent-30.pom +2024-12-26 09:21:43,223 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/30/maven-parent-30.pom +2024-12-26 09:21:43,235 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/18/apache-18.pom +2024-12-26 09:21:43,240 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/18/apache-18.pom +2024-12-26 09:21:43,254 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.pom +2024-12-26 09:21:43,258 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.pom +2024-12-26 09:21:43,272 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom +2024-12-26 09:21:43,277 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom +2024-12-26 09:21:43,291 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/16/apache-16.pom +2024-12-26 09:21:43,296 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/16/apache-16.pom +2024-12-26 09:21:43,312 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.pom +2024-12-26 09:21:43,317 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.pom +2024-12-26 09:21:43,330 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom +2024-12-26 09:21:43,335 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom +2024-12-26 09:21:43,346 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom +2024-12-26 09:21:43,350 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom +2024-12-26 09:21:43,362 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/13/apache-13.pom +2024-12-26 09:21:43,366 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/13/apache-13.pom +2024-12-26 09:21:43,378 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom +2024-12-26 09:21:43,381 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom +2024-12-26 09:21:43,393 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.2.1/maven-2.2.1.pom +2024-12-26 09:21:43,397 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.2.1/maven-2.2.1.pom +2024-12-26 09:21:43,408 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/11/maven-parent-11.pom +2024-12-26 09:21:43,412 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/11/maven-parent-11.pom +2024-12-26 09:21:43,423 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/5/apache-5.pom +2024-12-26 09:21:43,427 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/5/apache-5.pom +2024-12-26 09:21:43,440 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.pom +2024-12-26 09:21:43,444 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.pom +2024-12-26 09:21:43,457 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom +2024-12-26 09:21:43,461 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom +2024-12-26 09:21:43,492 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom +2024-12-26 09:21:43,497 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom +2024-12-26 09:21:43,510 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom +2024-12-26 09:21:43,514 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom +2024-12-26 09:21:43,526 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom +2024-12-26 09:21:43,530 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom +2024-12-26 09:21:43,543 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom +2024-12-26 09:21:43,547 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom +2024-12-26 09:21:43,558 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom +2024-12-26 09:21:43,561 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom +2024-12-26 09:21:43,574 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom +2024-12-26 09:21:43,577 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom +2024-12-26 09:21:43,591 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom +2024-12-26 09:21:43,595 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom +2024-12-26 09:21:43,607 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom +2024-12-26 09:21:43,611 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom +2024-12-26 09:21:43,626 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom +2024-12-26 09:21:43,631 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom +2024-12-26 09:21:43,645 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom +2024-12-26 09:21:43,650 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom +2024-12-26 09:21:43,663 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom +2024-12-26 09:21:43,666 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom +2024-12-26 09:21:43,679 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom +2024-12-26 09:21:43,682 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom +2024-12-26 09:21:43,695 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.pom +2024-12-26 09:21:43,699 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.pom +2024-12-26 09:21:43,714 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.pom +2024-12-26 09:21:43,717 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.pom +2024-12-26 09:21:43,730 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom +2024-12-26 09:21:43,733 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom +2024-12-26 09:21:43,747 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.pom +2024-12-26 09:21:43,751 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.pom +2024-12-26 09:21:43,764 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom +2024-12-26 09:21:43,769 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom +2024-12-26 09:21:43,780 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.pom +2024-12-26 09:21:43,785 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.pom +2024-12-26 09:21:43,798 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-descriptor-2.2.1.pom +2024-12-26 09:21:43,802 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-descriptor-2.2.1.pom +2024-12-26 09:21:43,815 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom +2024-12-26 09:21:43,820 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom +2024-12-26 09:21:43,832 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom +2024-12-26 09:21:43,836 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom +2024-12-26 09:21:43,847 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/18/maven-shared-components-18.pom +2024-12-26 09:21:43,852 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/18/maven-shared-components-18.pom +2024-12-26 09:21:43,863 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/22/maven-parent-22.pom +2024-12-26 09:21:43,869 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/22/maven-parent-22.pom +2024-12-26 09:21:43,884 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/11/apache-11.pom +2024-12-26 09:21:43,888 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/11/apache-11.pom +2024-12-26 09:21:43,902 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom +2024-12-26 09:21:43,905 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom +2024-12-26 09:21:43,918 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.10/plexus-java-0.9.10.pom +2024-12-26 09:21:43,922 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.10/plexus-java-0.9.10.pom +2024-12-26 09:21:43,933 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-languages/0.9.10/plexus-languages-0.9.10.pom +2024-12-26 09:21:43,938 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-languages/0.9.10/plexus-languages-0.9.10.pom +2024-12-26 09:21:43,952 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.2/asm-6.2.pom +2024-12-26 09:21:43,957 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.2/asm-6.2.pom +2024-12-26 09:21:43,969 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/ow2/ow2/1.5/ow2-1.5.pom +2024-12-26 09:21:43,974 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/ow2/ow2/1.5/ow2-1.5.pom +2024-12-26 09:21:43,986 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.pom +2024-12-26 09:21:43,991 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.pom +2024-12-26 09:21:44,009 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom +2024-12-26 09:21:44,013 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom +2024-12-26 09:21:44,027 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.pom +2024-12-26 09:21:44,031 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.pom +2024-12-26 09:21:44,042 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.8.4/plexus-compiler-2.8.4.pom +2024-12-26 09:21:44,046 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler/2.8.4/plexus-compiler-2.8.4.pom +2024-12-26 09:21:44,058 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/4.0/plexus-components-4.0.pom +2024-12-26 09:21:44,061 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-components/4.0/plexus-components-4.0.pom +2024-12-26 09:21:44,073 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.pom +2024-12-26 09:21:44,077 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.pom +2024-12-26 09:21:44,088 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom +2024-12-26 09:21:44,092 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom +2024-12-26 09:21:44,104 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/17/spice-parent-17.pom +2024-12-26 09:21:44,108 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/17/spice-parent-17.pom +2024-12-26 09:21:44,121 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.pom +2024-12-26 09:21:44,126 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.pom +2024-12-26 09:21:44,138 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.pom +2024-12-26 09:21:44,143 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.pom +2024-12-26 09:21:44,155 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compilers/2.8.4/plexus-compilers-2.8.4.pom +2024-12-26 09:21:44,159 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compilers/2.8.4/plexus-compilers-2.8.4.pom +2024-12-26 09:21:44,215 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.jar +2024-12-26 09:21:44,219 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.jar +2024-12-26 09:21:44,229 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/3.0/maven-model-3.0.jar +2024-12-26 09:21:44,238 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/3.0/maven-model-3.0.jar +2024-12-26 09:21:44,244 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.jar +2024-12-26 09:21:44,245 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar +2024-12-26 09:21:44,246 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar +2024-12-26 09:21:44,247 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.jar +2024-12-26 09:21:44,248 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar +2024-12-26 09:21:44,256 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.jar +2024-12-26 09:21:44,262 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0/maven-core-3.0.jar +2024-12-26 09:21:44,262 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.jar +2024-12-26 09:21:44,269 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/3.0/maven-settings-3.0.jar +2024-12-26 09:21:44,270 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar +2024-12-26 09:21:44,273 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar +2024-12-26 09:21:44,274 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/3.0/maven-settings-3.0.jar +2024-12-26 09:21:44,276 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.jar +2024-12-26 09:21:44,280 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.jar +2024-12-26 09:21:44,280 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.jar +2024-12-26 09:21:44,281 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.jar +2024-12-26 09:21:44,283 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.jar +2024-12-26 09:21:44,287 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.jar +2024-12-26 09:21:44,289 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.jar +2024-12-26 09:21:44,291 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.jar +2024-12-26 09:21:44,295 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.jar +2024-12-26 09:21:44,297 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar +2024-12-26 09:21:44,298 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.jar +2024-12-26 09:21:44,299 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.jar +2024-12-26 09:21:44,302 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-api/1.7/aether-api-1.7.jar +2024-12-26 09:21:44,302 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/3.0/maven-core-3.0.jar +2024-12-26 09:21:44,303 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar +2024-12-26 09:21:44,304 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.jar +2024-12-26 09:21:44,305 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar +2024-12-26 09:21:44,309 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar +2024-12-26 09:21:44,309 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.jar +2024-12-26 09:21:44,311 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-api/1.7/aether-api-1.7.jar +2024-12-26 09:21:44,312 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar +2024-12-26 09:21:44,314 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar +2024-12-26 09:21:44,315 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.jar +2024-12-26 09:21:44,316 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar +2024-12-26 09:21:44,316 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar +2024-12-26 09:21:44,317 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar +2024-12-26 09:21:44,320 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar +2024-12-26 09:21:44,320 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar +2024-12-26 09:21:44,320 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar +2024-12-26 09:21:44,322 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.jar +2024-12-26 09:21:44,322 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar +2024-12-26 09:21:44,325 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.10/plexus-java-0.9.10.jar +2024-12-26 09:21:44,326 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar +2024-12-26 09:21:44,327 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.2/asm-6.2.jar +2024-12-26 09:21:44,330 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.10/plexus-java-0.9.10.jar +2024-12-26 09:21:44,331 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.2/asm-6.2.jar +2024-12-26 09:21:44,332 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar +2024-12-26 09:21:44,336 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.jar +2024-12-26 09:21:44,338 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.jar +2024-12-26 09:21:44,341 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.jar +2024-12-26 09:21:44,342 [BasicRepositoryConnector-repo.maven.apache.org-0-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.jar +2024-12-26 09:21:44,345 [BasicRepositoryConnector-repo.maven.apache.org-0-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.jar +2024-12-26 09:21:44,348 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.jar +2024-12-26 09:21:44,353 [BasicRepositoryConnector-repo.maven.apache.org-0-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.jar +2024-12-26 09:21:44,354 [BasicRepositoryConnector-repo.maven.apache.org-0-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar +2024-12-26 09:21:44,360 [BasicRepositoryConnector-repo.maven.apache.org-0-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar +2024-12-26 09:21:44,662 [Worker-62: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch01_FutureValueGUI:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch01_FutureValueGUI\pom.xml. +2024-12-26 09:21:44,662 [Worker-87: Updating Maven Dependencies] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch12_ex1_MPG:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex1_MPG\pom.xml. +2024-12-26 09:21:44,697 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13.pom +2024-12-26 09:21:44,701 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13.pom +2024-12-26 09:21:44,721 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx/13/javafx-13.pom +2024-12-26 09:21:44,724 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx/13/javafx-13.pom +2024-12-26 09:21:44,741 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13.pom +2024-12-26 09:21:44,745 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13.pom +2024-12-26 09:21:44,768 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13.pom +2024-12-26 09:21:44,772 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13.pom +2024-12-26 09:21:44,789 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13.jar +2024-12-26 09:21:44,793 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13.jar +2024-12-26 09:21:44,803 [BasicRepositoryConnector-repo.maven.apache.org-1-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13-win.jar +2024-12-26 09:21:44,813 [BasicRepositoryConnector-repo.maven.apache.org-1-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13.jar +2024-12-26 09:21:44,816 [BasicRepositoryConnector-repo.maven.apache.org-1-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13-win.jar +2024-12-26 09:21:44,817 [BasicRepositoryConnector-repo.maven.apache.org-1-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13.jar +2024-12-26 09:21:44,820 [BasicRepositoryConnector-repo.maven.apache.org-1-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13.jar +2024-12-26 09:21:44,823 [BasicRepositoryConnector-repo.maven.apache.org-1-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13-win.jar +2024-12-26 09:21:44,824 [BasicRepositoryConnector-repo.maven.apache.org-1-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13.jar +2024-12-26 09:21:44,848 [BasicRepositoryConnector-repo.maven.apache.org-1-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13-win.jar +2024-12-26 09:21:44,873 [BasicRepositoryConnector-repo.maven.apache.org-1-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13-win.jar +2024-12-26 09:21:44,997 [BasicRepositoryConnector-repo.maven.apache.org-1-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13-win.jar +2024-12-26 09:21:45,034 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.1/maven-resources-plugin-3.3.1.pom +2024-12-26 09:21:45,037 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.3.1/maven-resources-plugin-3.3.1.pom +2024-12-26 09:21:45,049 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/39/maven-plugins-39.pom +2024-12-26 09:21:45,053 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/39/maven-plugins-39.pom +2024-12-26 09:21:45,065 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/39/maven-parent-39.pom +2024-12-26 09:21:45,069 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/39/maven-parent-39.pom +2024-12-26 09:21:45,083 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/29/apache-29.pom +2024-12-26 09:21:45,087 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/29/apache-29.pom +2024-12-26 09:21:45,105 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.pom +2024-12-26 09:21:45,108 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/3.2.5/maven-surefire-plugin-3.2.5.pom +2024-12-26 09:21:45,121 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/3.2.5/surefire-3.2.5.pom +2024-12-26 09:21:45,125 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/3.2.5/surefire-3.2.5.pom +2024-12-26 09:21:45,139 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/41/maven-parent-41.pom +2024-12-26 09:21:45,143 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/41/maven-parent-41.pom +2024-12-26 09:21:45,156 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/31/apache-31.pom +2024-12-26 09:21:45,161 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/31/apache-31.pom +2024-12-26 09:21:45,175 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.9.3/junit-bom-5.9.3.pom +2024-12-26 09:21:45,178 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.9.3/junit-bom-5.9.3.pom +2024-12-26 09:21:45,201 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.pom +2024-12-26 09:21:45,204 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/3.4.1/maven-jar-plugin-3.4.1.pom +2024-12-26 09:21:45,217 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/42/maven-plugins-42.pom +2024-12-26 09:21:45,221 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/42/maven-plugins-42.pom +2024-12-26 09:21:45,235 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/42/maven-parent-42.pom +2024-12-26 09:21:45,240 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/42/maven-parent-42.pom +2024-12-26 09:21:45,299 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/32/apache-32.pom +2024-12-26 09:21:45,316 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/32/apache-32.pom +2024-12-26 09:21:45,331 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.2/junit-bom-5.10.2.pom +2024-12-26 09:21:45,334 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.2/junit-bom-5.10.2.pom +2024-12-26 09:21:45,359 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/file-management/3.1.0/file-management-3.1.0.pom +2024-12-26 09:21:45,362 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/file-management/3.1.0/file-management-3.1.0.pom +2024-12-26 09:21:45,374 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/36/maven-shared-components-36.pom +2024-12-26 09:21:45,378 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/36/maven-shared-components-36.pom +2024-12-26 09:21:45,389 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/36/maven-parent-36.pom +2024-12-26 09:21:45,394 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/36/maven-parent-36.pom +2024-12-26 09:21:45,407 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/26/apache-26.pom +2024-12-26 09:21:45,410 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/26/apache-26.pom +2024-12-26 09:21:45,424 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom +2024-12-26 09:21:45,427 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom +2024-12-26 09:21:45,438 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.7.36/slf4j-parent-1.7.36.pom +2024-12-26 09:21:45,442 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-parent/1.7.36/slf4j-parent-1.7.36.pom +2024-12-26 09:21:45,454 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.pom +2024-12-26 09:21:45,457 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.pom +2024-12-26 09:21:45,468 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/17/plexus-17.pom +2024-12-26 09:21:45,471 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/17/plexus-17.pom +2024-12-26 09:21:45,484 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.16.1/commons-io-2.16.1.pom +2024-12-26 09:21:45,487 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.16.1/commons-io-2.16.1.pom +2024-12-26 09:21:45,498 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/69/commons-parent-69.pom +2024-12-26 09:21:45,503 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/69/commons-parent-69.pom +2024-12-26 09:21:45,520 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.6.2/maven-archiver-3.6.2.pom +2024-12-26 09:21:45,522 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.6.2/maven-archiver-3.6.2.pom +2024-12-26 09:21:45,537 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/41/maven-shared-components-41.pom +2024-12-26 09:21:45,540 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/41/maven-shared-components-41.pom +2024-12-26 09:21:45,557 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.pom +2024-12-26 09:21:45,560 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.pom +2024-12-26 09:21:45,573 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.pom +2024-12-26 09:21:45,576 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.pom +2024-12-26 09:21:45,592 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.pom +2024-12-26 09:21:45,596 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.pom +2024-12-26 09:21:45,607 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/16/plexus-16.pom +2024-12-26 09:21:45,611 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/16/plexus-16.pom +2024-12-26 09:21:45,623 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.1/junit-bom-5.10.1.pom +2024-12-26 09:21:45,625 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.1/junit-bom-5.10.1.pom +2024-12-26 09:21:45,637 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.pom +2024-12-26 09:21:45,640 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.pom +2024-12-26 09:21:45,651 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/66/commons-parent-66.pom +2024-12-26 09:21:45,655 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/66/commons-parent-66.pom +2024-12-26 09:21:45,669 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.pom +2024-12-26 09:21:45,673 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.pom +2024-12-26 09:21:45,687 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.pom +2024-12-26 09:21:45,692 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.pom +2024-12-26 09:21:45,705 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/64/commons-parent-64.pom +2024-12-26 09:21:45,709 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/64/commons-parent-64.pom +2024-12-26 09:21:45,722 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/30/apache-30.pom +2024-12-26 09:21:45,725 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/30/apache-30.pom +2024-12-26 09:21:45,742 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.0/junit-bom-5.10.0.pom +2024-12-26 09:21:45,747 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.10.0/junit-bom-5.10.0.pom +2024-12-26 09:21:45,761 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.pom +2024-12-26 09:21:45,766 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.pom +2024-12-26 09:21:45,782 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.pom +2024-12-26 09:21:45,785 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.pom +2024-12-26 09:21:45,799 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.pom +2024-12-26 09:21:45,802 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.pom +2024-12-26 09:21:45,814 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.pom +2024-12-26 09:21:45,817 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.pom +2024-12-26 09:21:45,835 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/file-management/3.1.0/file-management-3.1.0.jar +2024-12-26 09:21:45,838 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/file-management/3.1.0/file-management-3.1.0.jar +2024-12-26 09:21:45,843 [BasicRepositoryConnector-repo.maven.apache.org-2-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.jar +2024-12-26 09:21:45,845 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.6.2/maven-archiver-3.6.2.jar +2024-12-26 09:21:45,847 [BasicRepositoryConnector-repo.maven.apache.org-2-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.jar +2024-12-26 09:21:45,848 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.16.1/commons-io-2.16.1.jar +2024-12-26 09:21:45,848 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.jar +2024-12-26 09:21:45,850 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.6.2/maven-archiver-3.6.2.jar +2024-12-26 09:21:45,855 [BasicRepositoryConnector-repo.maven.apache.org-2-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.jar +2024-12-26 09:21:45,856 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.jar +2024-12-26 09:21:45,860 [BasicRepositoryConnector-repo.maven.apache.org-2-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.9.2/plexus-archiver-4.9.2.jar +2024-12-26 09:21:45,864 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/3.4.2/plexus-io-3.4.2.jar +2024-12-26 09:21:45,864 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.jar +2024-12-26 09:21:45,864 [BasicRepositoryConnector-repo.maven.apache.org-2-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar +2024-12-26 09:21:45,865 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.16.1/commons-io-2.16.1.jar +2024-12-26 09:21:45,868 [BasicRepositoryConnector-repo.maven.apache.org-2-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar +2024-12-26 09:21:45,869 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar +2024-12-26 09:21:45,871 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar +2024-12-26 09:21:45,871 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar +2024-12-26 09:21:45,872 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar +2024-12-26 09:21:45,878 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.jar +2024-12-26 09:21:45,883 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/tukaani/xz/1.9/xz-1.9.jar +2024-12-26 09:21:45,885 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.16.1/commons-codec-1.16.1.jar +2024-12-26 09:21:45,890 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar +2024-12-26 09:21:45,892 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar +2024-12-26 09:21:45,892 [BasicRepositoryConnector-repo.maven.apache.org-2-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar +2024-12-26 09:21:45,895 [BasicRepositoryConnector-repo.maven.apache.org-2-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar +2024-12-26 09:21:45,896 [BasicRepositoryConnector-repo.maven.apache.org-2-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar +2024-12-26 09:21:45,976 [BasicRepositoryConnector-repo.maven.apache.org-2-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.26.1/commons-compress-1.26.1.jar +2024-12-26 09:21:46,044 [BasicRepositoryConnector-repo.maven.apache.org-2-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/com/github/luben/zstd-jni/1.5.5-11/zstd-jni-1.5.5-11.jar +2024-12-26 09:21:46,486 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.pom +2024-12-26 09:21:46,490 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.pom +2024-12-26 09:21:46,499 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/5.1/plexus-5.1.pom +2024-12-26 09:21:46,503 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/5.1/plexus-5.1.pom +2024-12-26 09:21:46,515 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.pom +2024-12-26 09:21:46,519 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.pom +2024-12-26 09:21:46,528 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/10/plexus-10.pom +2024-12-26 09:21:46,532 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/10/plexus-10.pom +2024-12-26 09:21:46,544 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/3.3.1/maven-filtering-3.3.1.pom +2024-12-26 09:21:46,547 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/3.3.1/maven-filtering-3.3.1.pom +2024-12-26 09:21:46,557 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/39/maven-shared-components-39.pom +2024-12-26 09:21:46,560 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/39/maven-shared-components-39.pom +2024-12-26 09:21:46,571 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.pom +2024-12-26 09:21:46,573 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.pom +2024-12-26 09:21:46,581 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/15/spice-parent-15.pom +2024-12-26 09:21:46,584 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/spice/spice-parent/15/spice-parent-15.pom +2024-12-26 09:21:46,591 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/5/forge-parent-5.pom +2024-12-26 09:21:46,593 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/forge/forge-parent/5/forge-parent-5.pom +2024-12-26 09:21:46,602 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.0/plexus-utils-3.5.0.pom +2024-12-26 09:21:46,605 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.0/plexus-utils-3.5.0.pom +2024-12-26 09:21:46,614 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.pom +2024-12-26 09:21:46,617 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.pom +2024-12-26 09:21:46,626 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom +2024-12-26 09:21:46,631 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom +2024-12-26 09:21:46,640 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom +2024-12-26 09:21:46,643 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom +2024-12-26 09:21:46,652 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom +2024-12-26 09:21:46,655 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom +2024-12-26 09:21:46,663 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.pom +2024-12-26 09:21:46,666 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.pom +2024-12-26 09:21:46,676 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.1/junit-bom-5.7.1.pom +2024-12-26 09:21:46,679 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.1/junit-bom-5.7.1.pom +2024-12-26 09:21:46,692 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar +2024-12-26 09:21:46,695 [Worker-62: Building] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar +2024-12-26 09:21:46,700 [BasicRepositoryConnector-repo.maven.apache.org-3-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/3.3.1/maven-filtering-3.3.1.jar +2024-12-26 09:21:46,700 [BasicRepositoryConnector-repo.maven.apache.org-3-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar +2024-12-26 09:21:46,701 [BasicRepositoryConnector-repo.maven.apache.org-3-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar +2024-12-26 09:21:46,702 [BasicRepositoryConnector-repo.maven.apache.org-3-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar +2024-12-26 09:21:46,703 [BasicRepositoryConnector-repo.maven.apache.org-3-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar +2024-12-26 09:21:46,704 [BasicRepositoryConnector-repo.maven.apache.org-3-2] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar +2024-12-26 09:21:46,706 [BasicRepositoryConnector-repo.maven.apache.org-3-1] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/3.3.1/maven-filtering-3.3.1.jar +2024-12-26 09:21:46,708 [BasicRepositoryConnector-repo.maven.apache.org-3-0] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.5.1/plexus-utils-3.5.1.jar +2024-12-26 09:21:46,716 [BasicRepositoryConnector-repo.maven.apache.org-3-3] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar +2024-12-26 09:21:46,719 [BasicRepositoryConnector-repo.maven.apache.org-3-4] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar +2024-12-26 09:21:46,764 [Worker-62: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch01_FutureValueGUI\src\main\resources +2024-12-26 09:21:46,767 [Worker-62: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch01_FutureValueGUI\src\test\resources +2024-12-26 09:21:47,109 [Worker-99: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch01_FutureValueGUI\src\main\resources +2024-12-26 09:21:47,112 [Worker-99: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch01_FutureValueGUI\src\test\resources +2024-12-26 09:21:47,399 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13-sources.jar +2024-12-26 09:21:47,452 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-controls/13/javafx-controls-13-sources.jar +2024-12-26 09:21:47,456 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-controls:13 +2024-12-26 09:21:47,462 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-controls:13win +2024-12-26 09:21:47,510 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13-sources.jar +2024-12-26 09:21:47,650 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-graphics/13/javafx-graphics-13-sources.jar +2024-12-26 09:21:47,654 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-graphics:13 +2024-12-26 09:21:47,657 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-graphics:13win +2024-12-26 09:21:47,692 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloading https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13-sources.jar +2024-12-26 09:21:47,713 [Worker-54: Download sources and javadoc] INFO o.e.m.c.i.e.AbstractTransferListenerAdapter - Downloaded https://repo.maven.apache.org/maven2/org/openjfx/javafx-base/13/javafx-base-13-sources.jar +2024-12-26 09:21:47,717 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-base:13 +2024-12-26 09:21:47,722 [Worker-54: Download sources and javadoc] INFO o.e.m.j.internal.DownloadSourcesJob - Downloaded sources for org.openjfx:javafx-base:13win +2024-12-26 09:21:47,891 [Worker-57: Updating Maven Dependencies] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch12_ex1_MPG:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex1_MPG\pom.xml. +2024-12-26 09:21:49,038 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: murach:ch12_FutureValue:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValue\pom.xml. +2024-12-26 09:21:49,087 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValue\src\main\resources +2024-12-26 09:21:49,089 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValue\src\test\resources +2024-12-26 09:21:49,180 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: murach:ch12_FutureValueValidation:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValueValidation\pom.xml. +2024-12-26 09:21:49,231 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValueValidation\src\main\resources +2024-12-26 09:21:49,233 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValueValidation\src\test\resources +2024-12-26 09:21:49,307 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex1_MPG\src\main\resources +2024-12-26 09:21:49,310 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex1_MPG\src\test\resources +2024-12-26 09:21:49,389 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch12_ex1_MPG_sol:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex1_MPG_sol\pom.xml. +2024-12-26 09:21:49,435 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex1_MPG_sol\src\main\resources +2024-12-26 09:21:49,437 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex1_MPG_sol\src\test\resources +2024-12-26 09:21:49,518 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch12_ex2_MPG:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex2_MPG\pom.xml. +2024-12-26 09:21:49,567 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex2_MPG\src\main\resources +2024-12-26 09:21:49,569 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex2_MPG\src\test\resources +2024-12-26 09:21:49,647 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch12_ex2_MPG_sol:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex2_MPG_sol\pom.xml. +2024-12-26 09:21:49,693 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex2_MPG_sol\src\main\resources +2024-12-26 09:21:49,695 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex2_MPG_sol\src\test\resources +2024-12-26 09:21:49,760 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: Murach:ch13_SocialMediaSignup:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch13_SocialMediaSignup\pom.xml. +2024-12-26 09:21:49,806 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch13_SocialMediaSignup\src\main\resources +2024-12-26 09:21:49,808 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch13_SocialMediaSignup\src\test\resources +2024-12-26 09:21:49,887 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch13_ex1_FutureValue:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex1_FutureValue\pom.xml. +2024-12-26 09:21:49,934 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex1_FutureValue\src\main\resources +2024-12-26 09:21:49,936 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex1_FutureValue\src\test\resources +2024-12-26 09:21:50,031 [Worker-97: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.murach:ch13_ex1_FutureValue_sol:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex1_FutureValue_sol\pom.xml. +2024-12-26 09:21:50,100 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex1_FutureValue_sol\src\main\resources +2024-12-26 09:21:50,101 [Worker-97: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex1_FutureValue_sol\src\test\resources +2024-12-26 09:21:50,341 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValue\src\main\resources +2024-12-26 09:21:50,343 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValue\src\test\resources +2024-12-26 09:21:50,437 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValueValidation\src\main\resources +2024-12-26 09:21:50,438 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch12_FutureValueValidation\src\test\resources +2024-12-26 09:21:50,515 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex1_MPG_sol\src\main\resources +2024-12-26 09:21:50,517 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex1_MPG_sol\src\test\resources +2024-12-26 09:21:50,593 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex2_MPG\src\main\resources +2024-12-26 09:21:50,595 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch12_ex2_MPG\src\test\resources +2024-12-26 09:21:50,684 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex2_MPG_sol\src\main\resources +2024-12-26 09:21:50,686 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch12_ex2_MPG_sol\src\test\resources +2024-12-26 09:21:50,763 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch13_SocialMediaSignup\src\main\resources +2024-12-26 09:21:50,764 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\book_apps\ch13_SocialMediaSignup\src\test\resources +2024-12-26 09:21:50,842 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex1_FutureValue\src\main\resources +2024-12-26 09:21:50,843 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex1_FutureValue\src\test\resources +2024-12-26 09:21:50,922 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex1_FutureValue_sol\src\main\resources +2024-12-26 09:21:50,923 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex1_FutureValue_sol\src\test\resources +2024-12-26 09:21:50,994 [Worker-88: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: Murach:ch13_ex2_PizzaCalculator:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex2_PizzaCalculator\pom.xml. +2024-12-26 09:21:51,039 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex2_PizzaCalculator\src\main\resources +2024-12-26 09:21:51,041 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex2_PizzaCalculator\src\test\resources +2024-12-26 09:21:51,112 [Worker-88: Building] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: Murach:ch13_ex2_PizzaCalculator:1.0-SNAPSHOT @ C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex2_PizzaCalculator_sol\pom.xml. +2024-12-26 09:21:51,153 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\resources +2024-12-26 09:21:51,155 [Worker-88: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\test\resources +2024-12-26 09:21:52,681 [Worker-66: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex2_PizzaCalculator\src\main\resources +2024-12-26 09:21:52,683 [Worker-66: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_starts\ch13_ex2_PizzaCalculator\src\test\resources +2024-12-26 09:21:52,742 [Worker-66: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\resources +2024-12-26 09:21:52,744 [Worker-66: Building] INFO o.a.m.s.f.DefaultMavenResourcesFiltering - skip non existing resourceDirectory C:\Users\Dagostit\OneDrive - The Mental Health Association of Westchester Inc\Documents\Code\java\eclipse\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\test\resources +2024-12-26 12:10:16,906 [Worker-5: Loading available Gradle versions] INFO o.e.b.c.i.u.g.PublishedGradleVersions - Gradle version information cache is up-to-date. Trying to read. diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.0.20241001-1350.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.0.20241001-1350.xml new file mode 100644 index 0000000..9effde7 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.m2e.logback/logback.2.7.0.20241001-1350.xml @@ -0,0 +1,41 @@ + + + + %date [%thread] %-5level %logger{35} - %msg%n + + + ${org.eclipse.m2e.log.console.threshold:-OFF} + + + + + ${org.eclipse.m2e.log.dir}/0.log + + ${org.eclipse.m2e.log.dir}/%i.log + 1 + 10 + + + 10MB + + + %date [%thread] %-5level %logger{35} - %msg%n + + + + + + WARN + + + + + + + + + + + + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser b/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser new file mode 100644 index 0000000..1e9a069 Binary files /dev/null and b/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.github.ui/avatars.ser differ diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml new file mode 100644 index 0000000..a05555f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.mylyn.tasks.ui/dialog_settings.xml @@ -0,0 +1,18 @@ + +
+
+ + + + + + +
+ + + + + +
+
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml new file mode 100644 index 0000000..23724b8 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup.ui/dialog_settings.xml @@ -0,0 +1,13 @@ + +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup b/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup new file mode 100644 index 0000000..1f73e14 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.oomph.setup/workspace.setup @@ -0,0 +1,6 @@ + + diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.tips.ide/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.tm.terminal.view.ui/.executables/data.properties b/murach/eclipse/.metadata/.plugins/org.eclipse.tm.terminal.view.ui/.executables/data.properties new file mode 100644 index 0000000..f3ea092 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.tm.terminal.view.ui/.executables/data.properties @@ -0,0 +1,10 @@ +#Thu Dec 26 09:31:54 EST 2024 +0.Args=--login -i +0.Icon=C\:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico +0.Name=Git Bash +0.Path=C\:\\Program Files\\Git\\bin\\sh.exe +0.Translate=true +1.Args=--distribution Ubuntu +1.Name=Ubuntu (WSL) +1.Path=C\:\\WINDOWS\\System32\\wsl.exe +1.Translate=true diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml new file mode 100644 index 0000000..4b5fec2 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml @@ -0,0 +1,37 @@ + +
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + +
+ + + + + +
+
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ui.intro/introstate b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.intro/introstate new file mode 100644 index 0000000..02f134f --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.intro/introstate @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000..ea02360 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,20 @@ + +
+
+ + + + +
+
+
+
+ + + + + +
+
+
+
diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..4c7124d --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/murach/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties b/murach/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties new file mode 100644 index 0000000..91b4922 --- /dev/null +++ b/murach/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties @@ -0,0 +1,3 @@ +# +#Thu Dec 26 09:33:15 EST 2024 +task-tag-projects-already-scanned=ch03_ex1_MPG,ch10_Product,ch13_SocialMediaSignup,ch14_ex1_CreateAccount,ch18_ex2_AgeCalculator_sol,ch05_FutureValueWithMethod,ch04_ex2_Invoice_sol,ch16_ex2_BookCatalog_sol,ch08_Invoice,ch12_ex2_MPG_sol,ch04_Invoice,ch14_ex2_Hangman,ch18_ex1_Invoice_sol,ch07_ex2_FutureValue_sol,ch08_ex1_MonthSales_sol,ch18_ex2_AgeCalculator,ch02_ex3_Invoice,ch08_ex3_CardDeck_sol,ch08_ex2_CardDeck_sol,ch06_ex2_FutureValue,ch15_ex3_LoginCounter,ch01_FutureValueGUI,ch15_WordCounter,ch15_ex1_FutureValue,ch15_ex1_FutureValue_sol,ch14_CreateAccount,ch10_ex2_Product,ch04_GuessNumber,ch08_NumberCruncher,ch06_ex2_FutureValue_sol,ch14_Hangman,ch01_Test,ch15_ex2_GenericStack,ch12_ex1_MPG,ch13_ex2_PizzaCalculator,ch04_FutureValue,ch17_ex1_Fibonacci_sol,ch04_ex3_GuessNumber,ch11_ex1_DisplayableTest_sol,ch02_TestScore,ch04_ex3_GuessNumber_sol,ch17_ex2_StringReversal,ch09_ex2_ProductManager,ch03_ex2_TestScore_sol,ch17_ex1_Fibonacci,ch14_ex2_Hangman_sol,ch03_Invoice,ch12_ex1_MPG_sol,ch18_Invoice,ch10_ex1_Product,ch11_ex2_Enumeration,ch17_ex3_GCD_sol,ch15_Invoice,ch07_LineItem,ch04_ex4_FutureValue_sol,ch04_ex1_FutureValue_sol,ch09_ex1_CustomerManager_sol,ch04_ex4_FutureValue,ch02_ex3_Invoice_sol,ch05_ex1_FutureValue_sol,ch04_ex1_FutureValue,ch13_ex1_FutureValue_sol,ch13_ex2_PizzaCalculator_sol,ch07_ex2_FutureValue,ch09_ex2_ProductManager_sol,ch13_ex1_FutureValue,ch07_ex3_AreaAndPerimeter_sol,ch05_FutureValueWithValidation,ch10_ex2_Product_sol,ch19_ex3_ProductManager,ch11_ex3_LineItem_sol,ch11_ex3_LineItem,ch17_DirectorySearch,ch10_ex1_Product_sol,ch12_FutureValue,ch06_ex1_Invoice,ch03_ex1_MPG_sol,ch02_ex1_Invoice,ch07_ex1_Product,ch05_ex1_FutureValue,ch17_ex3_GCD,ch11_ex2_Enumeration_sol,ch05_ex2_GuessNumber,ch19_ex2_DBTester_sol,ch10_ex3_EqualsTest,ch02_Invoice,ch08_ex3_CardDeck,ch09_ex3_ExceptionTester,ch19_ex2_DBTester,ch19_ex3_ProductManager_sol,ch15_ex2_GenericStack_sol,ch11_ex1_DisplayableTest,ch02_ex2_TestScore,ch12_ex2_MPG,ch19_ProductManager,ch09_ex3_ExceptionTester_sol,ch08_ex2_CardDeck,ch11_LineItem,ch17_ex2_StringReversal_sol,ch10_ex3_EqualsTest_sol,ch02_ex2_TestScore_sol,ch14_ex1_CreateAccount_sol,ch18_ex1_Invoice,ch16_ex2_BookCatalog,ch16_ex1_BookCatalog,ch07_Product,ch09_ex1_CustomerManager,ch16_ex1_BookCatalog_sol,ch04_ex2_Invoice,ch06_ex1_Invoice_sol,ch03_ex2_TestScore,ch05_ex2_GuessNumber_sol,ch12_FutureValueValidation,ch08_ex1_MonthSales,ch09_ProductManager,ch19_ex1_SQLStatements_sol,ch07_ex3_AreaAndPerimeter,ch07_ex1_Product_sol,ch01_FutureValueConsole diff --git a/murach/eclipse/.metadata/version.ini b/murach/eclipse/.metadata/version.ini new file mode 100644 index 0000000..befeb87 --- /dev/null +++ b/murach/eclipse/.metadata/version.ini @@ -0,0 +1,3 @@ +#Thu Dec 26 12:10:11 EST 2024 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.34.0.v20241120-1800 diff --git a/murach/eclipse/book_apps/ch01_FutureValueConsole/.classpath b/murach/eclipse/book_apps/ch01_FutureValueConsole/.classpath new file mode 100644 index 0000000..fb50116 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueConsole/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueConsole/.project b/murach/eclipse/book_apps/ch01_FutureValueConsole/.project new file mode 100644 index 0000000..a8e4a34 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueConsole/.project @@ -0,0 +1,17 @@ + + + ch01_FutureValueConsole + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueConsole/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch01_FutureValueConsole/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueConsole/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch01_FutureValueConsole/bin/FutureValueApp.class b/murach/eclipse/book_apps/ch01_FutureValueConsole/bin/FutureValueApp.class new file mode 100644 index 0000000..072325e Binary files /dev/null and b/murach/eclipse/book_apps/ch01_FutureValueConsole/bin/FutureValueApp.class differ diff --git a/murach/eclipse/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java b/murach/eclipse/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java new file mode 100644 index 0000000..258a57e --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java @@ -0,0 +1,61 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); // blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + input = sc.nextLine(); + double monthlyInvestment = Double.parseDouble(input); + + System.out.print("Enter yearly interest rate: "); + input = sc.nextLine(); + double interestRate = Double.parseDouble(input); + + System.out.print("Enter number of years: "); + input = sc.nextLine(); + int years = Integer.parseInt(input); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) + { + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/.classpath b/murach/eclipse/book_apps/ch01_FutureValueGUI/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/.project b/murach/eclipse/book_apps/ch01_FutureValueGUI/.project new file mode 100644 index 0000000..2eaa827 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/.project @@ -0,0 +1,23 @@ + + + ch01_FutureValueGUI + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..e9441bb --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/nbactions.xml b/murach/eclipse/book_apps/ch01_FutureValueGUI/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/pom.xml b/murach/eclipse/book_apps/ch01_FutureValueGUI/pom.xml new file mode 100644 index 0000000..37080a1 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch01_FutureValueGUI + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java new file mode 100644 index 0000000..e41f56d --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach { + requires javafx.controls; + exports murach; +} diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java new file mode 100644 index 0000000..9e7f881 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java @@ -0,0 +1,103 @@ +package murach; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class App extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + public static void main(String[] args) { + launch(args); + } + + @SuppressWarnings("exports") + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + // get data from text fields + double investment = Double.parseDouble(investmentField.getText()); + double rate = Double.parseDouble(interestRateField.getText()); + int years = Integer.parseInt(yearsField.getText()); + + // calculate future value + double futureValue = calculateFutureValue(investment, rate, years); + + // set data in read-only text field + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate/12/100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java new file mode 100644 index 0000000..3ac5449 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java @@ -0,0 +1,13 @@ +package murach; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..7c750e0 Binary files /dev/null and b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar differ diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.properties b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.properties new file mode 100644 index 0000000..bb21cb7 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:47 EST 2024 +artifactId=ch01_FutureValueGUI +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch01_FutureValueGUI +m2e.projectName=ch01_FutureValueGUI +version=1.0-SNAPSHOT diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.xml b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.xml new file mode 100644 index 0000000..37080a1 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/META-INF/maven/com.murach/ch01_FutureValueGUI/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch01_FutureValueGUI + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/module-info.class b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/module-info.class new file mode 100644 index 0000000..498ef98 Binary files /dev/null and b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/module-info.class differ diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class new file mode 100644 index 0000000..edee880 Binary files /dev/null and b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class differ diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class new file mode 100644 index 0000000..68846a4 Binary files /dev/null and b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class differ diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties new file mode 100644 index 0000000..d989566 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Aug 19 16:16:33 PDT 2021 +groupId=com.murach +artifactId=ch01_FutureValueGUI +version=1.0-SNAPSHOT diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e4b4a94 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +module-info.class diff --git a/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..eb4b6e1 --- /dev/null +++ b/murach/eclipse/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\maryd\Dropbox\Java 6ed\java\netbeans\book_apps\ch01_FutureValueGUI\src\main\java\murach\SystemInfo.java +C:\Users\maryd\Dropbox\Java 6ed\java\netbeans\book_apps\ch01_FutureValueGUI\src\main\java\murach\App.java +C:\Users\maryd\Dropbox\Java 6ed\java\netbeans\book_apps\ch01_FutureValueGUI\src\main\java\module-info.java diff --git a/murach/eclipse/book_apps/ch02_Invoice/.classpath b/murach/eclipse/book_apps/ch02_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch02_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch02_Invoice/.project b/murach/eclipse/book_apps/ch02_Invoice/.project new file mode 100644 index 0000000..878d2de --- /dev/null +++ b/murach/eclipse/book_apps/ch02_Invoice/.project @@ -0,0 +1,17 @@ + + + ch02_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch02_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch02_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch02_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch02_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch02_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..7c29869 Binary files /dev/null and b/murach/eclipse/book_apps/ch02_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch02_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch02_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..8c29ea9 --- /dev/null +++ b/murach/eclipse/book_apps/ch02_Invoice/src/InvoiceApp.java @@ -0,0 +1,46 @@ +import java.util.Scanner; + +public class InvoiceApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch02_TestScore/.classpath b/murach/eclipse/book_apps/ch02_TestScore/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch02_TestScore/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch02_TestScore/.project b/murach/eclipse/book_apps/ch02_TestScore/.project new file mode 100644 index 0000000..dc7e033 --- /dev/null +++ b/murach/eclipse/book_apps/ch02_TestScore/.project @@ -0,0 +1,17 @@ + + + ch02_TestScore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch02_TestScore/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch02_TestScore/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch02_TestScore/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch02_TestScore/bin/TestScoreApp.class b/murach/eclipse/book_apps/ch02_TestScore/bin/TestScoreApp.class new file mode 100644 index 0000000..2014a70 Binary files /dev/null and b/murach/eclipse/book_apps/ch02_TestScore/bin/TestScoreApp.class differ diff --git a/murach/eclipse/book_apps/ch02_TestScore/src/TestScoreApp.java b/murach/eclipse/book_apps/ch02_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..6d7abda --- /dev/null +++ b/murach/eclipse/book_apps/ch02_TestScore/src/TestScoreApp.java @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class TestScoreApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To exit, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch03_Invoice/.classpath b/murach/eclipse/book_apps/ch03_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch03_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch03_Invoice/.project b/murach/eclipse/book_apps/ch03_Invoice/.project new file mode 100644 index 0000000..2be2935 --- /dev/null +++ b/murach/eclipse/book_apps/ch03_Invoice/.project @@ -0,0 +1,17 @@ + + + ch03_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch03_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch03_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch03_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch03_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch03_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..ee6b905 Binary files /dev/null and b/murach/eclipse/book_apps/ch03_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch03_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch03_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..ed3ca89 --- /dev/null +++ b/murach/eclipse/book_apps/ch03_Invoice/src/InvoiceApp.java @@ -0,0 +1,49 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class InvoiceApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + final double DISCOUNT_PCT = .05; + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + System.out.println(); // print blank line + + // calculate the results + double discountAmount = subtotal * DISCOUNT_PCT; + discountAmount = (double) Math.round(discountAmount * 100) / 100; + double total = subtotal - discountAmount; + + // format and display the discount percent + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.printf("%-20s%12s%n", + "Discount percent:", percent.format(DISCOUNT_PCT)); + + // a debugging statement that has been commented out + /* + System.out.println("UNFORMATTED RESULTS\n" + + "Subtotal: " + subtotal + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n" + + "FORMATTED RESULTS"); + */ + + // format and display the floating-point numbers + String format = "%-20s%,12.2f%n"; + System.out.printf(format, "Subtotal:", subtotal); + System.out.printf(format, "Discount amount:", discountAmount); + System.out.printf(format, "Invoice total:", total); + System.out.println(); // print blank line + + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch04_FutureValue/.classpath b/murach/eclipse/book_apps/ch04_FutureValue/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch04_FutureValue/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch04_FutureValue/.project b/murach/eclipse/book_apps/ch04_FutureValue/.project new file mode 100644 index 0000000..ce7a7ff --- /dev/null +++ b/murach/eclipse/book_apps/ch04_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch04_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch04_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch04_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch04_FutureValue/bin/FutureValueApp.class b/murach/eclipse/book_apps/ch04_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..890ae60 Binary files /dev/null and b/murach/eclipse/book_apps/ch04_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/book_apps/ch04_FutureValue/src/FutureValueApp.java b/murach/eclipse/book_apps/ch04_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..22a2059 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_FutureValue/src/FutureValueApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch04_GuessNumber/.classpath b/murach/eclipse/book_apps/ch04_GuessNumber/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch04_GuessNumber/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch04_GuessNumber/.project b/murach/eclipse/book_apps/ch04_GuessNumber/.project new file mode 100644 index 0000000..e24dad3 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_GuessNumber/.project @@ -0,0 +1,17 @@ + + + ch04_GuessNumber + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch04_GuessNumber/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch04_GuessNumber/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_GuessNumber/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch04_GuessNumber/bin/GuessNumberApp.class b/murach/eclipse/book_apps/ch04_GuessNumber/bin/GuessNumberApp.class new file mode 100644 index 0000000..7d8ddcc Binary files /dev/null and b/murach/eclipse/book_apps/ch04_GuessNumber/bin/GuessNumberApp.class differ diff --git a/murach/eclipse/book_apps/ch04_GuessNumber/src/GuessNumberApp.java b/murach/eclipse/book_apps/ch04_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..a5badcb --- /dev/null +++ b/murach/eclipse/book_apps/ch04_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,43 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + String input = sc.nextLine(); + int guess = Integer.parseInt(input); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch04_Invoice/.classpath b/murach/eclipse/book_apps/ch04_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch04_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch04_Invoice/.project b/murach/eclipse/book_apps/ch04_Invoice/.project new file mode 100644 index 0000000..b640861 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_Invoice/.project @@ -0,0 +1,17 @@ + + + ch04_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch04_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch04_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/book_apps/ch04_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/book_apps/ch04_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch04_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..c5492cc Binary files /dev/null and b/murach/eclipse/book_apps/ch04_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch04_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch04_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..1354030 --- /dev/null +++ b/murach/eclipse/book_apps/ch04_Invoice/src/InvoiceApp.java @@ -0,0 +1,72 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + System.out.println("The Invoice Total Calculator\n"); + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + System.out.println(); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + String format = "%-20s%12s%n"; + + System.out.println("INVOICE"); // print blank line + System.out.printf(format, "Subtotal:", + currency.format(subtotal)); + System.out.printf(format, "Discount percent:", + percent.format(discountPercent)); + System.out.printf(format, "Discount amount:", + currency.format(discountAmount)); + System.out.printf(format, "Total:", + currency.format(total)); + System.out.println(); // print blank line + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.classpath b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.project b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.project new file mode 100644 index 0000000..614fd9f --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.project @@ -0,0 +1,17 @@ + + + ch05_FutureValueWithMethod + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithMethod/bin/FutureValueApp.class b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/bin/FutureValueApp.class new file mode 100644 index 0000000..904135e Binary files /dev/null and b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/bin/FutureValueApp.class differ diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java new file mode 100644 index 0000000..241ee53 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java @@ -0,0 +1,55 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + @SuppressWarnings("resource") + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.classpath b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.project b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.project new file mode 100644 index 0000000..c5ed9d3 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.project @@ -0,0 +1,17 @@ + + + ch05_FutureValueWithValidation + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithValidation/bin/FutureValueApp.class b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/bin/FutureValueApp.class new file mode 100644 index 0000000..60d5620 Binary files /dev/null and b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/bin/FutureValueApp.class differ diff --git a/murach/eclipse/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java new file mode 100644 index 0000000..d307e63 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java @@ -0,0 +1,109 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // print the results + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + double value = Double.parseDouble(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + int value = Integer.parseInt(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch05_GuessNumber/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch05_GuessNumber/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_GuessNumber/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch05_GuessNumber/src/GuessNumberApp.java b/murach/eclipse/book_apps/ch05_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..fbaf218 --- /dev/null +++ b/murach/eclipse/book_apps/ch05_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/book_apps/ch06_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch06_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch06_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch06_FutureValue/src/FutureValueApp.java b/murach/eclipse/book_apps/ch06_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..c738e5e --- /dev/null +++ b/murach/eclipse/book_apps/ch06_FutureValue/src/FutureValueApp.java @@ -0,0 +1,110 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println(); + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_LineItem/.classpath b/murach/eclipse/book_apps/ch07_LineItem/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch07_LineItem/.project b/murach/eclipse/book_apps/ch07_LineItem/.project new file mode 100644 index 0000000..a42f9c4 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/.project @@ -0,0 +1,17 @@ + + + ch07_LineItem + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch07_LineItem/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch07_LineItem/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch07_LineItem/bin/Console.class b/murach/eclipse/book_apps/ch07_LineItem/bin/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/book_apps/ch07_LineItem/bin/Console.class differ diff --git a/murach/eclipse/book_apps/ch07_LineItem/bin/LineItem.class b/murach/eclipse/book_apps/ch07_LineItem/bin/LineItem.class new file mode 100644 index 0000000..5196ab7 Binary files /dev/null and b/murach/eclipse/book_apps/ch07_LineItem/bin/LineItem.class differ diff --git a/murach/eclipse/book_apps/ch07_LineItem/bin/LineItemApp.class b/murach/eclipse/book_apps/ch07_LineItem/bin/LineItemApp.class new file mode 100644 index 0000000..d7ce5f8 Binary files /dev/null and b/murach/eclipse/book_apps/ch07_LineItem/bin/LineItemApp.class differ diff --git a/murach/eclipse/book_apps/ch07_LineItem/bin/Product.class b/murach/eclipse/book_apps/ch07_LineItem/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/book_apps/ch07_LineItem/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch07_LineItem/bin/ProductDB.class b/murach/eclipse/book_apps/ch07_LineItem/bin/ProductDB.class new file mode 100644 index 0000000..6e0e9d4 Binary files /dev/null and b/murach/eclipse/book_apps/ch07_LineItem/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch07_LineItem/src/Console.java b/murach/eclipse/book_apps/ch07_LineItem/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_LineItem/src/LineItem.java b/murach/eclipse/book_apps/ch07_LineItem/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_LineItem/src/LineItemApp.java b/murach/eclipse/book_apps/ch07_LineItem/src/LineItemApp.java new file mode 100644 index 0000000..06c43df --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/src/LineItemApp.java @@ -0,0 +1,38 @@ +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // create 1 or more line items + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString( + "Enter product code: "); + int quantity = Console.getInt( + "Enter quantity: ", 0, 1000); + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(product, quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + lineItem.getProduct().getCode()); + System.out.println("Description: " + lineItem.getProduct().getDescription()); + System.out.println("Price: " + lineItem.getProduct().getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_LineItem/src/Product.java b/murach/eclipse/book_apps/ch07_LineItem/src/Product.java new file mode 100644 index 0000000..d3b95a2 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_LineItem/src/ProductDB.java b/murach/eclipse/book_apps/ch07_LineItem/src/ProductDB.java new file mode 100644 index 0000000..0c77034 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_LineItem/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String code) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(code); + if (code.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (code.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (code.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/eclipse/book_apps/ch07_Product/.classpath b/murach/eclipse/book_apps/ch07_Product/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch07_Product/.project b/murach/eclipse/book_apps/ch07_Product/.project new file mode 100644 index 0000000..8ccea2a --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/.project @@ -0,0 +1,17 @@ + + + ch07_Product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch07_Product/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch07_Product/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch07_Product/bin/Product.class b/murach/eclipse/book_apps/ch07_Product/bin/Product.class new file mode 100644 index 0000000..54c222d Binary files /dev/null and b/murach/eclipse/book_apps/ch07_Product/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch07_Product/bin/ProductApp.class b/murach/eclipse/book_apps/ch07_Product/bin/ProductApp.class new file mode 100644 index 0000000..2ec0acf Binary files /dev/null and b/murach/eclipse/book_apps/ch07_Product/bin/ProductApp.class differ diff --git a/murach/eclipse/book_apps/ch07_Product/bin/ProductDB.class b/murach/eclipse/book_apps/ch07_Product/bin/ProductDB.class new file mode 100644 index 0000000..6e83b6f Binary files /dev/null and b/murach/eclipse/book_apps/ch07_Product/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch07_Product/src/Product.java b/murach/eclipse/book_apps/ch07_Product/src/Product.java new file mode 100644 index 0000000..9381cbd --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/src/Product.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_Product/src/ProductApp.java b/murach/eclipse/book_apps/ch07_Product/src/ProductApp.java new file mode 100644 index 0000000..7c451c3 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/src/ProductApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class ProductApp { + + @SuppressWarnings("resource") + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch07_Product/src/ProductDB.java b/murach/eclipse/book_apps/ch07_Product/src/ProductDB.java new file mode 100644 index 0000000..4edcf88 --- /dev/null +++ b/murach/eclipse/book_apps/ch07_Product/src/ProductDB.java @@ -0,0 +1,32 @@ +public class ProductDB { + + public static Product getProduct(String code) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(code); + if (code.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } + else if (code.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } + else if (code.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } + else { + product.setDescription("Unknown"); + } + + return product; + } +} diff --git a/murach/eclipse/book_apps/ch08_Invoice/.classpath b/murach/eclipse/book_apps/ch08_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch08_Invoice/.project b/murach/eclipse/book_apps/ch08_Invoice/.project new file mode 100644 index 0000000..0d9f6f5 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/.project @@ -0,0 +1,17 @@ + + + ch08_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch08_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch08_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/Console.class b/murach/eclipse/book_apps/ch08_Invoice/bin/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/Console.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/Invoice.class b/murach/eclipse/book_apps/ch08_Invoice/bin/Invoice.class new file mode 100644 index 0000000..4675e4b Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/Invoice.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch08_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..f17ffcc Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/LineItem.class b/murach/eclipse/book_apps/ch08_Invoice/bin/LineItem.class new file mode 100644 index 0000000..5196ab7 Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/LineItem.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/Product.class b/murach/eclipse/book_apps/ch08_Invoice/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/bin/ProductDB.class b/murach/eclipse/book_apps/ch08_Invoice/bin/ProductDB.class new file mode 100644 index 0000000..e2b72b6 Binary files /dev/null and b/murach/eclipse/book_apps/ch08_Invoice/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/Console.java b/murach/eclipse/book_apps/ch08_Invoice/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/Invoice.java b/murach/eclipse/book_apps/ch08_Invoice/src/Invoice.java new file mode 100644 index 0000000..2eae8b5 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/Invoice.java @@ -0,0 +1,37 @@ +import java.text.NumberFormat; +import java.util.ArrayList; + +public class Invoice { + // the instance variable + private final ArrayList lineItems; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + } + + // a method that adds a line item + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + // the get accessor for the line item collection + public ArrayList getLineItems() { + return lineItems; + } + + // a method that gets the invoice total + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + // a method that returns the invoice total in currency format + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch08_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..e8a2ca2 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/InvoiceApp.java @@ -0,0 +1,41 @@ +public class InvoiceApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + + Invoice invoice = new Invoice(); + getLineItems(invoice); + displayInvoice(invoice); + } + + public static void getLineItems(Invoice invoice) { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice(Invoice invoice) { + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } + +} diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/LineItem.java b/murach/eclipse/book_apps/ch08_Invoice/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/Product.java b/murach/eclipse/book_apps/ch08_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch08_Invoice/src/ProductDB.java b/murach/eclipse/book_apps/ch08_Invoice/src/ProductDB.java new file mode 100644 index 0000000..bf7ed85 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/eclipse/book_apps/ch08_NumberCruncher/.classpath b/murach/eclipse/book_apps/ch08_NumberCruncher/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch08_NumberCruncher/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch08_NumberCruncher/.project b/murach/eclipse/book_apps/ch08_NumberCruncher/.project new file mode 100644 index 0000000..97d3336 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_NumberCruncher/.project @@ -0,0 +1,17 @@ + + + ch08_NumberCruncher + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch08_NumberCruncher/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch08_NumberCruncher/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_NumberCruncher/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch08_NumberCruncher/bin/NumberCruncherApp.class b/murach/eclipse/book_apps/ch08_NumberCruncher/bin/NumberCruncherApp.class new file mode 100644 index 0000000..6311139 Binary files /dev/null and b/murach/eclipse/book_apps/ch08_NumberCruncher/bin/NumberCruncherApp.class differ diff --git a/murach/eclipse/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java b/murach/eclipse/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java new file mode 100644 index 0000000..762b184 --- /dev/null +++ b/murach/eclipse/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java @@ -0,0 +1,42 @@ +import java.util.Arrays; + +public class NumberCruncherApp { + + public static void main(String[] args) { + // create array of 11 random integers + var numbers = new int[11]; + for (int i = 0; i < numbers.length; i++) { + numbers[i] = (int) (Math.random() * 51); // num is >= 0 and <= 50 + } + + // sort the array + Arrays.sort(numbers); + + // get number string and calculate total + String numberString = ""; + int total = 0; + for (int number : numbers) { + numberString += number + " "; + total += number; + } + // display number string and total + System.out.println("Numbers: " + numberString); + System.out.println("Total: " + total); + + // get count of numbers and display + int count = numbers.length; + System.out.println("Count: " + count); + + // calculate average and display + double average = (double) total / count; + average = (double) Math.round(average * 10) / 10; + System.out.println("Average: " + average); + + // if count of numbers is odd + if (count % 2 != 0) { + int medianIndex = count / 2; + int median = numbers[medianIndex]; + System.out.println("Median: " + median); + } + } +} diff --git a/murach/eclipse/book_apps/ch09_ProductManager/.classpath b/murach/eclipse/book_apps/ch09_ProductManager/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch09_ProductManager/.project b/murach/eclipse/book_apps/ch09_ProductManager/.project new file mode 100644 index 0000000..c367076 --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/.project @@ -0,0 +1,17 @@ + + + ch09_ProductManager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch09_ProductManager/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch09_ProductManager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/book_apps/ch09_ProductManager/bin/Console.class b/murach/eclipse/book_apps/ch09_ProductManager/bin/Console.class new file mode 100644 index 0000000..86b38bb Binary files /dev/null and b/murach/eclipse/book_apps/ch09_ProductManager/bin/Console.class differ diff --git a/murach/eclipse/book_apps/ch09_ProductManager/bin/Product.class b/murach/eclipse/book_apps/ch09_ProductManager/bin/Product.class new file mode 100644 index 0000000..434b405 Binary files /dev/null and b/murach/eclipse/book_apps/ch09_ProductManager/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductDB.class b/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductDB.class new file mode 100644 index 0000000..ba8561d Binary files /dev/null and b/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductManagerApp.class b/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductManagerApp.class new file mode 100644 index 0000000..bbf6667 Binary files /dev/null and b/murach/eclipse/book_apps/ch09_ProductManager/bin/ProductManagerApp.class differ diff --git a/murach/eclipse/book_apps/ch09_ProductManager/products.txt b/murach/eclipse/book_apps/ch09_ProductManager/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/eclipse/book_apps/ch09_ProductManager/src/Console.java b/murach/eclipse/book_apps/ch09_ProductManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch09_ProductManager/src/Product.java b/murach/eclipse/book_apps/ch09_ProductManager/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch09_ProductManager/src/ProductDB.java b/murach/eclipse/book_apps/ch09_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..71126ae --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "products.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch09_ProductManager/src/ProductManagerApp.java b/murach/eclipse/book_apps/ch09_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..1e04dd7 --- /dev/null +++ b/murach/eclipse/book_apps/ch09_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,75 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + ArrayList products = ProductDB.getAll(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch10_Product/.classpath b/murach/eclipse/book_apps/ch10_Product/.classpath new file mode 100644 index 0000000..06cc98d --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch10_Product/.project b/murach/eclipse/book_apps/ch10_Product/.project new file mode 100644 index 0000000..269ec1b --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/.project @@ -0,0 +1,17 @@ + + + ch10_Product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch10_Product/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch10_Product/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch10_Product/build/built-jar.properties b/murach/eclipse/book_apps/ch10_Product/build/built-jar.properties new file mode 100644 index 0000000..e829c93 --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/build/built-jar.properties @@ -0,0 +1,4 @@ +#Mon, 13 Sep 2021 11:56:55 -0700 + + +C\:\\Users\\Joel\\Dropbox\\Java\ 6ed\\java\\netbeans\\book_apps\\ch10_Product= diff --git a/murach/eclipse/book_apps/ch10_Product/build/classes/Book.class b/murach/eclipse/book_apps/ch10_Product/build/classes/Book.class new file mode 100644 index 0000000..06fa603 Binary files /dev/null and b/murach/eclipse/book_apps/ch10_Product/build/classes/Book.class differ diff --git a/murach/eclipse/book_apps/ch10_Product/build/classes/Product.class b/murach/eclipse/book_apps/ch10_Product/build/classes/Product.class new file mode 100644 index 0000000..2a28279 Binary files /dev/null and b/murach/eclipse/book_apps/ch10_Product/build/classes/Product.class differ diff --git a/murach/eclipse/book_apps/ch10_Product/build/classes/ProductApp.class b/murach/eclipse/book_apps/ch10_Product/build/classes/ProductApp.class new file mode 100644 index 0000000..18696fb Binary files /dev/null and b/murach/eclipse/book_apps/ch10_Product/build/classes/ProductApp.class differ diff --git a/murach/eclipse/book_apps/ch10_Product/build/classes/ProductDB.class b/murach/eclipse/book_apps/ch10_Product/build/classes/ProductDB.class new file mode 100644 index 0000000..ac394a8 Binary files /dev/null and b/murach/eclipse/book_apps/ch10_Product/build/classes/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch10_Product/build/classes/Software.class b/murach/eclipse/book_apps/ch10_Product/build/classes/Software.class new file mode 100644 index 0000000..a899f7d Binary files /dev/null and b/murach/eclipse/book_apps/ch10_Product/build/classes/Software.class differ diff --git a/murach/eclipse/book_apps/ch10_Product/src/Book.java b/murach/eclipse/book_apps/ch10_Product/src/Book.java new file mode 100644 index 0000000..b3e56a0 --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/src/Book.java @@ -0,0 +1,21 @@ +public class Book extends Product { + private String author; + + public Book() { + super(); // call constructor of Product superclass + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} diff --git a/murach/eclipse/book_apps/ch10_Product/src/Product.java b/murach/eclipse/book_apps/ch10_Product/src/Product.java new file mode 100644 index 0000000..e52bfda --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/src/Product.java @@ -0,0 +1,44 @@ +import java.text.NumberFormat; + +public class Product { + private String code; + private String description; + private double price; + protected static int count = 0; + + public void setCode(String code) { + this.code = code; + } + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { // create public access for the count variable + return count; + } + +} diff --git a/murach/eclipse/book_apps/ch10_Product/src/ProductApp.java b/murach/eclipse/book_apps/ch10_Product/src/ProductApp.java new file mode 100644 index 0000000..3c29095 --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/src/ProductApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p == null) { + System.out.println("No product matches this product code."); + } else { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} diff --git a/murach/eclipse/book_apps/ch10_Product/src/ProductDB.java b/murach/eclipse/book_apps/ch10_Product/src/ProductDB.java new file mode 100644 index 0000000..c075bbf --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database. + // For now, this code just uses if/else statements + // to return the correct product data. + + Product product = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book book = new Book(); + if (productCode.equalsIgnoreCase("java")) { + book.setCode(productCode); + book.setDescription("Murach's Java Programming"); + book.setPrice(57.50); + book.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + book.setCode(productCode); + book.setDescription("Murach's Java Servlets and JSP"); + book.setPrice(57.50); + book.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + book.setCode(productCode); + book.setDescription("Murach's MySQL"); + book.setPrice(54.50); + book.setAuthor("Joel Murach"); + } + product = book; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software software = new Software(); + software.setCode("netbeans"); + software.setDescription("NetBeans"); + software.setPrice(0.00); + software.setVersion("12.3"); + product = software; // set Product object equal to the Software object + } + return product; + } + +} diff --git a/murach/eclipse/book_apps/ch10_Product/src/Software.java b/murach/eclipse/book_apps/ch10_Product/src/Software.java new file mode 100644 index 0000000..a58b613 --- /dev/null +++ b/murach/eclipse/book_apps/ch10_Product/src/Software.java @@ -0,0 +1,21 @@ +public class Software extends Product { + private String version; + + public Software() { + super(); // call constructor of Product superclass + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + getVersion(); + } +} diff --git a/murach/eclipse/book_apps/ch11_LineItem/.classpath b/murach/eclipse/book_apps/ch11_LineItem/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch11_LineItem/.project b/murach/eclipse/book_apps/ch11_LineItem/.project new file mode 100644 index 0000000..c6bc729 --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/.project @@ -0,0 +1,17 @@ + + + ch11_LineItem + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch11_LineItem/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch11_LineItem/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/LineItem.class b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/LineItem.class new file mode 100644 index 0000000..14f2547 Binary files /dev/null and b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/LineItem.class differ diff --git a/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/Product.class b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/Product.class new file mode 100644 index 0000000..8afef2e Binary files /dev/null and b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/business/Product.class differ diff --git a/murach/eclipse/book_apps/ch11_LineItem/bin/murach/data/ProductDB.class b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/data/ProductDB.class new file mode 100644 index 0000000..175a905 Binary files /dev/null and b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/data/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/Console.class b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/Console.class new file mode 100644 index 0000000..b74916f Binary files /dev/null and b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/Console.class differ diff --git a/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/LineItemApp.class b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/LineItemApp.class new file mode 100644 index 0000000..5f36141 Binary files /dev/null and b/murach/eclipse/book_apps/ch11_LineItem/bin/murach/ui/LineItemApp.class differ diff --git a/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/LineItem.java b/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/LineItem.java new file mode 100644 index 0000000..f9a5768 --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/LineItem.java @@ -0,0 +1,44 @@ +package murach.business; + +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/Product.java b/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/Product.java new file mode 100644 index 0000000..7f92ec9 --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/src/murach/business/Product.java @@ -0,0 +1,70 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product. +*/ +public class Product { + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Creates a Product with the specified values. + * @param code a String for the product code + * @param description a String for the product description + * @param price a double for the product price + */ + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + /** + * Sets the product code. + * @param code a String for the product code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product code. + * @return a String for the product code + */ + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch11_LineItem/src/murach/data/ProductDB.java b/murach/eclipse/book_apps/ch11_LineItem/src/murach/data/ProductDB.java new file mode 100644 index 0000000..c92c84b --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.Product; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/Console.java b/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/Console.java new file mode 100644 index 0000000..5ba353f --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/Console.java @@ -0,0 +1,59 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java b/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..3e6fbba --- /dev/null +++ b/murach/eclipse/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java @@ -0,0 +1,44 @@ +package murach.ui; + +import murach.business.LineItem; +import murach.business.Product; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // create 1 or more line items + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString( + "Enter product code: "); + int quantity = Console.getInt( + "Enter quantity: ", 0, 1000); + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(product, quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + lineItem.getProduct().getCode()); + System.out.println("Description: " + lineItem.getProduct().getDescription()); + System.out.println("Price: " + lineItem.getProduct().getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValue/.classpath b/murach/eclipse/book_apps/ch12_FutureValue/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/.project b/murach/eclipse/book_apps/ch12_FutureValue/.project new file mode 100644 index 0000000..24d5dee --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/.project @@ -0,0 +1,23 @@ + + + ch12_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch12_FutureValue/nbactions.xml b/murach/eclipse/book_apps/ch12_FutureValue/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/pom.xml b/murach/eclipse/book_apps/ch12_FutureValue/pom.xml new file mode 100644 index 0000000..a49ae0c --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValue + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/module-info.java b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/module-info.java new file mode 100644 index 0000000..8cbd6b7 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.future_value { + requires javafx.controls; + exports murach.future_value; // This is necessary for a JavaFX application +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java new file mode 100644 index 0000000..0184c77 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java @@ -0,0 +1,17 @@ +package murach.business; + +public class FinancialCalculations { + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..becfebd --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java @@ -0,0 +1,89 @@ +package murach.future_value; + +import murach.business.FinancialCalculations; +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + // get data from text fields + double investment = Double.parseDouble(investmentField.getText()); + double rate = Double.parseDouble(interestRateField.getText()); + int years = Integer.parseInt(yearsField.getText()); + + // calculate future value + double futureValue = FinancialCalculations.calculateFutureValue( + investment, rate, years); + + // set data in read-only text field + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.properties b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.properties new file mode 100644 index 0000000..22e1da2 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch12_FutureValue +groupId=murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValue +m2e.projectName=ch12_FutureValue +version=1.0-SNAPSHOT diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.xml b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.xml new file mode 100644 index 0000000..a49ae0c --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/META-INF/maven/murach/ch12_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValue + diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/module-info.class b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/module-info.class new file mode 100644 index 0000000..8346dc8 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/module-info.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class new file mode 100644 index 0000000..cad1d96 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..7d6411b Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..c34f750 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +module-info.class +murach\business\FinancialCalculations.class +murach\future_value\FutureValueApplication.class diff --git a/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..70a9052 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\murach\future_value\FutureValueApplication.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\murach\business\FinancialCalculations.java diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/.classpath b/murach/eclipse/book_apps/ch12_FutureValueValidation/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/.project b/murach/eclipse/book_apps/ch12_FutureValueValidation/.project new file mode 100644 index 0000000..89e4690 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/.project @@ -0,0 +1,23 @@ + + + ch12_FutureValueValidation + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/nbactions.xml b/murach/eclipse/book_apps/ch12_FutureValueValidation/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/pom.xml b/murach/eclipse/book_apps/ch12_FutureValueValidation/pom.xml new file mode 100644 index 0000000..2e25ce7 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValueValidation + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValueValidation + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java new file mode 100644 index 0000000..8cbd6b7 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.future_value { + requires javafx.controls; + exports murach.future_value; // This is necessary for a JavaFX application +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java new file mode 100644 index 0000000..0184c77 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java @@ -0,0 +1,17 @@ +package murach.business; + +public class FinancialCalculations { + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..5036556 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java @@ -0,0 +1,107 @@ +package murach.future_value; + +import murach.ui.Validation; +import murach.business.FinancialCalculations; +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(yearsField.getText(), + "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + int years = Integer.parseInt( + yearsField.getText()); + + double futureValue = FinancialCalculations.calculateFutureValue( + investment, rate, years); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java new file mode 100644 index 0000000..442315a --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java @@ -0,0 +1,42 @@ +package murach.ui; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.properties b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.properties new file mode 100644 index 0000000..70ea836 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch12_FutureValueValidation +groupId=murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch12_FutureValueValidation +m2e.projectName=ch12_FutureValueValidation +version=1.0-SNAPSHOT diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.xml b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.xml new file mode 100644 index 0000000..2e25ce7 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/META-INF/maven/murach/ch12_FutureValueValidation/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValueValidation + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValueValidation + diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/module-info.class b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/module-info.class new file mode 100644 index 0000000..8346dc8 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/module-info.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class new file mode 100644 index 0000000..cad1d96 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..72b3873 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class new file mode 100644 index 0000000..cdafc64 Binary files /dev/null and b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class differ diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..f01dceb --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +murach\business\FinancialCalculations.class +murach\future_value\FutureValueApplication.class +murach\ui\Validation.class +module-info.class diff --git a/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..20f0ff5 --- /dev/null +++ b/murach/eclipse/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,4 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\future_value\FutureValueApplication.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\business\FinancialCalculations.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\ui\Validation.java diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/.classpath b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/.project b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.project new file mode 100644 index 0000000..bfa5110 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.project @@ -0,0 +1,23 @@ + + + ch13_SocialMediaSignup + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/pom.xml b/murach/eclipse/book_apps/ch13_SocialMediaSignup/pom.xml new file mode 100644 index 0000000..3300bbb --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_SocialMediaSignup + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.signup.SignupApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java b/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java new file mode 100644 index 0000000..f8284dc --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.signup { + requires javafx.controls; + exports murach.signup; +} diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java b/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java new file mode 100644 index 0000000..456a79b --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java @@ -0,0 +1,161 @@ +package murach.signup; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.TextArea; +import javafx.scene.control.Button; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.SelectionMode; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Alert; +import javafx.scene.control.DatePicker; +import javafx.stage.Stage; + +import java.util.List; + +public class SignupApp extends Application { + + private TextField nameField = new TextField(); + private DatePicker dobPicker = new DatePicker(); + private ToggleGroup genderToggle = new ToggleGroup(); + private ListView genreListView = new ListView<>(); + private ComboBox countryCombo = new ComboBox<>(); + private TextArea descriptionArea = new TextArea(); + private CheckBox notifyCheckBox = new CheckBox("Receive notifications"); + + @Override + public void start(Stage stage) { + stage.setTitle("Social Media Signup"); + VBox vbox = new VBox(10); + + // name + HBox nameBox = new HBox(10); + Label nameLabel = new Label("Name: "); + nameField.setMinWidth(209); + nameBox.getChildren().add(nameLabel); + nameBox.getChildren().add(nameField); + vbox.getChildren().add(nameBox); + + // date of birth (DOB) + HBox dobBox = new HBox(10); + Label dobLabel = new Label("Date of Birth: "); + dobBox.getChildren().add(dobLabel); + dobBox.getChildren().add(dobPicker); + vbox.getChildren().add(dobBox); + + // gender + HBox genderBox = new HBox(10); + Label genderLabel = new Label("Gender: "); + + RadioButton maleButton = new RadioButton("Male"); + maleButton.setToggleGroup(genderToggle); + maleButton.setSelected(true); + RadioButton femaleButton = new RadioButton("Female"); + femaleButton.setToggleGroup(genderToggle); + RadioButton otherButton = new RadioButton("Other"); + otherButton.setToggleGroup(genderToggle); + + genderBox.getChildren().add(genderLabel); + genderBox.getChildren().add(maleButton); + genderBox.getChildren().add(femaleButton); + genderBox.getChildren().add(otherButton); + vbox.getChildren().add(genderBox); + + // country + Label countryLabel = new Label("Country: "); + countryCombo.setPromptText("Select Country"); + String[] countries = {"United States", "Canada", "Mexico"}; + for (String country : countries) { + countryCombo.getItems().add(country); + } + vbox.getChildren().add(countryLabel); + vbox.getChildren().add(countryCombo); + + // movie genres + Label movieLabel = new Label("Favorite Movie Genres: "); + genreListView.getSelectionModel() + .setSelectionMode(SelectionMode.MULTIPLE); + String[] genres = {"Action", "Comedy", "Sci-Fi", "Horror", "Drama"}; + for (String genre : genres) { + genreListView.getItems().add(genre); + } + genreListView.setPrefHeight(genres.length * 24); + vbox.getChildren().add(movieLabel); + vbox.getChildren().add(genreListView); + + // description + Label descriptionLabel = new Label("Profile Description: "); + descriptionArea.setPrefColumnCount(35); + descriptionArea.setPrefRowCount(4); + descriptionArea.setWrapText(true); + ScrollPane descriptionScroll = new ScrollPane(descriptionArea); + vbox.getChildren().add(descriptionLabel); + vbox.getChildren().add(descriptionScroll); + + // notification + vbox.getChildren().add(notifyCheckBox); + + // button + Button signUpButton = new Button("Sign Up"); + signUpButton.setOnAction(event -> signUpButtonClicked()); + vbox.getChildren().add(signUpButton); + + vbox.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(vbox, 450, 510); + stage.setScene(scene); + stage.show(); + } + + public void signUpButtonClicked() { + // preprocess a few controls + RadioButton selectedGender = + (RadioButton) genderToggle.getSelectedToggle(); + + String country = countryCombo.getSelectionModel().getSelectedItem(); + + String genresStr = ""; + List genres = + genreListView.getSelectionModel().getSelectedItems(); + for(String genre : genres) { + genresStr += genre + " "; + } + + String notifications; + if(notifyCheckBox.isSelected()) { + notifications = "On"; + } + else { + notifications = "Off"; + } + + // build output string + String outputString = + "Name: " + nameField.getText() + "\n" + + "DOB: " + dobPicker.getValue() + "\n" + + "Gender: " + selectedGender.getText() + "\n" + + "Country: " + country + "\n" + + "Favorite movie genres: " + genresStr + "\n" + + "Profile description: " + descriptionArea.getText() + "\n" + + "Notifications: " + notifications + "\n"; + + // display output string + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle("Signup Info"); + alert.setHeaderText("Signup Confirmation"); + alert.setContentText(outputString); + alert.showAndWait(); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.properties b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.properties new file mode 100644 index 0000000..1f24250 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch13_SocialMediaSignup +groupId=Murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\book_apps\\ch13_SocialMediaSignup +m2e.projectName=ch13_SocialMediaSignup +version=1.0-SNAPSHOT diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.xml b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.xml new file mode 100644 index 0000000..3300bbb --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/META-INF/maven/Murach/ch13_SocialMediaSignup/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_SocialMediaSignup + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.signup.SignupApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class new file mode 100644 index 0000000..2a28f5c Binary files /dev/null and b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class differ diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class new file mode 100644 index 0000000..125b34b Binary files /dev/null and b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class differ diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..1b35638 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +module-info.class +murach\signup\SignupApp.class diff --git a/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..02045a5 --- /dev/null +++ b/murach/eclipse/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch13_SocialMediaSignup\src\main\java\murach\signup\SignupApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch13_SocialMediaSignup\src\main\java\module-info.java diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/.classpath b/murach/eclipse/book_apps/ch14_CreateAccount/.classpath new file mode 100644 index 0000000..06cc98d --- /dev/null +++ b/murach/eclipse/book_apps/ch14_CreateAccount/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/.project b/murach/eclipse/book_apps/ch14_CreateAccount/.project new file mode 100644 index 0000000..7de9819 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_CreateAccount/.project @@ -0,0 +1,17 @@ + + + ch14_CreateAccount + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch14_CreateAccount/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_CreateAccount/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/Console.class b/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/Console.class new file mode 100644 index 0000000..91281af Binary files /dev/null and b/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/Console.class differ diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/CreateAccountApp.class b/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/CreateAccountApp.class new file mode 100644 index 0000000..546f2bc Binary files /dev/null and b/murach/eclipse/book_apps/ch14_CreateAccount/build/classes/CreateAccountApp.class differ diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/src/Console.java b/murach/eclipse/book_apps/ch14_CreateAccount/src/Console.java new file mode 100644 index 0000000..e0cc87d --- /dev/null +++ b/murach/eclipse/book_apps/ch14_CreateAccount/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch14_CreateAccount/src/CreateAccountApp.java b/murach/eclipse/book_apps/ch14_CreateAccount/src/CreateAccountApp.java new file mode 100644 index 0000000..32788a5 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_CreateAccount/src/CreateAccountApp.java @@ -0,0 +1,66 @@ +public class CreateAccountApp { + + public static void main(String[] args) { + String fullName = getFullName(); + Console.displayLine(); + + String password = getPassword(); + Console.displayLine(); + + String msg = getSuccessMessage(fullName); + Console.displayLine(msg); + } + + private static String getFullName() { + while(true) { + String prompt = "Enter full name: "; + String name = Console.getString(prompt).trim(); + if(name.indexOf(" ") == -1) { + Console.displayLine("You must enter your full name.\n"); + } else { + return name; + } + } + } + + private static String getPassword() { + while(true) { + String prompt = "Enter password: "; + String password = Console.getString(prompt).trim(); + + boolean hasDigit = false; + boolean hasUppercase = false; + boolean isMinLength = false; + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (password.length() >= 8) { + isMinLength = true; + } + + if(hasDigit && hasUppercase && isMinLength) { + return password; + } else { + Console.displayLine("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getSuccessMessage(String fullName) { + int index = fullName.indexOf(" "); + String firstLetter = fullName.substring(0,1); + + // get and capitalize first name + String firstName = firstLetter.toUpperCase() + + fullName.substring(1, index); + + return "Hi " + firstName + ", thanks for creating an account!\n"; + } +} diff --git a/murach/eclipse/book_apps/ch14_Hangman/.classpath b/murach/eclipse/book_apps/ch14_Hangman/.classpath new file mode 100644 index 0000000..06cc98d --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch14_Hangman/.project b/murach/eclipse/book_apps/ch14_Hangman/.project new file mode 100644 index 0000000..0e7fb81 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/.project @@ -0,0 +1,17 @@ + + + ch14_Hangman + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch14_Hangman/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch14_Hangman/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch14_Hangman/build/classes/Console.class b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Console.class new file mode 100644 index 0000000..91281af Binary files /dev/null and b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Console.class differ diff --git a/murach/eclipse/book_apps/ch14_Hangman/build/classes/Hangman.class b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Hangman.class new file mode 100644 index 0000000..96ad14f Binary files /dev/null and b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Hangman.class differ diff --git a/murach/eclipse/book_apps/ch14_Hangman/build/classes/HangmanApp.class b/murach/eclipse/book_apps/ch14_Hangman/build/classes/HangmanApp.class new file mode 100644 index 0000000..1839617 Binary files /dev/null and b/murach/eclipse/book_apps/ch14_Hangman/build/classes/HangmanApp.class differ diff --git a/murach/eclipse/book_apps/ch14_Hangman/build/classes/Wordlist.class b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Wordlist.class new file mode 100644 index 0000000..6e83ca0 Binary files /dev/null and b/murach/eclipse/book_apps/ch14_Hangman/build/classes/Wordlist.class differ diff --git a/murach/eclipse/book_apps/ch14_Hangman/src/Console.java b/murach/eclipse/book_apps/ch14_Hangman/src/Console.java new file mode 100644 index 0000000..e0cc87d --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch14_Hangman/src/Hangman.java b/murach/eclipse/book_apps/ch14_Hangman/src/Hangman.java new file mode 100644 index 0000000..d62ee92 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/src/Hangman.java @@ -0,0 +1,91 @@ +public class Hangman { + private final Wordlist wordlist; + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses; + private int numWrong; + private String guessedLetters; + + public Hangman() { + wordlist = new Wordlist(); + word = wordlist.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + numGuesses = 0; + numWrong = 0; + guessedLetters = ""; + } + + public char getLetter() { + while(true) { + String prompt = "Enter a letter: "; + String s = Console.getString(prompt).toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if(Character.isLetter(c)) { + if(guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + Console.displayLine("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + Console.displayLine("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + Console.displayLine("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordlist.addSpaces(displayedWord), numGuesses, + numWrong, wordlist.addSpaces(guessedLetters)); + Console.displayLine(display); + } + + public void playGame() { + drawScreen(); + + while(numWrong < 10 && remainingLetters > 0) { + char guess = getLetter(); + int index = word.indexOf(guess); + + if(index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if(guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if(remainingLetters == 0) { + Console.displayLine(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + Console.displayLine(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } +} diff --git a/murach/eclipse/book_apps/ch14_Hangman/src/HangmanApp.java b/murach/eclipse/book_apps/ch14_Hangman/src/HangmanApp.java new file mode 100644 index 0000000..272fa42 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/src/HangmanApp.java @@ -0,0 +1,14 @@ +public class HangmanApp { + + public static void main(String[] args) { + Console.displayLine("Play the H A N G M A N game"); + String again = "y"; + + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.playGame(); + Console.displayLine(); + again = Console.getString("Play again? (y/n): "); + } + } +} diff --git a/murach/eclipse/book_apps/ch14_Hangman/src/Wordlist.java b/murach/eclipse/book_apps/ch14_Hangman/src/Wordlist.java new file mode 100644 index 0000000..8f5e334 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/src/Wordlist.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class Wordlist { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public Wordlist() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/eclipse/book_apps/ch14_Hangman/words.txt b/murach/eclipse/book_apps/ch14_Hangman/words.txt new file mode 100644 index 0000000..e97d1c0 --- /dev/null +++ b/murach/eclipse/book_apps/ch14_Hangman/words.txt @@ -0,0 +1,50 @@ +aardvark +action +activity +aftermath +agreement +air +beds +border +box +branch +cemetery +cheese +day +death +deer +design +edge +finger +fish +fruit +gold +haircut +home +ice +leather +line +look +mom +mountain +need +observation +ocean +oven +peace +pigs +playground +plough +quilt +sidewalk +smell +spade +spy +swing +throne +truck +twig +vessel +wave +wind +zipper \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch15_Invoice/.classpath b/murach/eclipse/book_apps/ch15_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch15_Invoice/.project b/murach/eclipse/book_apps/ch15_Invoice/.project new file mode 100644 index 0000000..3e5a37b --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/.project @@ -0,0 +1,17 @@ + + + ch15_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch15_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch15_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/Console.class b/murach/eclipse/book_apps/ch15_Invoice/bin/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/Console.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/Invoice.class b/murach/eclipse/book_apps/ch15_Invoice/bin/Invoice.class new file mode 100644 index 0000000..1a5b496 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/Invoice.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch15_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..998d46d Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/LineItem.class b/murach/eclipse/book_apps/ch15_Invoice/bin/LineItem.class new file mode 100644 index 0000000..5196ab7 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/LineItem.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/Product.class b/murach/eclipse/book_apps/ch15_Invoice/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/bin/ProductDB.class b/murach/eclipse/book_apps/ch15_Invoice/bin/ProductDB.class new file mode 100644 index 0000000..e2b72b6 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_Invoice/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/Console.java b/murach/eclipse/book_apps/ch15_Invoice/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/Invoice.java b/murach/eclipse/book_apps/ch15_Invoice/src/Invoice.java new file mode 100644 index 0000000..d35b1af --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/Invoice.java @@ -0,0 +1,32 @@ +import java.text.NumberFormat; +import java.util.List; +import java.util.LinkedList; + +public class Invoice { + private List lineItems; + + public Invoice() { + lineItems = new LinkedList<>(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public List getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } +} diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch15_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..e8a2ca2 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/InvoiceApp.java @@ -0,0 +1,41 @@ +public class InvoiceApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + + Invoice invoice = new Invoice(); + getLineItems(invoice); + displayInvoice(invoice); + } + + public static void getLineItems(Invoice invoice) { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice(Invoice invoice) { + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } + +} diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/LineItem.java b/murach/eclipse/book_apps/ch15_Invoice/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/Product.java b/murach/eclipse/book_apps/ch15_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch15_Invoice/src/ProductDB.java b/murach/eclipse/book_apps/ch15_Invoice/src/ProductDB.java new file mode 100644 index 0000000..bf7ed85 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/eclipse/book_apps/ch15_WordCounter/.classpath b/murach/eclipse/book_apps/ch15_WordCounter/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch15_WordCounter/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch15_WordCounter/.project b/murach/eclipse/book_apps/ch15_WordCounter/.project new file mode 100644 index 0000000..a25515a --- /dev/null +++ b/murach/eclipse/book_apps/ch15_WordCounter/.project @@ -0,0 +1,17 @@ + + + ch15_WordCounter + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch15_WordCounter/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch15_WordCounter/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch15_WordCounter/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch15_WordCounter/bin/murach/WordCounterApp.class b/murach/eclipse/book_apps/ch15_WordCounter/bin/murach/WordCounterApp.class new file mode 100644 index 0000000..365b878 Binary files /dev/null and b/murach/eclipse/book_apps/ch15_WordCounter/bin/murach/WordCounterApp.class differ diff --git a/murach/eclipse/book_apps/ch15_WordCounter/src/murach/WordCounterApp.java b/murach/eclipse/book_apps/ch15_WordCounter/src/murach/WordCounterApp.java new file mode 100644 index 0000000..9551dfa --- /dev/null +++ b/murach/eclipse/book_apps/ch15_WordCounter/src/murach/WordCounterApp.java @@ -0,0 +1,39 @@ +package murach; + +import java.util.TreeMap; + +public class WordCounterApp { + + public static void main(String[] args) { + System.out.println("The Word Counter application\n"); + + // define a string that contains text + String text = "To be or not to be, that is the question."; + + // process the string + text = text.replace(",", ""); // remove commas + text = text.replace(".", ""); // remove periods + text = text.toLowerCase(); // convert to lower case + + // split the string into an array + String[] words = text.split(" "); + + // define a map and fill it with words and their counts + var wordMap = new TreeMap(); + int count; + for (String word : words) { + if (wordMap.containsKey(word)) { // word is in map + count = wordMap.get(word); + count++; + wordMap.put(word, count); + } else { // new word for map + wordMap.put(word, 1); + } + } + + // print the entries + for (var entry : wordMap.entrySet()) { + System.out.println(entry.getKey() + ": " + entry.getValue()); + } + } +} diff --git a/murach/eclipse/book_apps/ch17_DirectorySearch/.classpath b/murach/eclipse/book_apps/ch17_DirectorySearch/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch17_DirectorySearch/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch17_DirectorySearch/.project b/murach/eclipse/book_apps/ch17_DirectorySearch/.project new file mode 100644 index 0000000..2273d7d --- /dev/null +++ b/murach/eclipse/book_apps/ch17_DirectorySearch/.project @@ -0,0 +1,17 @@ + + + ch17_DirectorySearch + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch17_DirectorySearch/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch17_DirectorySearch/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch17_DirectorySearch/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch17_DirectorySearch/bin/murach/DirectorySearchApp.class b/murach/eclipse/book_apps/ch17_DirectorySearch/bin/murach/DirectorySearchApp.class new file mode 100644 index 0000000..9c34382 Binary files /dev/null and b/murach/eclipse/book_apps/ch17_DirectorySearch/bin/murach/DirectorySearchApp.class differ diff --git a/murach/eclipse/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java b/murach/eclipse/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java new file mode 100644 index 0000000..9d9a2c9 --- /dev/null +++ b/murach/eclipse/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java @@ -0,0 +1,55 @@ +package murach; + +import java.util.Scanner; +import java.util.ArrayList; +import java.io.File; + +public class DirectorySearchApp { + + public static void main(String[] args) { + System.out.println("**** Directory Search ****"); + Scanner sc = new Scanner(System.in); + + System.out.print("Enter directory to search: "); + String directory = sc.nextLine(); + + System.out.print("Enter the file to search for: "); + String target = sc.nextLine(); + + ArrayList foundFiles = directorySearch(directory, target); + if (foundFiles.isEmpty()) { + System.out.println("NO FILES FOUND."); + } + else { + System.out.println("FILES"); + for (File file : foundFiles) { + System.out.println(file); + } + } + } + + public static ArrayList directorySearch(String directory, + String target) { + File dir = new File(directory); + File[] dirListing = dir.listFiles(); + + var foundFiles = new ArrayList(); // create empty list + if (dirListing != null) { + for (File child : dirListing) { + if (child.isDirectory()) { + ArrayList subtreeFoundFiles = directorySearch( + child.getAbsolutePath(), target); + for (File file : subtreeFoundFiles) { + foundFiles.add(file); + } + } + else { // not a directory - check if it's the target + if (child.getName().equals(target)) { + foundFiles.add(child); + } + } + } + } + return foundFiles; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch18_Invoice/.classpath b/murach/eclipse/book_apps/ch18_Invoice/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/book_apps/ch18_Invoice/.project b/murach/eclipse/book_apps/ch18_Invoice/.project new file mode 100644 index 0000000..847f8d9 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/.project @@ -0,0 +1,17 @@ + + + ch18_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch18_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch18_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/Console.class b/murach/eclipse/book_apps/ch18_Invoice/bin/Console.class new file mode 100644 index 0000000..d5c2a2b Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/Console.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/Invoice.class b/murach/eclipse/book_apps/ch18_Invoice/bin/Invoice.class new file mode 100644 index 0000000..f62a2cc Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/Invoice.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/InvoiceApp.class b/murach/eclipse/book_apps/ch18_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..74846ff Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/LineItem.class b/murach/eclipse/book_apps/ch18_Invoice/bin/LineItem.class new file mode 100644 index 0000000..ebb11d3 Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/LineItem.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/Product.class b/murach/eclipse/book_apps/ch18_Invoice/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/Product.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/bin/ProductDB.class b/murach/eclipse/book_apps/ch18_Invoice/bin/ProductDB.class new file mode 100644 index 0000000..e2b72b6 Binary files /dev/null and b/murach/eclipse/book_apps/ch18_Invoice/bin/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/Console.java b/murach/eclipse/book_apps/ch18_Invoice/src/Console.java new file mode 100644 index 0000000..76a0331 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/Console.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/Invoice.java b/murach/eclipse/book_apps/ch18_Invoice/src/Invoice.java new file mode 100644 index 0000000..3c4ac8c --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/Invoice.java @@ -0,0 +1,53 @@ +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setInvoiceDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getInvoiceDate() { + return invoiceDate; + } + + public String getInvoiceDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.SHORT); + return dtf.format(invoiceDate); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/InvoiceApp.java b/murach/eclipse/book_apps/ch18_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..ca1d17d --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + System.out.println("Invoice date: " + + invoice.getInvoiceDateFormatted() + "\n"); + + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + var lineItems = invoice.getLineItems(); + + for (LineItem lineItem : lineItems) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/LineItem.java b/murach/eclipse/book_apps/ch18_Invoice/src/LineItem.java new file mode 100644 index 0000000..29d7cf2 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/LineItem.java @@ -0,0 +1,58 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/Product.java b/murach/eclipse/book_apps/ch18_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch18_Invoice/src/ProductDB.java b/murach/eclipse/book_apps/ch18_Invoice/src/ProductDB.java new file mode 100644 index 0000000..40487c0 --- /dev/null +++ b/murach/eclipse/book_apps/ch18_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch19_ProductManager/.classpath b/murach/eclipse/book_apps/ch19_ProductManager/.classpath new file mode 100644 index 0000000..b991d6d --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/murach/eclipse/book_apps/ch19_ProductManager/.project b/murach/eclipse/book_apps/ch19_ProductManager/.project new file mode 100644 index 0000000..81c7b25 --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/.project @@ -0,0 +1,17 @@ + + + ch19_ProductManager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/book_apps/ch19_ProductManager/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/book_apps/ch19_ProductManager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/book_apps/ch19_ProductManager/build/built-jar.properties b/murach/eclipse/book_apps/ch19_ProductManager/build/built-jar.properties new file mode 100644 index 0000000..d2f1601 --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/build/built-jar.properties @@ -0,0 +1,4 @@ +#Fri, 10 Sep 2021 16:56:18 -0700 + + +C\:\\Users\\Joel\\Dropbox\\Java\ 6ed\\java\\netbeans\\book_apps\\ch19_ProductManager= diff --git a/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Console.class b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Console.class new file mode 100644 index 0000000..53edc56 Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Console.class differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Product.class b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Product.class new file mode 100644 index 0000000..434b405 Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/Product.class differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductDB.class b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductDB.class new file mode 100644 index 0000000..e7e1349 Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductDB.class differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductManagerApp.class b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductManagerApp.class new file mode 100644 index 0000000..13f46fd Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/build/classes/ProductManagerApp.class differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/products.sqlite b/murach/eclipse/book_apps/ch19_ProductManager/products.sqlite new file mode 100644 index 0000000..4e159f8 Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/products.sqlite differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/sqlite-jdbc.jar b/murach/eclipse/book_apps/ch19_ProductManager/sqlite-jdbc.jar new file mode 100644 index 0000000..88d8879 Binary files /dev/null and b/murach/eclipse/book_apps/ch19_ProductManager/sqlite-jdbc.jar differ diff --git a/murach/eclipse/book_apps/ch19_ProductManager/src/Console.java b/murach/eclipse/book_apps/ch19_ProductManager/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch19_ProductManager/src/Product.java b/murach/eclipse/book_apps/ch19_ProductManager/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch19_ProductManager/src/ProductDB.java b/murach/eclipse/book_apps/ch19_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..f906acf --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/src/ProductDB.java @@ -0,0 +1,109 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + var products = new ArrayList(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + Product p = new Product(code, description, price); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/eclipse/book_apps/ch19_ProductManager/src/ProductManagerApp.java b/murach/eclipse/book_apps/ch19_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..db8cef7 --- /dev/null +++ b/murach/eclipse/book_apps/ch19_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,69 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ch01_Test1/.classpath b/murach/eclipse/ch01_Test1/.classpath new file mode 100644 index 0000000..52f234a --- /dev/null +++ b/murach/eclipse/ch01_Test1/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ch01_Test1/.project b/murach/eclipse/ch01_Test1/.project new file mode 100644 index 0000000..7279a52 --- /dev/null +++ b/murach/eclipse/ch01_Test1/.project @@ -0,0 +1,17 @@ + + + ch01_Test1 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ch01_Test1/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/ch01_Test1/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/murach/eclipse/ch01_Test1/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/murach/eclipse/ch01_Test1/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ch01_Test1/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..6f94d6a --- /dev/null +++ b/murach/eclipse/ch01_Test1/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=23 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=23 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=23 diff --git a/murach/eclipse/ch01_Test1/bin/ch01_Test1/TestApp.class b/murach/eclipse/ch01_Test1/bin/ch01_Test1/TestApp.class new file mode 100644 index 0000000..5d90681 Binary files /dev/null and b/murach/eclipse/ch01_Test1/bin/ch01_Test1/TestApp.class differ diff --git a/murach/eclipse/ch01_Test1/src/ch01_Test1/TestApp.java b/murach/eclipse/ch01_Test1/src/ch01_Test1/TestApp.java new file mode 100644 index 0000000..878d126 --- /dev/null +++ b/murach/eclipse/ch01_Test1/src/ch01_Test1/TestApp.java @@ -0,0 +1,13 @@ +package ch01_Test1; +import java.util.Scanner; + +public class TestApp { + public static void main(String[] args) { + String myName; + System.out.println("Enter your name:\n"); + Scanner sc = new Scanner(System.in); + myName = sc.nextLine(); + System.out.println("\n" + "Welcome to the Test App, " + myName + "!"); + sc.close(); + } +} diff --git a/murach/eclipse/ex_solutions/ch01_Test/.classpath b/murach/eclipse/ex_solutions/ch01_Test/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch01_Test/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch01_Test/.project b/murach/eclipse/ex_solutions/ch01_Test/.project new file mode 100644 index 0000000..579dc21 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch01_Test/.project @@ -0,0 +1,17 @@ + + + ch01_Test + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch01_Test/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch01_Test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch01_Test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch01_Test/bin/TestApp.class b/murach/eclipse/ex_solutions/ch01_Test/bin/TestApp.class new file mode 100644 index 0000000..5f3ee50 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch01_Test/bin/TestApp.class differ diff --git a/murach/eclipse/ex_solutions/ch01_Test/src/TestApp.java b/murach/eclipse/ex_solutions/ch01_Test/src/TestApp.java new file mode 100644 index 0000000..c35ae5a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch01_Test/src/TestApp.java @@ -0,0 +1,5 @@ +public class TestApp { + public static void main(String[] args) { + System.out.println("Success!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.classpath b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.project b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.project new file mode 100644 index 0000000..4604d40 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.project @@ -0,0 +1,17 @@ + + + ch02_ex2_TestScore_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/bin/TestScoreApp.class b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/bin/TestScoreApp.class new file mode 100644 index 0000000..c57d06b Binary files /dev/null and b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/bin/TestScoreApp.class differ diff --git a/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java new file mode 100644 index 0000000..2c1bad6 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java @@ -0,0 +1,46 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, and average score +// double averageScore = (double) scoreTotal / scoreCount; + double averageScore = 0.0; + if (scoreCount > 0) { + averageScore = (double) scoreTotal / scoreCount; + } + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.classpath b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.project b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.project new file mode 100644 index 0000000..f933385 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.project @@ -0,0 +1,17 @@ + + + ch02_ex3_Invoice_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/bin/InvoiceApp.class b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/bin/InvoiceApp.class new file mode 100644 index 0000000..d43c853 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..233ed28 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,63 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // initialize variables for use in calculating averages + double invoiceTotal = 0.0; + double discountTotal = 0.0; + int invoiceCount = 0; + + // perform invoice calculations until choice is "n" or "N" + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 500) { + discountPercent = .25; + } else if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // accumulate the invoice count and invoice total + invoiceTotal = invoiceTotal + total; + discountTotal = discountTotal + discountAmount; + invoiceCount = invoiceCount + 1; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + + // calculate and display invoice count, average invoice, and average discount + String message = "Number of invoices: " + invoiceCount + "\n" + + "Average invoice: " + invoiceTotal / invoiceCount + "\n" + + "Average discount: " + discountTotal / invoiceCount + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.classpath b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.project b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.project new file mode 100644 index 0000000..e50a401 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.project @@ -0,0 +1,17 @@ + + + ch03_ex1_MPG_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/bin/MPGApp.class b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/bin/MPGApp.class new file mode 100644 index 0000000..d659c24 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/bin/MPGApp.class differ diff --git a/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java new file mode 100644 index 0000000..9cb8008 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java @@ -0,0 +1,37 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class MPGApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Miles Per Gallon calculator"); + System.out.println(); // print a blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter miles driven: "); + input = sc.nextLine(); + double miles = Double.parseDouble(input); + + System.out.print("Enter gallons of gas used: "); + input = sc.nextLine(); + double gallons = Double.parseDouble(input); + + double mpg = miles/gallons; + //mpg = (double) Math.round(mpg * 100) / 100; + //System.out.println("Miles per gallon is " + mpg + "."); + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMaximumFractionDigits(2); + System.out.println("Miles per gallon is " + number.format(mpg) + "."); + System.out.println(); + + System.out.print("Calculate another MPG? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.classpath b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.project b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.project new file mode 100644 index 0000000..3430520 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.project @@ -0,0 +1,17 @@ + + + ch03_ex2_TestScore_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/bin/TestScoreApp.class b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/bin/TestScoreApp.class new file mode 100644 index 0000000..2d9f977 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/bin/TestScoreApp.class differ diff --git a/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java new file mode 100644 index 0000000..c9eaf7b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java @@ -0,0 +1,54 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + int maximumScore = 0; // start with the lowest score possible + int minimumScore = 100; // start with the highest score possible + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount++; + scoreTotal += testScore; + maximumScore = Math.max(maximumScore, testScore); + minimumScore = Math.min(minimumScore, testScore); + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, average score, + // highest score, and lowest score + double averageScore = (double) scoreTotal / scoreCount; + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMaximumFractionDigits(1); + + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + //+ "Average score: " + averageScore + "\n" + + "Average score: " + number.format(averageScore) + "\n" + + "Highest score: " + maximumScore + "\n" + + "Lowest score: " + minimumScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.project new file mode 100644 index 0000000..8b83f06 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch04_ex1_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/bin/FutureValueApp.class b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/bin/FutureValueApp.class new file mode 100644 index 0000000..4414d3a Binary files /dev/null and b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..676ebc2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + System.out.println("Month " + i + ": " + futureValue); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.classpath b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.project b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.project new file mode 100644 index 0000000..56158c8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.project @@ -0,0 +1,17 @@ + + + ch04_ex2_Invoice_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/bin/InvoiceApp.class b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/bin/InvoiceApp.class new file mode 100644 index 0000000..a2da387 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..4f63810 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,63 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c/t): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = .1; // default discount + if (customerType.equalsIgnoreCase("r")) { + if (subtotal >= 500) { + discountPercent = .3; + } else if (subtotal >= 250) { + discountPercent = .25; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + } + else if (customerType.equalsIgnoreCase("c")) { + discountPercent = .2; + } + else if (customerType.equalsIgnoreCase("t")) { + if (subtotal < 500) { + discountPercent = .4; + } else { + discountPercent = .5; + } + } + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.classpath b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.project b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.project new file mode 100644 index 0000000..d090197 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.project @@ -0,0 +1,17 @@ + + + ch04_ex3_GuessNumber_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/bin/GuessNumberApp.class b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/bin/GuessNumberApp.class new file mode 100644 index 0000000..8d8b3cd Binary files /dev/null and b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/bin/GuessNumberApp.class differ diff --git a/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java new file mode 100644 index 0000000..f6afba4 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + int guess = 0; + while (guess != number) { + System.out.print("Your guess: "); + guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + } else if (guess < number) { + System.out.println("Too low."); + count++; + } else if (guess > number) { + System.out.println("Too high."); + count++; + } + } + System.out.println("You guessed it in " + count + " tries.\n"); + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.project new file mode 100644 index 0000000..78eb2e7 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch04_ex4_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/bin/FutureValueApp.class b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/bin/FutureValueApp.class new file mode 100644 index 0000000..e222e97 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..bc43bfa --- /dev/null +++ b/murach/eclipse/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,62 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + System.out.println(); + + // get currency and percent formatters + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + + // display the header row + System.out.printf("%-5s", "Year"); + for (double rate = 5.0; rate < 7.0; rate += .5) { + System.out.printf("%12s", percent.format(rate/100)); + } + System.out.println(); + + // display one row for each year + for (int year = 1; year <= years; year++) { + // add year to first column + System.out.printf("%-5s", year); + + // display one column for each interest rate + for (double rate = 5.0; rate < 7.0; rate += .5) { + int months = year * 12; + double monthlyInterestRate = rate/12/100; + + // calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // add future value to its column + System.out.printf("%12s", currency.format(futureValue)); + } + System.out.println(); // start a new row + } + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.project new file mode 100644 index 0000000..76520a2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch05_ex1_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/bin/FutureValueApp.class b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/bin/FutureValueApp.class new file mode 100644 index 0000000..131f0ff Binary files /dev/null and b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..3e6f1a7 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,120 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + printFormattedResults(monthlyInvestment, interestRate, + years, futureValue); + + // see if the user wants to continue + choice = askToContinue(sc); + } + } + + private static void printFormattedResults(double monthlyInvestment, + double interestRate, int years, double futureValue) { + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + } + + public static String askToContinue(Scanner sc) { + System.out.print("Continue? (y/n): "); + String choice = sc.nextLine(); + System.out.println(); + return choice; + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + double value = Double.parseDouble(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + int value = Integer.parseInt(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.classpath b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.project b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.project new file mode 100644 index 0000000..1909a9c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.project @@ -0,0 +1,17 @@ + + + ch05_ex2_GuessNumber_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/bin/GuessNumberApp.class b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/bin/GuessNumberApp.class new file mode 100644 index 0000000..073b666 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/bin/GuessNumberApp.class differ diff --git a/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java new file mode 100644 index 0000000..5a9653c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java @@ -0,0 +1,54 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess; + try { + guess = Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid number. Try again."); + continue; + } + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.classpath b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.project b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.project new file mode 100644 index 0000000..c1e245b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.project @@ -0,0 +1,17 @@ + + + ch06_ex1_Invoice_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/bin/InvoiceApp.class b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/bin/InvoiceApp.class new file mode 100644 index 0000000..41077b4 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..5922a22 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,68 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + double subtotal = 0.0; + while (true) { // continue until user enters valid data + System.out.print("Enter subtotal: "); + try { + subtotal = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value.\n"); + } + } + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100 && subtotal < 250) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.project new file mode 100644 index 0000000..e512b79 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch06_ex2_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/bin/FutureValueApp.class b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/bin/FutureValueApp.class new file mode 100644 index 0000000..0b2431d Binary files /dev/null and b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..722e015 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,112 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + //System.out.println("month " + i + " futureValue: " + futureValue); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.classpath b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.project b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.project new file mode 100644 index 0000000..574ff04 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.project @@ -0,0 +1,17 @@ + + + ch07_ex1_Product_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/Product.class new file mode 100644 index 0000000..767eab5 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductApp.class b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductApp.class new file mode 100644 index 0000000..8e32e79 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductDB.class b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductDB.class new file mode 100644 index 0000000..8cc9f4e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/Product.java b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/Product.java new file mode 100644 index 0000000..fc647eb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/Product.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public String getPriceNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(2); + String priceFormatted = number.format(price); + return priceFormatted; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..8e5f0ac --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + ProductDB db = new ProductDB(); + Product product = db.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceNumberFormat()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..780fa66 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java @@ -0,0 +1,26 @@ +public class ProductDB { + + public Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product; + + // fill the Product object with data + if (productCode.equalsIgnoreCase("java")) { + product = new Product(productCode, "Murach's Java Programming", 57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product = new Product(productCode, "Murach's Java Servlets and JSP", 57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product = new Product(productCode, "Murach's MySQL", 54.50); + } else if (productCode.equalsIgnoreCase("andr")) { + product = new Product(productCode, "Murach's Android Programming", 57.50); + } else { + product = new Product(productCode, "Unknown", 0); + } + return product; + } +} diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.project new file mode 100644 index 0000000..9390142 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch07_ex2_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/Console.class b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/Console.class new file mode 100644 index 0000000..6009f51 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FinancialCalculations.class b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FinancialCalculations.class new file mode 100644 index 0000000..209146d Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FinancialCalculations.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FutureValueApp.class b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FutureValueApp.class new file mode 100644 index 0000000..25ab8c0 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java new file mode 100644 index 0000000..cba5085 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java @@ -0,0 +1,51 @@ +import java.util.Scanner; + +public class Console { + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java new file mode 100644 index 0000000..b5eb693 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java @@ -0,0 +1,16 @@ +public class FinancialCalculations { + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..1e40644 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,49 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = FinancialCalculations.calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.classpath b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.project b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.project new file mode 100644 index 0000000..1c12c17 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.project @@ -0,0 +1,17 @@ + + + ch07_ex3_AreaAndPerimeter_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/AreaAndPerimeterApp.class b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/AreaAndPerimeterApp.class new file mode 100644 index 0000000..219f3b3 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/AreaAndPerimeterApp.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/Rectangle.class b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/Rectangle.class new file mode 100644 index 0000000..a80c76e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/bin/Rectangle.class differ diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java new file mode 100644 index 0000000..8ac2dbd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class AreaAndPerimeterApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Area and Perimeter Calculator"); + System.out.println(); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get input from user + System.out.print("Enter length: "); + double length = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter width: "); + double width = Double.parseDouble(sc.nextLine()); + + // create the Rectangle object + Rectangle r = new Rectangle(length, width); + + // format and display output + String message = + "Area: " + r.getAreaNumberFormat() + "\n" + + "Perimeter: " + r.getPerimeterNumberFormat() + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java new file mode 100644 index 0000000..7342de2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Rectangle { + private double length; + private double width; + + public Rectangle() { + length = 0; + width = 0; + } + + public Rectangle(double length, double width) { + this.length = length; + this.width = width; + } + + public double getLength() { + return length; + } + + public void setLength(double length) { + this.length = length; + } + + public double getWidth() { + return width; + } + + public void setWidth(double width) { + this.width = width; + } + + public double getArea() { + double area = width * length; + return area; + } + + public String getAreaNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String numberFormatted = number.format(this.getArea()); + return numberFormatted; + } + + public double getPerimeter() { + double perimeter = 2 * width + 2 * length; + return perimeter; + } + + public String getPerimeterNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String numberFormatted = number.format(this.getPerimeter()); + return numberFormatted; + } +} diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.classpath b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.project b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.project new file mode 100644 index 0000000..0d8823b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.project @@ -0,0 +1,17 @@ + + + ch08_ex1_MonthSales_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/Console.class b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/Console.class new file mode 100644 index 0000000..91281af Binary files /dev/null and b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/MonthSalesApp.class b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/MonthSalesApp.class new file mode 100644 index 0000000..5e5e79f Binary files /dev/null and b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/bin/MonthSalesApp.class differ diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java new file mode 100644 index 0000000..97c32f2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java new file mode 100644 index 0000000..4cc098a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class MonthSalesApp { + + public static void main(String[] args) { + System.out.println("Monthly Sales\n"); + + // declare monthName and monthSales arrays + String[] monthNames = {"January", "February", "March", "April", "May", + "June", "July", "August", "September", "October", "November", + "December"}; + double[] monthSales = {1287.45, 2814.57, 1784.59, 2287.66, 3174.73, + 2799.41, 2458.79, 2697.45, 3279.62, 2970.77, 2788.09, 2349.88}; + + // get currency formatting + NumberFormat currency = NumberFormat.getCurrencyInstance(); + + // get one or more months + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + int monthNumber = Console.getInt("Enter month number: "); + + // validate input + if (monthNumber < 1 || monthNumber > monthNames.length) { + Console.displayLine("Invalid month number. Try again."); + continue; + } + + // get the index number for the month + // and display the month name and sales + int monthIndex = monthNumber - 1; + Console.displayLine("Sales for " + monthNames[monthIndex] + + ": " + currency.format(monthSales[monthIndex]) + "\n"); + + // check if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + Console.displayLine(); + } + + // display the total sales for the year + double sum = 0.0; + for (double sales : monthSales) { + sum += sales; + } + Console.displayLine("Total sales: " + currency.format(sum)); + Console.displayLine(); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.classpath b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.project b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.project new file mode 100644 index 0000000..f78bef0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.project @@ -0,0 +1,17 @@ + + + ch08_ex2_CardDeck_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/bin/CardDeckApp.class b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/bin/CardDeckApp.class new file mode 100644 index 0000000..9e7586e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/bin/CardDeckApp.class differ diff --git a/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java new file mode 100644 index 0000000..b76a93e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java @@ -0,0 +1,57 @@ +import java.util.Arrays; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + String[] deck = new String[52]; + int i = 0; + for (String suit : suits) { + for (String rank : ranks) { + deck[i] = rank + " of " + suit; + i++; + } + } + return deck; + } + + private static void displayCards(String[] cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(String[] deck) { + for (int i = 0; i < deck.length; i++) { + String savedCard = deck[i]; + int randomIndex = (int) (Math.random() * deck.length-1); + deck[i] = deck[randomIndex]; + deck[randomIndex] = savedCard; + } + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = Arrays.copyOfRange(deck, 0, count); + return hand; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.classpath b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.project b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.project new file mode 100644 index 0000000..c7ef281 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.project @@ -0,0 +1,17 @@ + + + ch08_ex3_CardDeck_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/bin/CardDeckApp.class b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/bin/CardDeckApp.class new file mode 100644 index 0000000..56f23f5 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/bin/CardDeckApp.class differ diff --git a/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java new file mode 100644 index 0000000..a87c888 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java @@ -0,0 +1,62 @@ +import java.util.ArrayList; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + ArrayList deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + int hands = 4; + System.out.println("FOUR HANDS OF " + count + " CARDS"); + for (int i = 0; i < hands; i++) { + ArrayList hand = dealCards(deck, count); + displayCards(hand); + } + System.out.println("CARDS LEFT IN DECK: " + deck.size()); + } + + private static ArrayList getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + var deck = new ArrayList(52); + for (String suit : suits) { + for (String rank : ranks) { + deck.add(rank + " of " + suit); + } + } + return deck; + } + + private static void displayCards(ArrayList cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(ArrayList deck) { + for (int i = 0; i < deck.size(); i++) { + String savedCard = deck.get(i); + int randomIndex = (int) (Math.random() * deck.size() - 1); + deck.set(i, deck.get(randomIndex)); + deck.set(randomIndex, savedCard); + } + } + + private static ArrayList dealCards(ArrayList deck, int count) { + var hand = new ArrayList(count); + for (int i = 0; i < count; i++) { + hand.add(deck.remove(i)); + } + return hand; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.classpath b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.project b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.project new file mode 100644 index 0000000..5f4c4dd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.project @@ -0,0 +1,17 @@ + + + ch09_ex1_CustomerManager_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Console.class b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Customer.class b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Customer.class new file mode 100644 index 0000000..b5abe18 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/Customer.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerDB.class b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerDB.class new file mode 100644 index 0000000..e060ad3 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerDB.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerManagerApp.class b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerManagerApp.class new file mode 100644 index 0000000..bb1e982 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/bin/CustomerManagerApp.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt new file mode 100644 index 0000000..6419de1 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt @@ -0,0 +1,3 @@ +Thomas Willliams tomwilliams@gmail.com +Jane Adams janeadams@yahoo.com +Robert Rodriguez robertrodriguez@sbcglobal.net diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java new file mode 100644 index 0000000..ec622e7 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java @@ -0,0 +1,44 @@ +public class Customer { + + private String firstName; + private String lastName; + private String email; + + public Customer() { + this("", "", ""); + } + + public Customer(String firstName, String lastName, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getFirstName() { + return firstName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getLastName() { + return lastName; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEmail() { + return email; + } + + public String getName() { + return firstName + " " + lastName; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java new file mode 100644 index 0000000..5e5a963 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public final class CustomerDB { + + private static final String FILENAME = "customers.txt"; + private static final String COL_SEP = "\t"; + + public static ArrayList getAll() { + var customers = new ArrayList(); + + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COL_SEP); + String first = columns[0]; + String last = columns[1]; + String email = columns[2]; + + Customer c = new Customer(first, last, email); + customers.add(c); + + line = in.readLine(); + } + return customers; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList customers) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + for (Customer c : customers) { + out.print(c.getFirstName()+ COL_SEP); + out.print(c.getLastName()+ COL_SEP); + out.println(c.getEmail()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java new file mode 100644 index 0000000..c0437cb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java @@ -0,0 +1,86 @@ +import java.util.ArrayList; + +public class CustomerManagerApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Manager\n"); + + // create the db object and get the list of customers + ArrayList customers = CustomerDB.getAll(); + + // display the command menu + displayMenu(); + + // perform 1 or more actions + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + // get the input from the user + action = Console.getString("Enter a command: "); + System.out.println(); + + if (action.equalsIgnoreCase("list")) { + displayAll(customers); + } else if (action.equalsIgnoreCase("add")) { + addCustomer(customers); + } else if (action.equalsIgnoreCase("del") || + action.equalsIgnoreCase("delete")) { + deleteCustomer(customers); + } else if (action.equalsIgnoreCase("help") || + action.equalsIgnoreCase("menu")) { + displayMenu(); + } else if (action.equalsIgnoreCase("exit")) { + System.out.println("Bye.\n"); + } else { + System.out.println("Error! Not a valid command.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all customers"); + System.out.println("add - Add a customer"); + System.out.println("del - Delete a customer"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList customers) { + System.out.println("CUSTOMER LIST"); + + String format = "%-27s%-40s%n"; + for (Customer c : customers) { + System.out.printf(format, c.getName(), c.getEmail()); + } + System.out.println(); + } + + public static void addCustomer(ArrayList customers) { + String firstName = Console.getString("Enter first name: "); + String lastName = Console.getString("Enter last name: "); + String email = Console.getString("Enter customer email: "); + + Customer customer = new Customer(firstName, lastName, email); + customers.add(customer); + CustomerDB.saveAll(customers); + + System.out.println(customer.getName() + " has been added.\n"); + } + + public static void deleteCustomer(ArrayList customers) { + String email = Console.getString("Enter email to delete: "); + + for (Customer c : customers) { + if (c.getEmail().equals(email)) { + customers.remove(c); + CustomerDB.saveAll(customers); // save list to file + System.out.println(c.getName() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No customer matches that email.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.classpath b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.project b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.project new file mode 100644 index 0000000..6eb8ff2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.project @@ -0,0 +1,17 @@ + + + ch09_ex2_ProductManager_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Console.class b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Console.class new file mode 100644 index 0000000..86b38bb Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Product.class new file mode 100644 index 0000000..434b405 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductDB.class b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductDB.class new file mode 100644 index 0000000..b6e4812 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductManagerApp.class b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductManagerApp.class new file mode 100644 index 0000000..56a6902 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/bin/ProductManagerApp.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/products.txt b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java new file mode 100644 index 0000000..9d6260b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "productsX.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java new file mode 100644 index 0000000..d55c4f5 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java @@ -0,0 +1,82 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + var products = ProductDB.getAll(); + + // check if read was successful + if (products == null) { + System.out.println("Unable to read data."); + System.out.println("Exiting application."); + return; // exit main() method + } + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.classpath b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.project b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.project new file mode 100644 index 0000000..945a326 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.project @@ -0,0 +1,17 @@ + + + ch09_ex3_ExceptionTester_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/bin/ExceptionTesterApp.class b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/bin/ExceptionTesterApp.class new file mode 100644 index 0000000..b7e613a Binary files /dev/null and b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/bin/ExceptionTesterApp.class differ diff --git a/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java new file mode 100644 index 0000000..39e352b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java @@ -0,0 +1,36 @@ +import java.io.*; + +public class ExceptionTesterApp { + + public static void main(String[] args) { + System.err.println("In main: calling method1."); + method1(); + System.err.println("In main: returned from method1."); + } + + public static void method1() { + System.err.println("\tIn method1: calling method2."); + try { + method2(); + } catch (FileNotFoundException e) { + System.err.println(e); + } + System.err.println("\tIn method1: returned from method2."); + } + + public static void method2() throws FileNotFoundException { + System.err.println("\t\tIn method2: calling method3."); + method3(); + System.err.println("\t\tIn method2: returned from method3."); + } + + public static void method3() throws FileNotFoundException { + System.err.println("\t\t\tIn method3: Entering."); + + if (true) { + throw new FileNotFoundException("This is a test"); + } + + System.err.println("\t\t\tIn method3: Exiting."); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.classpath b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.project b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.project new file mode 100644 index 0000000..bb4c29e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.project @@ -0,0 +1,17 @@ + + + ch10_ex1_Product_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Album.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Album.class new file mode 100644 index 0000000..d118e31 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Album.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Book.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Book.class new file mode 100644 index 0000000..dce7248 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Book.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Product.class new file mode 100644 index 0000000..f0f4c6e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductApp.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductApp.class new file mode 100644 index 0000000..33c40b4 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductDB.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductDB.class new file mode 100644 index 0000000..b93e3d5 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Software.class b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Software.class new file mode 100644 index 0000000..193c473 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/bin/Software.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Album.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Album.java new file mode 100644 index 0000000..c7e684f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Album.java @@ -0,0 +1,23 @@ +public class Album extends Product { + + private String artist; + + public Album() { + super(); + artist = ""; + count++; + } + + public void setArtist(String artist) { + this.artist = artist; + } + + public String getArtist() { + return artist; + } + + @Override + public String toString() { + return super.toString() + " (" + artist + ")"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Book.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Product.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Product.java new file mode 100644 index 0000000..14fb621 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..e1b62bb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java @@ -0,0 +1,49 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } else if (productCode.equalsIgnoreCase("sgtp")) { + Album a = new Album(); + a.setCode("sgtp"); + a.setDescription("Sgt. Peppers"); + a.setPrice(14.99); + a.setArtist("The Beatles"); + p = a; // set Product object equal to the Album object + } + return p; + } +} diff --git a/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Software.java b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex1_Product_sol/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.classpath b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.project b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.project new file mode 100644 index 0000000..f5d4fc0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.project @@ -0,0 +1,17 @@ + + + ch10_ex2_Product_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Book.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Book.class new file mode 100644 index 0000000..650ba44 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Book.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Product.class new file mode 100644 index 0000000..4375afd Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductApp.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductApp.class new file mode 100644 index 0000000..719e8e9 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductDB.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductDB.class new file mode 100644 index 0000000..e0cdfee Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Software.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Software.class new file mode 100644 index 0000000..a424e1a Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/Software.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/UsedBook.class b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/UsedBook.class new file mode 100644 index 0000000..bccc978 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/bin/UsedBook.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Book.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Book.java new file mode 100644 index 0000000..8c2089e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String getDisplayText() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Product.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Product.java new file mode 100644 index 0000000..6e77dbd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Product.java @@ -0,0 +1,52 @@ +import java.text.NumberFormat; + +public abstract class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public abstract String getDisplayText(); + + public static int getCount() { + return count; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..d9cc3ac --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.getDisplayText()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..944af49 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Software.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Software.java new file mode 100644 index 0000000..e2e50bd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String getDisplayText() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java new file mode 100644 index 0000000..f314f02 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java @@ -0,0 +1,8 @@ +public class UsedBook extends Book { + + @Override + public String getDisplayText() { + return ""; + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.classpath b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.classpath new file mode 100644 index 0000000..06cc98d --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.project b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.project new file mode 100644 index 0000000..fe9dc65 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.project @@ -0,0 +1,17 @@ + + + ch10_ex3_EqualsTest_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/built-jar.properties b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/built-jar.properties new file mode 100644 index 0000000..dbc6904 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/built-jar.properties @@ -0,0 +1,4 @@ +#Thu, 09 Sep 2021 16:15:25 -0700 + + +C\:\\Users\\Joel\\Dropbox\\Java\ 6ed\\java\\netbeans\\ex_solutions\\ch10_ex3_EqualsTest_sol= diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/EqualsTestApp.class b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/EqualsTestApp.class new file mode 100644 index 0000000..3fbe3b6 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/EqualsTestApp.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/LineItem.class b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/LineItem.class new file mode 100644 index 0000000..f5ae236 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/LineItem.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/Product.class b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/Product.class new file mode 100644 index 0000000..9097d86 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/build/classes/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java new file mode 100644 index 0000000..15dad47 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java @@ -0,0 +1,40 @@ +public class EqualsTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Equals Tester\n"); + + //Both variables refer to different objects that store the same data + Product product1 = new Product("java", "Murach's Java Programming", 57.5); + Product product2 = new Product("java", "Murach's Java Programming", 57.5); + // test equals() method + if (product1.equals(product2)) { + System.out.println("The Product class is comparing data."); + } else { + System.out.println("The Product class is comparing references."); + } + // test hashCode() method + if (product1.hashCode() == product2.hashCode()) { + System.out.println("The Product object hash codes match."); + } else { + System.out.println("The Product object hash codes are different."); + } + System.out.println(); + + //Both variables refer to different objects that store the same data + LineItem li1 = new LineItem(product1, 1); + LineItem li2 = new LineItem(product2, 1); + // test equals() method + if (li1.equals(li2)) { + System.out.println("The LineItem class is comparing data."); + } else { + System.out.println("The LineItem class is comparing references."); + } + // test hashCode() method + if (li1.hashCode() == li2.hashCode()) { + System.out.println("The LineItem object hash codes match."); + } else { + System.out.println("The LineItem object hash codes are different."); + } + System.out.println(); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java new file mode 100644 index 0000000..722724e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + product = new Product(); + quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + double total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object instanceof LineItem lineItem){ + return product.equals(lineItem.product) && + quantity == lineItem.quantity; + } else { + return false; + } + } + + @Override + public int hashCode() { + return product.hashCode() + quantity; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java new file mode 100644 index 0000000..8871d39 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java @@ -0,0 +1,67 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object instanceof Product p){ + return code.equals(p.code) && + description.equals(p.description) && + price == p.price; + } else { + return false; + } + } + + @Override + public int hashCode() { + return code.hashCode() + description.hashCode() + (int) price; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.classpath b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.project b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.project new file mode 100644 index 0000000..2292821 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.project @@ -0,0 +1,17 @@ + + + ch11_ex1_DisplayableTest_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DepartmentConstants.class b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DepartmentConstants.class new file mode 100644 index 0000000..f705845 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DepartmentConstants.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Displayable.class b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Displayable.class new file mode 100644 index 0000000..ef7d89b Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Displayable.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DisplayableTestApp.class b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DisplayableTestApp.class new file mode 100644 index 0000000..e3a65a4 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/DisplayableTestApp.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Employee.class b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Employee.class new file mode 100644 index 0000000..ede8ade Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Employee.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Product.class new file mode 100644 index 0000000..9d77a56 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java new file mode 100644 index 0000000..44c68be --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java @@ -0,0 +1,5 @@ +public interface DepartmentConstants { + int ADMIN = 1; + int EDITORIAL = 2; + int MARKETING = 3; +} diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java new file mode 100644 index 0000000..1ab1f0f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java @@ -0,0 +1,5 @@ +public interface Displayable { + default String getDisplayText() { + return toString(); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java new file mode 100644 index 0000000..8cb5962 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java @@ -0,0 +1,21 @@ +public class DisplayableTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Displayable Test application\n"); + + // create an Employee object and display it + Displayable e = new Employee(2, "Smith", "John"); + display(e); + + // create a Product object and display it + Displayable p = new Product("java", "Murach's Java Programming", 57.50); + display(p); + + System.out.println(); + } + + private static void display(Displayable d) { + System.out.println(d.getDisplayText()); + } + +} diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java new file mode 100644 index 0000000..1159ef1 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java @@ -0,0 +1,26 @@ +public class Employee implements DepartmentConstants, Displayable { + + private int department; + private String firstName; + private String lastName; + + public Employee(int department, String lastName, String firstName) { + this.department = department; + this.lastName = lastName; + this.firstName = firstName; + } + + @Override + public String toString() { + String text = ""; + text += firstName + " " + lastName; + String dept = switch (department) { + case ADMIN -> "Administration"; + case EDITORIAL -> "Editorial"; + case MARKETING -> "Marketing"; + default -> ""; + }; + text += " (" + dept + ")"; + return text; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java new file mode 100644 index 0000000..9476e2a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Product implements Displayable { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return getDescription(); + } + + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.classpath b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.project b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.project new file mode 100644 index 0000000..f34bdfb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.project @@ -0,0 +1,17 @@ + + + ch11_ex2_Enumeration_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerType.class b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerType.class new file mode 100644 index 0000000..78e2934 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerType.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerTypeApp.class b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerTypeApp.class new file mode 100644 index 0000000..1682401 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/bin/CustomerTypeApp.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java new file mode 100644 index 0000000..3a695f6 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java @@ -0,0 +1,16 @@ +public enum CustomerType { + RETAIL, + TRADE, + COLLEGE; + + @Override + public String toString() { + String s = switch (this.ordinal()) { + case 0 -> "Retail customer"; + case 1 -> "Trade customer"; + case 2 -> "College customer"; + default -> ""; + }; + return s; + } +} diff --git a/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java new file mode 100644 index 0000000..2efa04c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java @@ -0,0 +1,28 @@ +public class CustomerTypeApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Type Test application\n"); + + // get and display the discount percent for a customer type + CustomerType trade = CustomerType.TRADE; + double discountPercent = getDiscountPercent(trade); + System.out.println("discountPercent: " + discountPercent + "\n"); + + // display the value of the toString method of a customer type + System.out.println("toString: " + trade.toString() + "\n"); + } + + // a method that accepts a CustomerType enumeration + public static double getDiscountPercent(CustomerType ct) { + double discountPercent = 0; + if (ct != null) { + switch (ct) { + case RETAIL -> discountPercent = 0.10; + case TRADE -> discountPercent = 0.30; + case COLLEGE -> discountPercent = 0.20; + } + } + return discountPercent; + } +} diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.classpath b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.project b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.project new file mode 100644 index 0000000..dd958ae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.project @@ -0,0 +1,17 @@ + + + ch11_ex3_LineItem_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/LineItem.class b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/LineItem.class new file mode 100644 index 0000000..73aef50 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/LineItem.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/Product.class b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/Product.class new file mode 100644 index 0000000..dc95783 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/business/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/data/ProductDB.class b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/data/ProductDB.class new file mode 100644 index 0000000..175a905 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/data/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/Console.class b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/Console.class new file mode 100644 index 0000000..9a9c0cf Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/LineItemApp.class b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/LineItemApp.class new file mode 100644 index 0000000..3fe2998 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/bin/murach/ui/LineItemApp.class differ diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java new file mode 100644 index 0000000..70a2309 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java @@ -0,0 +1,51 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The LineItem class represents a line item and is used by the + * Product class. + */ +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + product = null; + quantity = 0; + total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getTotal() { + total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java new file mode 100644 index 0000000..9cd4082 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java @@ -0,0 +1,84 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product and is used by the + * LineItem class. + * @author Joel Murach + * @version 1.0.0 +*/ +public class Product { + + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Sets the product's code. + * @param code a String for the product's code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product's code. + * @return a String for the product's code + */ + public String getCode() { + return code; + } + + /** + * Sets the product's description. + * @param description a String for the product's description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Gets the product's description. + * @return a String for the product's description + */ + public String getDescription() { + return description; + } + + /** + * Sets the product's price. + * @param price a double value for the product's price + */ + public void setPrice(double price) { + this.price = price; + } + + /** + * Gets a double value for the product's price. + * @return a double value that represents the product's price + */ + public double getPrice() { + return price; + } + + /** + * Gets a String for the product's price with + * standard currency formatting + * @return a String for the product's price with + * standard currency formatting applied ($1,000.00). + */ + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java new file mode 100644 index 0000000..f4a982a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.*; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java new file mode 100644 index 0000000..2b64312 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java @@ -0,0 +1,104 @@ +package murach.ui; + +import java.util.Scanner; + +/** + * The Console class provides methods that can be used to get + * input from a console application. + */ +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + /** + * Displays the specified prompt to the console and gets + * a String from the user. + * + * @param prompt A String prompt to the user. + * @return A String entered by the user. + */ + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + /** + * Displays the specified prompt to the console and + * gets an int value from the user. + * + * @param prompt A String prompt to the user. + * @return An int value entered by the user. + */ + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets an int value from the user + * that's within the specified range. + * + * @param prompt A String prompt to the user. + * @param min The minimum int value. + * @param max The maximum int value. + * @return An int value entered by the user. + */ + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets a double value from the user. + * + * @param prompt A String prompt to the user. + * @return A double value entered by the user. + */ + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets a double value from the user + * that's within the specified range. + * + * @param prompt A String prompt to the user. + * @param min The minimum double value. + * @param max The maximum double value. + * @return A double value entered by the user. + */ + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..c953983 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java @@ -0,0 +1,43 @@ +package murach.ui; + +import murach.business.*; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: ", 0, 1000); + + // use the ProductDB class to get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(); + lineItem.setProduct(product); + lineItem.setQuantity(quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + product.getCode()); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.classpath b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.project b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.project new file mode 100644 index 0000000..50a4c15 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.project @@ -0,0 +1,23 @@ + + + ch12_ex1_MPG_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/pom.xml b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/pom.xml new file mode 100644 index 0000000..2d22234 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..d21fbf6 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,66 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.properties b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.properties new file mode 100644 index 0000000..39f1f4b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch12_ex1_MPG_sol +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex1_MPG_sol +m2e.projectName=ch12_ex1_MPG_sol +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.xml b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.xml new file mode 100644 index 0000000..2d22234 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..cb5481e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class new file mode 100644 index 0000000..188a528 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..68f13e4 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\murach\mpg\MpgApp.class +module-info.class diff --git a/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..109d831 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex1_MPG_sol\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex1_MPG_sol\src\main\java\module-info.java diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.classpath b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.project b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.project new file mode 100644 index 0000000..995b8d4 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.project @@ -0,0 +1,23 @@ + + + ch12_ex2_MPG_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/pom.xml b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/pom.xml new file mode 100644 index 0000000..b313014 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..76fb501 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,80 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + Validation v = new Validation(); + + String errorMsg = ""; + errorMsg += v.isDouble(milesField.getText(), "Miles"); + errorMsg += v.isDouble(gallonsField.getText(), "Gallons"); + + if (errorMsg.isEmpty()) { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java new file mode 100644 index 0000000..eea2014 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java @@ -0,0 +1,42 @@ +package com.murach.mpg; + +public class Validation { + + private String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.properties b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.properties new file mode 100644 index 0000000..8624194 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch12_ex2_MPG_sol +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch12_ex2_MPG_sol +m2e.projectName=ch12_ex2_MPG_sol +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.xml b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.xml new file mode 100644 index 0000000..b313014 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..84b4656 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class new file mode 100644 index 0000000..0b036e9 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class differ diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class new file mode 100644 index 0000000..188a528 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..c9ba0cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\mpg\MpgApp.class +module-info.class +com\murach\mpg\Validation.class diff --git a/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..55d2160 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\com\murach\mpg\Validation.java diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.project new file mode 100644 index 0000000..e1a875e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.project @@ -0,0 +1,23 @@ + + + ch13_ex1_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml new file mode 100644 index 0000000..a0ba80f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue_sol + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..09a4c30 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java @@ -0,0 +1,128 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox(); + private ListView futureValues = new ListView<>(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java new file mode 100644 index 0000000..4a03e70 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java @@ -0,0 +1,42 @@ +package com.murach.future_value; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java new file mode 100644 index 0000000..bc26e83 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.future_value { + requires javafx.controls; + exports com.murach.future_value; // This is necessary, but why? +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..a0215ad Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar differ diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.properties b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.properties new file mode 100644 index 0000000..6da63d6 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch13_ex1_FutureValue_sol +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex1_FutureValue_sol +m2e.projectName=ch13_ex1_FutureValue_sol +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.xml b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.xml new file mode 100644 index 0000000..a0ba80f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue_sol/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue_sol + diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..73e579c Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class new file mode 100644 index 0000000..759135b Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class new file mode 100644 index 0000000..6093ae0 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties new file mode 100644 index 0000000..09b2951 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Tue Aug 24 10:56:13 PDT 2021 +groupId=com.murach +artifactId=ch13_ex1_FutureValue_sol +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..85a5e9f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\future_value\Validation.class +module-info.class +com\murach\future_value\FutureValueApplication.class diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..a95d53e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\com\murach\future_value\Validation.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\com\murach\future_value\FutureValueApplication.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\module-info.java diff --git a/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/murach/eclipse/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.classpath b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.project b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.project new file mode 100644 index 0000000..4badcc4 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.project @@ -0,0 +1,23 @@ + + + ch13_ex2_PizzaCalculator_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.core.resources.prefs b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..e9441bb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding/=UTF-8 diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1db2692 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml new file mode 100644 index 0000000..202b71b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.ch13_ex2_pizzacalculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java new file mode 100644 index 0000000..4246710 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.ch13_ex2_pizzacalculator { + requires javafx.controls; + exports murach.ch13_ex2_pizzacalculator; +} diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/App.java b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/App.java new file mode 100644 index 0000000..5c85313 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/App.java @@ -0,0 +1,130 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java new file mode 100644 index 0000000..1f4cc8a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java @@ -0,0 +1,13 @@ +package murach.ch13_ex2_pizzacalculator; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties new file mode 100644 index 0000000..3ffb839 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:52 EST 2024 +artifactId=ch13_ex2_PizzaCalculator +groupId=Murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_solutions\\ch13_ex2_PizzaCalculator_sol +m2e.projectName=ch13_ex2_PizzaCalculator_sol +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml new file mode 100644 index 0000000..202b71b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.ch13_ex2_pizzacalculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class new file mode 100644 index 0000000..684822e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/App.class b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/App.class new file mode 100644 index 0000000..8aaa6ba Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/App.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class new file mode 100644 index 0000000..434585b Binary files /dev/null and b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class differ diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..6ed9c89 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +module-info.class +murach\ch13_ex2_pizzacalculator\SystemInfo.class +murach\ch13_ex2_pizzacalculator\App.class diff --git a/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..4154260 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\murach\ch13_ex2_pizzacalculator\SystemInfo.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\murach\ch13_ex2_pizzacalculator\App.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\module-info.java diff --git a/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.classpath b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.project b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.project new file mode 100644 index 0000000..22ca888 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/.project @@ -0,0 +1,17 @@ + + + ch14_ex1_CreateAccount_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/bin/CreateAccountApp.class b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/bin/CreateAccountApp.class new file mode 100644 index 0000000..653d6ad Binary files /dev/null and b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/bin/CreateAccountApp.class differ diff --git a/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java new file mode 100644 index 0000000..7c3eff9 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java @@ -0,0 +1,110 @@ +import java.util.Scanner; + +public class CreateAccountApp { + + private static final Scanner sc = new Scanner(System.in); + + public static void main(String[] args) { + String fullName = getFullName(); + // String password = getPassword(); + // String email = getEmail(); + String phone = getPhone(); + System.out.println(); + + String msg = getSuccessMessage(fullName, phone); + System.out.println(msg); + } + + private static String getFullName() { + while(true) { + System.out.print("Enter full name: "); + String name = sc.nextLine().trim(); + if(name.contains(" ")) { + return name; + } else { + System.out.println("You must enter your full name.\n"); + } + } + } + + private static String getPassword() { + while(true) { + System.out.print("Enter password: "); + String password = sc.nextLine().trim(); + + boolean isMinLength = false; + boolean hasDigit = false; + boolean hasUppercase = false; + + if (password.length() >= 8) { + isMinLength = true; + } + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (isMinLength && hasDigit && hasUppercase) { + return password; + } else { + System.out.println("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getEmail() { + while (true) { + System.out.print("Enter email: "); + String email = sc.nextLine().trim(); + + if (email.contains("@") && email.contains(".com")) { + return email; + } + else { + System.out.println("Please enter a valid email address."); + } + } + } + + private static String getPhone() { + while (true) { + System.out.print("Enter phone number: "); + String phone = sc.nextLine().trim(); + + String[] illegalChars = " -().".split(""); + for (String illegalChar : illegalChars) { + phone = phone.replace(illegalChar, ""); + } + + boolean allDigits = true; + for (char c: phone.toCharArray()) { + if (!Character.isDigit(c)) { + allDigits = false; + } + } + + if (phone.length() == 10 && allDigits) { + phone = phone.substring(0,3) + "." + + phone.substring(3,6) + "." + + phone.substring(6); + return phone; + } + else { + System.out.println("Please enter a 10-digit phone number."); + } + } + } + + private static String getSuccessMessage(String fullName, String phone) { + int index = fullName.indexOf(" "); + String firstName = fullName.substring(0,1).toUpperCase() + + fullName.substring(1, index).toLowerCase(); + return "Hi " + firstName + ", thanks for creating an account!\n" + + "We'll text your confirmation code to this number: " + phone; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.classpath b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.project b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.project new file mode 100644 index 0000000..e533c54 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/.project @@ -0,0 +1,17 @@ + + + ch14_ex2_Hangman_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/Hangman.class b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/Hangman.class new file mode 100644 index 0000000..81d2129 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/Hangman.class differ diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/HangmanApp.class b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/HangmanApp.class new file mode 100644 index 0000000..90655f8 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/HangmanApp.class differ diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/WordList.class b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/WordList.class new file mode 100644 index 0000000..33e4dc7 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/bin/WordList.class differ diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java new file mode 100644 index 0000000..fcbf62a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java @@ -0,0 +1,147 @@ +import java.util.Scanner; + +public class Hangman { + private final WordList wordList = new WordList(); + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses = 0; + private int numWrong = 0; + private String guessedLetters = ""; + private final Scanner sc = new Scanner(System.in); + + public Hangman() { + word = wordList.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + } + + public char getLetter() { + while (true) { + System.out.print("Enter a letter: "); + String s = sc.nextLine().toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if (Character.isLetter(c)) { + if (guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + System.out.println("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + System.out.println("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + System.out.println("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + drawHangman(numWrong); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordList.addSpaces(displayedWord), + numGuesses, numWrong, + wordList.addSpaces(guessedLetters)); + System.out.println(display); + } + + public void playGame() { + drawScreen(); + + while (numWrong < 7 && remainingLetters > 0) { + char guess = getLetter(); + + int index = word.indexOf(guess); + if (index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if (guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if (remainingLetters == 0) { + System.out.println(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + System.out.println(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } + + public void drawHangman(int numWrong) { + switch (numWrong) { + case 0 -> System.out.println(""" + ____ + | + """); + case 1 -> System.out.println(""" + ____ + | + O + """); + case 2 -> System.out.println(""" + ____ + | + O + \\ + """); + case 3 -> System.out.println(""" + ____ + | + O + \\| + """); + case 4 -> System.out.println(""" + ____ + | + O + \\|/ + """); + case 5 -> System.out.println(""" + ____ + | + O + \\|/ + | + """); + case 6 -> System.out.println(""" + ____ + | + O + \\|/ + | + / + """); + case 7 -> System.out.println(""" + ____ + | + O + \\|/ + | + / \\ + """); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java new file mode 100644 index 0000000..af0f7d8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class HangmanApp { + + public static void main(String[] args) { + System.out.println("Play the H A N G M A N game"); + + Scanner sc = new Scanner(System.in); + String again = "y"; + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.drawHangman(7); + hangman.playGame(); + System.out.println(); + System.out.print("Play again? (y/n): "); + again = sc.nextLine(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java new file mode 100644 index 0000000..b495a0c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class WordList { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public WordList() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.classpath b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.classpath new file mode 100644 index 0000000..06cc98d --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.project b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.project new file mode 100644 index 0000000..3400ffc --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.project @@ -0,0 +1,17 @@ + + + ch15_ex1_FutureValue_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/built-jar.properties b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/built-jar.properties new file mode 100644 index 0000000..8a65fa8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/built-jar.properties @@ -0,0 +1,4 @@ +#Tue, 07 Sep 2021 11:06:52 -0700 + + +C\:\\Users\\Scott\\Dropbox\\Java\ 6ed\\java\\netbeans\\ex_solutions\\ch15_ex1_FutureValue_sol= diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/Console.class b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValue.class b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValue.class new file mode 100644 index 0000000..dcc47fa Binary files /dev/null and b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValue.class differ diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValueApp.class b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValueApp.class new file mode 100644 index 0000000..6518dd0 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/build/classes/FutureValueApp.class differ diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java new file mode 100644 index 0000000..fdbead1 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java @@ -0,0 +1,54 @@ +import java.text.NumberFormat; + +public class FutureValue implements Comparable { + private double monthlyInvestment; + private double interestRate; + private int years; + + public FutureValue(double monthlyInvestment, double interestRate, int years) { + this.monthlyInvestment = monthlyInvestment; + this.interestRate = interestRate; + this.years = years; + } + + public double getFutureValue() { + int months = years * 12; + double monthlyInterestRate = interestRate / 12 / 100; + double futureValue = 0; + for (int i = 1; i <= months; i++) { + futureValue = + (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + public String getMonthlyInvestmentFormatted() { + return NumberFormat.getCurrencyInstance() + .format(monthlyInvestment); + } + + public String getInterestRateFormatted() { + var percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + return percent.format(interestRate/100); + } + + public int getYears() { + return this.years; + } + + public String getFutureValueFormatted() { + return NumberFormat.getCurrencyInstance() + .format(getFutureValue()); + } + + @Override + public int compareTo(Object o) { + FutureValue calc = (FutureValue) o; + if (this.getFutureValue() < calc.getFutureValue()) return -1; + else if (this.getFutureValue() > calc.getFutureValue()) return 1; + else return 0; + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..644423e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,70 @@ +import java.util.Collections; +import java.util.LinkedList; + +public class FutureValueApp { + + public static void main(String[] args) { + + LinkedList calculations = new LinkedList<>(); + + // display a welcome message + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble( + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble( + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt( + "Enter number of years: ", 0, 100); + System.out.println(); + + // create FutureValue object + FutureValue fv = new FutureValue( + monthlyInvestment, interestRate, years); + + // add to calculations collection + calculations.add(fv); + + // print the results + System.out.println("\nFORMATTED RESULTS\n" + + "Monthly investment: " + fv.getMonthlyInvestmentFormatted() + "\n" + + "Yearly interest rate: " + fv.getInterestRateFormatted() + "\n" + + "Number of years: " + fv.getYears() + "\n" + + "Future value: " + fv.getFutureValueFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + + // sort the calcuations + Collections.sort(calculations); + // this works too, but only after you've implemented the Comparable interface + /* + Collections.sort(calculations, (c1, c2) -> { + if (c1.getFutureValue()< c2.getFutureValue()) return -1; + else if (c1.getFutureValue()> c2.getFutureValue()) return 1; + else return 0; + }); + */ + + // print the results for all calculations + System.out.println("ALL CALCULATIONS (SORTED)"); + System.out.println(); + System.out.println("Inv/Mo. Rate Years Future Value"); + for (FutureValue calc : calculations) { + System.out.printf("%-12s%6s%7d%14s\n", + calc.getMonthlyInvestmentFormatted(), + calc.getInterestRateFormatted(), + calc.getYears(), + calc.getFutureValueFormatted()); + } + } +} diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.classpath b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.project b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.project new file mode 100644 index 0000000..73487b6 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.project @@ -0,0 +1,17 @@ + + + ch15_ex2_GenericStack_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStack.class b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStack.class new file mode 100644 index 0000000..b2e0ea3 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStack.class differ diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStackApp.class b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStackApp.class new file mode 100644 index 0000000..84f4954 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/bin/GenericStackApp.class differ diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java new file mode 100644 index 0000000..f8a5fc9 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java @@ -0,0 +1,21 @@ +import java.util.LinkedList; + +public class GenericStack { + private LinkedList list = new LinkedList(); + + public void push(E s) { + list.addFirst(s); + } + + public E pop() { + return list.removeFirst(); + } + + public E peek() { + return list.getFirst(); + } + + public int size() { + return list.size(); + } +} diff --git a/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java new file mode 100644 index 0000000..666655a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java @@ -0,0 +1,26 @@ +public class GenericStackApp { + + public static void main(String[] args) { + GenericStack s = new GenericStack<>(); + + // push three items onto the stack + s.push("Apples"); + System.out.println("Push: Apples"); + s.push("Oranges"); + System.out.println("Push: Oranges"); + s.push("Bananas"); + System.out.println("Push: Bananas"); + System.out.println("The stack contains " + s.size() + " items\n"); + + // peek at the first item + System.out.println("Peek: " + s.peek()); + System.out.println("The stack contains " + s.size() + " items\n"); + + // pop all three items + System.out.println("Pop: " + s.pop()); + System.out.println("Pop: " + s.pop()); + System.out.println("Pop: " + s.pop()); + System.out.println("The stack contains " + s.size() + " items\n"); + } + +} diff --git a/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.classpath b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.project b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.project new file mode 100644 index 0000000..838c702 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/.project @@ -0,0 +1,17 @@ + + + ch15_ex3_LoginCounter + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/src/LoginCounterApp.java b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/src/LoginCounterApp.java new file mode 100644 index 0000000..0f592de --- /dev/null +++ b/murach/eclipse/ex_solutions/ch15_ex3_LoginCounter/src/LoginCounterApp.java @@ -0,0 +1,38 @@ + + +import java.util.Map; +import java.util.TreeMap; +import java.util.Scanner; + +public class LoginCounterApp { + private static Map loginCounter = new TreeMap(); + public static void main(String[] args) { + System.out.println("The Login Counter Application"); + String input = ""; + Scanner scan = new Scanner(System.in); + while(!input.equals("q")) { + System.out.println("Enter a username (q to quit): "); + input = scan.nextLine(); + if(input.equals("q")) { + continue; + } else { + login(input); + } + } + for (var entry : loginCounter.entrySet()) { + System.out.println(entry.getKey() + ": " + entry.getValue()); + } + + } + + public static void login(String username) { + if (loginCounter.containsKey(username)) { // word is in map + int count = (int) loginCounter.get(username); + count++; + loginCounter.put(username, count); + } else { // new word for map + loginCounter.put(username, 1); + } + + } +} diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.classpath b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.project b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.project new file mode 100644 index 0000000..0840880 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.project @@ -0,0 +1,17 @@ + + + ch16_ex1_BookCatalog_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/Book.class b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/Book.class new file mode 100644 index 0000000..8033119 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/Book.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookCatalog.class b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookCatalog.class new file mode 100644 index 0000000..57b9416 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookCatalog.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManager.class b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManager.class new file mode 100644 index 0000000..d83c6ba Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManager.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManagerApp.class b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManagerApp.class new file mode 100644 index 0000000..82e9640 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/bin/BookManagerApp.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java new file mode 100644 index 0000000..d403bdc --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooks(Predicate condition) { + List books = new ArrayList<>(); + for (Book b: bookList) { + if (condition.test(b)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java new file mode 100644 index 0000000..c7a7ecf --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooks( + b -> b.getTitle().contains("Java")); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooks( + b -> b.getCategory().equals(Book.JAVA)); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooks( + b -> b.getFormat().equals(Book.PAPERBACK)); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.classpath b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.project b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.project new file mode 100644 index 0000000..a749cd2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.project @@ -0,0 +1,17 @@ + + + ch16_ex2_BookCatalog_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/Book.class b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/Book.class new file mode 100644 index 0000000..8033119 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/Book.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookCatalog.class b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookCatalog.class new file mode 100644 index 0000000..57b9416 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookCatalog.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookManagerApp.class b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookManagerApp.class new file mode 100644 index 0000000..4f108be Binary files /dev/null and b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/bin/BookManagerApp.class differ diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java new file mode 100644 index 0000000..ee47356 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + List bookList = new BookCatalog().getCatalog(); + + System.out.println("\nBOOKS BY TITLE:"); + bookList.stream() + .filter(b -> b.getTitle().contains("Java Programming")) + .forEach(System.out::println); + + System.out.println("\nBOOKS BY CATEGORY:"); + bookList.stream() + .filter(b -> b.getCategory().equals(Book.JAVA)) + .forEach(System.out::println); + + System.out.println("\nBOOKS BY FORMAT:"); + bookList.stream() + .filter(b -> b.getFormat().equals(Book.PAPERBACK)) + .forEach(System.out::println); + + System.out.println("\nDATABASE BOOK TITLES:"); + bookList.stream() + .filter(b -> b.getCategory().equals(Book.DATABASE)) + .map(b -> b.getTitle() + " (" + b.getFormat() + ")") + .forEach(System.out::println); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.classpath b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.project b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.project new file mode 100644 index 0000000..6f9a5a1 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.project @@ -0,0 +1,17 @@ + + + ch17_ex1_Fibonacci_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/bin/FibonacciApp.class b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/bin/FibonacciApp.class new file mode 100644 index 0000000..1a94754 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/bin/FibonacciApp.class differ diff --git a/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java new file mode 100644 index 0000000..dcf57d0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java @@ -0,0 +1,47 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + + + +public class FibonacciApp { + + public static void main(String[] args) { + long iterResult; + long recResult; + iterResult = iterFibo(100); + //recResult = recFibo(45); + + System.out.println(iterResult); + //System.out.println(recResult); + } + + public static int iterFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } + int n1 = 0, n2 = 1, fib = 0; + for (int i = 2; i < n+1; i++) { + fib = n1 + n2; + n1 = n2; + n2 = fib; + } + return fib; + } + + public static int recFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } else { + return recFibo(n - 1) + recFibo(n - 2); + } + } + + +} diff --git a/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.classpath b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.project b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.project new file mode 100644 index 0000000..2461ecd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/.project @@ -0,0 +1,17 @@ + + + ch17_ex2_StringReversal_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/bin/StringReversalApp.class b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/bin/StringReversalApp.class new file mode 100644 index 0000000..40a351a Binary files /dev/null and b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/bin/StringReversalApp.class differ diff --git a/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java new file mode 100644 index 0000000..c23b7cb --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java @@ -0,0 +1,41 @@ + + +import java.util.Scanner; + +public class StringReversalApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.println("Enter string to reverse: "); + String input = sc.next(); + + System.out.println("Iterative string reversal..."); + String result = iterReverse(input); + System.out.println(result); + + System.out.println("Recursive string reversal..."); + result = recReverse(input); + System.out.println(result); + System.out.println(); + } + + // iterative + public static String iterReverse(String str) { + String reverseStr = ""; + for(int i = str.length()-1; i >= 0; i--) { + reverseStr += str.charAt(i); + } + return reverseStr; + } + + // recursive + public static String recReverse(String str) { + if(str.length() <= 1) { + return str; + } + else { + return str.charAt(str.length()-1) + recReverse(str.substring(0, str.length()-1)); + } + } +} diff --git a/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/.project b/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/.project new file mode 100644 index 0000000..5b872f2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/.project @@ -0,0 +1,17 @@ + + + ch17_ex3_GCD_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/bin/.project b/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/bin/.project new file mode 100644 index 0000000..5b872f2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch17_ex3_GCD_sol/bin/.project @@ -0,0 +1,17 @@ + + + ch17_ex3_GCD_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.classpath b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.project b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.project new file mode 100644 index 0000000..da39474 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.project @@ -0,0 +1,17 @@ + + + ch18_ex1_Invoice_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Invoice.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Invoice.class new file mode 100644 index 0000000..711ef4f Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Invoice.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/LineItem.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/LineItem.class new file mode 100644 index 0000000..078a141 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/LineItem.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Product.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Product.class new file mode 100644 index 0000000..338da46 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/business/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/db/ProductDB.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/db/ProductDB.class new file mode 100644 index 0000000..1f5775b Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/db/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/Console.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/Console.class new file mode 100644 index 0000000..9c99b80 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/InvoiceApp.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/InvoiceApp.class new file mode 100644 index 0000000..5d1b930 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/InvoiceApp.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/StringUtil.class b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/StringUtil.class new file mode 100644 index 0000000..cbf343d Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/bin/murach/ui/StringUtil.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Invoice.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Invoice.java new file mode 100644 index 0000000..80c6d64 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Invoice.java @@ -0,0 +1,67 @@ +package murach.business; + +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setInvoiceDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getInvoiceDate() { + return invoiceDate; + } + + public String getInvoiceDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.MEDIUM); + return dtf.format(invoiceDate); + } + + public LocalDateTime getDueDate() { + LocalDateTime dueDate = invoiceDate.plusDays(30); + return dueDate; + } + + public String getDueDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.MEDIUM); + return dtf.format(getDueDate()); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/LineItem.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/LineItem.java new file mode 100644 index 0000000..0c04941 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/LineItem.java @@ -0,0 +1,61 @@ +package murach.business; + + +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Product.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Product.java new file mode 100644 index 0000000..4bb78c3 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/business/Product.java @@ -0,0 +1,52 @@ +package murach.business; + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/db/ProductDB.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/db/ProductDB.java new file mode 100644 index 0000000..cbf7e7a --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/db/ProductDB.java @@ -0,0 +1,33 @@ +package murach.db; + +import murach.business.Product; + + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/Console.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/Console.java new file mode 100644 index 0000000..7765ddc --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/Console.java @@ -0,0 +1,50 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/InvoiceApp.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/InvoiceApp.java new file mode 100644 index 0000000..c6effe0 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/InvoiceApp.java @@ -0,0 +1,60 @@ +package murach.ui; + +import murach.db.ProductDB; +import murach.business.Invoice; +import murach.business.LineItem; +import murach.business.Product; + +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + StringBuilder sb = new StringBuilder(); + sb.append("Invoice date: "); + sb.append(invoice.getInvoiceDateFormatted()); + sb.append("\n"); + sb.append("Due date: "); + sb.append(invoice.getDueDateFormatted()); + sb.append("\n\n"); + + sb.append(StringUtil.pad("Description", 34)); + sb.append(StringUtil.pad("Price", 10)); + sb.append(StringUtil.pad("Qty", 5)); + sb.append(StringUtil.pad("Total", 10)); + sb.append("\n"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + sb.append(StringUtil.pad(product.getDescription(), 34)); + sb.append(StringUtil.pad(product.getPriceFormatted(), 10)); + sb.append(StringUtil.pad(lineItem.getQuantityFormatted(), 5)); + sb.append(StringUtil.pad(lineItem.getTotalFormatted(), 10)); + sb.append("\n"); + } + sb.append("\nInvoice total: "); + sb.append(invoice.getTotalFormatted()); + sb.append("\n"); + System.out.println(sb); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/StringUtil.java b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/StringUtil.java new file mode 100644 index 0000000..e5fe012 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex1_Invoice_sol/src/murach/ui/StringUtil.java @@ -0,0 +1,16 @@ +package murach.ui; + +public class StringUtil { + + public static String pad(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.classpath b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.project b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.project new file mode 100644 index 0000000..502dbae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.project @@ -0,0 +1,17 @@ + + + ch18_ex2_AgeCalculator_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/bin/AgeCalculatorApp.class b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/bin/AgeCalculatorApp.class new file mode 100644 index 0000000..c8b9689 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/bin/AgeCalculatorApp.class differ diff --git a/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java new file mode 100644 index 0000000..c679b38 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java @@ -0,0 +1,44 @@ +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.time.temporal.ChronoUnit; +import java.util.Scanner; + +public class AgeCalculatorApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Age Calculator\n"); + + // Get the current date + LocalDate currentDate = LocalDate.now(); + + // Get input from the the user + Scanner sc = new Scanner(System.in); + System.out.print("Enter your date of birth (YYYY-MM-DD): "); + String dateOfBirthString = sc.nextLine(); + System.out.println(); + + // Get and validate user's date of birth + LocalDate dateOfBirth = LocalDate.parse(dateOfBirthString); + if (dateOfBirth.isAfter(currentDate)) { + System.out.println("Date of birth must be before current date."); + } + // If user's date of birth is valid + else { + // Format and print user's date of birth + DateTimeFormatter mediumDate = + DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM); + System.out.println("Your date of birth is " + + mediumDate.format(dateOfBirth)); + + // Format and print the current date + System.out.println("The current date is " + + mediumDate.format(currentDate)); + + // Calculate and print the user's age + long age = ChronoUnit.YEARS.between(dateOfBirth, currentDate); + System.out.println("Your age is " + age); + } + + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.project b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.project new file mode 100644 index 0000000..433b18c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.project @@ -0,0 +1,11 @@ + + + ch19_ex1_SQLStatements_sol + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql new file mode 100644 index 0000000..4e8f5c7 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql @@ -0,0 +1,3 @@ +SELECT * +FROM Products +WHERE ProductCode = 'java' \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql new file mode 100644 index 0000000..5ec9c98 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql @@ -0,0 +1,3 @@ +SELECT * +FROM Products +WHERE ProductCode = 'jscr' \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql new file mode 100644 index 0000000..76b1f2b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql @@ -0,0 +1,3 @@ +SELECT Description, Price +FROM Products +WHERE ProductCode = 'jscr' \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql new file mode 100644 index 0000000..0fec3e2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql @@ -0,0 +1,3 @@ +SELECT Description, Price +FROM Products +ORDER BY Price DESC \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql new file mode 100644 index 0000000..7f59c00 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql @@ -0,0 +1,2 @@ +INSERT INTO Products (ProductCode, Description, Price) +VALUES ('test', 'Murach''s Test', 99.99) diff --git a/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql new file mode 100644 index 0000000..c82e2d4 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql @@ -0,0 +1,2 @@ +DELETE FROM Products +WHERE ProductCode = 'test' diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.classpath b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.classpath new file mode 100644 index 0000000..ef21b6d --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.project b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.project new file mode 100644 index 0000000..2163f8c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.project @@ -0,0 +1,17 @@ + + + ch19_ex2_DBTester_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/DBTesterApp.class b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/DBTesterApp.class new file mode 100644 index 0000000..702802e Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/DBTesterApp.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/Product.class new file mode 100644 index 0000000..983962d Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/StringUtil.class b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/StringUtil.class new file mode 100644 index 0000000..193a645 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/bin/StringUtil.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite new file mode 100644 index 0000000..fdc104c Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite differ diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java new file mode 100644 index 0000000..607df56 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java @@ -0,0 +1,148 @@ +import java.sql.*; + +public class DBTesterApp { + + private static Connection connection; + + public static void main(String args[]) { + // open connection + try { + String dbUrl = "jdbc:sqlite:products.sqlite"; + connection = DriverManager.getConnection(dbUrl); + } catch (SQLException e) { + System.err.println(e); + return; + } + + // select data from database + printProducts(); + printFirstProduct(); + printProductByCode("jsp"); + + // modify data in the database + Product p = new Product("test", "Test Product", 49.50); + insertProduct(p); + printProducts(); + deleteProduct(p); + printProducts(); + + // close connection + try { + connection.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProducts() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + Product p; + + System.out.println("Product list:"); + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + p = new Product(code, description, price); + + printProduct(p); + } + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printFirstProduct() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + if (rs.next()) { + // code that uses column names + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + + System.out.println("First product:"); + printProduct(p); + System.out.println(); + } + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProductByCode(String productCode) { + try (PreparedStatement ps = connection.prepareStatement( + "SELECT * FROM Products WHERE ProductCode = ?")) { + ps.setString(1, productCode); + ResultSet rs = ps.executeQuery(); + + if (rs.next()) { + String code = rs.getString(1); + String description = rs.getString(2); + double price = rs.getDouble(3); + Product p = new Product(code, description, price); + + System.out.println("Product by code: " + productCode); + printProduct(p); + System.out.println(); + } + + rs.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void insertProduct(Product p) { + String insertProduct + = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + + try (PreparedStatement ps = connection.prepareStatement(insertProduct)) { + System.out.println("Insert test: "); + + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + + printProduct(p); + System.out.println(); + + } catch (SQLException e) { + System.out.println(e); + } + } + + private static void deleteProduct(Product p) { + String deleteProduct + = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + + try (PreparedStatement ps = connection.prepareStatement(deleteProduct)) { + System.out.println("Delete test: "); + + ps.setString(1, p.getCode()); + ps.executeUpdate(); + printProduct(p); + + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + // use this method to print a Product object on a single line + private static void printProduct(Product p) { + String productString + = StringUtil.padWithSpaces(p.getCode(), 12) + + StringUtil.padWithSpaces(p.getDescription(), 38) + + p.getFormattedPrice(); + + System.out.println(productString); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java new file mode 100644 index 0000000..22119c2 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java @@ -0,0 +1,67 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getFormattedPrice() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public boolean equals(Object object) { + if (object instanceof Product) { + Product product2 = (Product) object; + if (code.equals(product2.getCode()) + && description.equals(product2.getDescription()) + && price == product2.getPrice()) { + return true; + } + } + return false; + } + + public String toString() { + return "Code: " + code + "\n" + + "Description: " + description + "\n" + + "Price: " + this.getFormattedPrice() + "\n"; + } +} diff --git a/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java new file mode 100644 index 0000000..518cb2e --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java @@ -0,0 +1,16 @@ + + +public class StringUtil { + + public static String padWithSpaces(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.classpath b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.classpath new file mode 100644 index 0000000..2d5c574 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.project b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.project new file mode 100644 index 0000000..757a7fa --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.project @@ -0,0 +1,17 @@ + + + ch19_ex3_ProductManager_sol + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Console.class b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Console.class new file mode 100644 index 0000000..86b38bb Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Console.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Product.class b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Product.class new file mode 100644 index 0000000..a8b3035 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/Product.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductDB.class b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductDB.class new file mode 100644 index 0000000..838c690 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductManagerApp.class b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductManagerApp.class new file mode 100644 index 0000000..b732f72 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/bin/ProductManagerApp.class differ diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite new file mode 100644 index 0000000..7b65035 Binary files /dev/null and b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite differ diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java new file mode 100644 index 0000000..9bb48e9 --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java @@ -0,0 +1,49 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java new file mode 100644 index 0000000..3eaf20c --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java @@ -0,0 +1,112 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + private static Product getFromRow(ResultSet rs) throws SQLException { + String code = rs.getString(1); + String description = rs.getString(2); + double price = rs.getDouble(3); + + Product product = new Product(code, description, price); + return product; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + ArrayList products = new ArrayList<>(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + Product p = getFromRow(rs); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + Product p = getFromRow(rs); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java new file mode 100644 index 0000000..379941b --- /dev/null +++ b/murach/eclipse/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java @@ -0,0 +1,95 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "update" -> updateProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void updateProduct() { + String code = Console.getString("Enter product code to update: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + product.setDescription(description); + product.setPrice(price); + + boolean success = ProductDB.update(product); + if (success) { + System.out.println(code + + " has been updated in the database.\n"); + } else { + System.out.println("Error! Unable to upldate product.\n"); + } + + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/LoginCounter.java b/murach/eclipse/ex_starts/LoginCounter.java new file mode 100644 index 0000000..5080359 --- /dev/null +++ b/murach/eclipse/ex_starts/LoginCounter.java @@ -0,0 +1,19 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package murach.ch15_ex3_logincounter_sol; +import java.util.Map; +import java.util.TreeMap; +import java.util.Scanner; +/** + * + * @author Scott + */ +public class LoginCounter { + public static void main(String[] args) { + System.out.println("The Login Counter Application"); + + } +} diff --git a/murach/eclipse/ex_starts/ch01_ex1_Invoice/.classpath b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch01_ex1_Invoice/.project b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.project new file mode 100644 index 0000000..e6dd506 --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.project @@ -0,0 +1,17 @@ + + + ch01_ex1_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch01_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch01_ex1_Invoice/bin/InvoiceApp.class b/murach/eclipse/ex_starts/ch01_ex1_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..7f538a8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch01_ex1_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java b/murach/eclipse/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch01_ex2_TestScore/.classpath b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch01_ex2_TestScore/.project b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.project new file mode 100644 index 0000000..d27dd33 --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.project @@ -0,0 +1,17 @@ + + + ch01_ex2_TestScore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch01_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch01_ex2_TestScore/bin/TestScoreApp.class b/murach/eclipse/ex_starts/ch01_ex2_TestScore/bin/TestScoreApp.class new file mode 100644 index 0000000..55b5df5 Binary files /dev/null and b/murach/eclipse/ex_starts/ch01_ex2_TestScore/bin/TestScoreApp.class differ diff --git a/murach/eclipse/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java b/murach/eclipse/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..7d7b4ec --- /dev/null +++ b/murach/eclipse/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch02_ex1_Invoice/.classpath b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch02_ex1_Invoice/.project b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.project new file mode 100644 index 0000000..b5407da --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.project @@ -0,0 +1,17 @@ + + + ch02_ex1_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch02_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch02_ex1_Invoice/bin/InvoiceApp.class b/murach/eclipse/ex_starts/ch02_ex1_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..7f538a8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch02_ex1_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java b/murach/eclipse/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch02_ex2_TestScore/.classpath b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch02_ex2_TestScore/.project b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.project new file mode 100644 index 0000000..7358dcf --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.project @@ -0,0 +1,17 @@ + + + ch02_ex2_TestScore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch02_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch02_ex2_TestScore/bin/TestScoreApp.class b/murach/eclipse/ex_starts/ch02_ex2_TestScore/bin/TestScoreApp.class new file mode 100644 index 0000000..55b5df5 Binary files /dev/null and b/murach/eclipse/ex_starts/ch02_ex2_TestScore/bin/TestScoreApp.class differ diff --git a/murach/eclipse/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java b/murach/eclipse/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..7d7b4ec --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch02_ex3_Invoice/.classpath b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch02_ex3_Invoice/.project b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.project new file mode 100644 index 0000000..0899b8d --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.project @@ -0,0 +1,17 @@ + + + ch02_ex3_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch02_ex3_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex3_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch02_ex3_Invoice/bin/InvoiceApp.class b/murach/eclipse/ex_starts/ch02_ex3_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..7f538a8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch02_ex3_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java b/murach/eclipse/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/eclipse/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch03_ex1_MPG/.classpath b/murach/eclipse/ex_starts/ch03_ex1_MPG/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex1_MPG/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_starts/ch03_ex1_MPG/.project b/murach/eclipse/ex_starts/ch03_ex1_MPG/.project new file mode 100644 index 0000000..b8f562d --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex1_MPG/.project @@ -0,0 +1,17 @@ + + + ch03_ex1_MPG + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch03_ex1_MPG/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch03_ex1_MPG/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex1_MPG/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch03_ex1_MPG/bin/MPGApp.class b/murach/eclipse/ex_starts/ch03_ex1_MPG/bin/MPGApp.class new file mode 100644 index 0000000..5015dd8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch03_ex1_MPG/bin/MPGApp.class differ diff --git a/murach/eclipse/ex_starts/ch03_ex1_MPG/src/MPGApp.java b/murach/eclipse/ex_starts/ch03_ex1_MPG/src/MPGApp.java new file mode 100644 index 0000000..d5b8c5c --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex1_MPG/src/MPGApp.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class MPGApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Miles Per Gallon calculator"); + System.out.println(); // print a blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter miles driven: "); + input = sc.nextLine(); + double miles = Double.parseDouble(input); + + System.out.print("Enter gallons of gas used: "); + input = sc.nextLine(); + double gallons = Double.parseDouble(input); + + double mpg = miles/gallons; + System.out.println("Miles per gallon is " + mpg + "."); + System.out.println(); + + System.out.print("Calculate another MPG? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} diff --git a/murach/eclipse/ex_starts/ch03_ex2_TestScore/.classpath b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch03_ex2_TestScore/.project b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.project new file mode 100644 index 0000000..6bf4734 --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.project @@ -0,0 +1,17 @@ + + + ch03_ex2_TestScore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch03_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex2_TestScore/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch03_ex2_TestScore/bin/TestScoreApp.class b/murach/eclipse/ex_starts/ch03_ex2_TestScore/bin/TestScoreApp.class new file mode 100644 index 0000000..0dc9b00 Binary files /dev/null and b/murach/eclipse/ex_starts/ch03_ex2_TestScore/bin/TestScoreApp.class differ diff --git a/murach/eclipse/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java b/murach/eclipse/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..32c0c5e --- /dev/null +++ b/murach/eclipse/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, and average score + double averageScore = 0.0; + if (scoreCount > 0) { + averageScore = (double) scoreTotal / scoreCount; + } + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.classpath b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.project b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.project new file mode 100644 index 0000000..91a1b82 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch04_ex1_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch04_ex1_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..ff563cf Binary files /dev/null and b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..19ac4ed --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_starts/ch04_ex2_Invoice/.classpath b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch04_ex2_Invoice/.project b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.project new file mode 100644 index 0000000..365d491 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.project @@ -0,0 +1,17 @@ + + + ch04_ex2_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch04_ex2_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex2_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_starts/ch04_ex2_Invoice/bin/InvoiceApp.class b/murach/eclipse/ex_starts/ch04_ex2_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..e48db9f Binary files /dev/null and b/murach/eclipse/ex_starts/ch04_ex2_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java b/murach/eclipse/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..817cfae --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.classpath b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.project b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.project new file mode 100644 index 0000000..a657307 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.project @@ -0,0 +1,17 @@ + + + ch04_ex3_GuessNumber + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/bin/GuessNumberApp.class b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/bin/GuessNumberApp.class new file mode 100644 index 0000000..f5cb29f Binary files /dev/null and b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/bin/GuessNumberApp.class differ diff --git a/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..49bc238 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.classpath b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.project b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.project new file mode 100644 index 0000000..8fe4f36 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch04_ex4_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch04_ex4_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..ff563cf Binary files /dev/null and b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..19ac4ed --- /dev/null +++ b/murach/eclipse/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.classpath b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.project b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.project new file mode 100644 index 0000000..137129e --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch05_ex1_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch05_ex1_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..5d4f8b8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..b47efba --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,107 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // print the results + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.classpath b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.project b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.project new file mode 100644 index 0000000..ec24d38 --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.project @@ -0,0 +1,17 @@ + + + ch05_ex2_GuessNumber + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/bin/GuessNumberApp.class b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/bin/GuessNumberApp.class new file mode 100644 index 0000000..f089634 Binary files /dev/null and b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/bin/GuessNumberApp.class differ diff --git a/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..2669fc1 --- /dev/null +++ b/murach/eclipse/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_starts/ch06_ex1_Invoice/.classpath b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch06_ex1_Invoice/.project b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.project new file mode 100644 index 0000000..c29ea9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.project @@ -0,0 +1,17 @@ + + + ch06_ex1_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch06_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_starts/ch06_ex1_Invoice/bin/InvoiceApp.class b/murach/eclipse/ex_starts/ch06_ex1_Invoice/bin/InvoiceApp.class new file mode 100644 index 0000000..9ee1507 Binary files /dev/null and b/murach/eclipse/ex_starts/ch06_ex1_Invoice/bin/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java b/murach/eclipse/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..933c702 --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100 && subtotal < 250) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.classpath b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.project b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.project new file mode 100644 index 0000000..8c93e7a --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch06_ex2_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch06_ex2_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..cb100a8 Binary files /dev/null and b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..712fb89 --- /dev/null +++ b/murach/eclipse/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java @@ -0,0 +1,111 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getdouble(sc, prompt) + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 0; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/.classpath b/murach/eclipse/ex_starts/ch07_ex1_Product/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/.project b/murach/eclipse/ex_starts/ch07_ex1_Product/.project new file mode 100644 index 0000000..4408341 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/.project @@ -0,0 +1,17 @@ + + + ch07_ex1_Product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch07_ex1_Product/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/bin/Product.class b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/Product.class new file mode 100644 index 0000000..54c222d Binary files /dev/null and b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductApp.class b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductApp.class new file mode 100644 index 0000000..207cfc2 Binary files /dev/null and b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductDB.class b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductDB.class new file mode 100644 index 0000000..1fda6aa Binary files /dev/null and b/murach/eclipse/ex_starts/ch07_ex1_Product/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/src/Product.java b/murach/eclipse/ex_starts/ch07_ex1_Product/src/Product.java new file mode 100644 index 0000000..51e57f4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/src/Product.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductApp.java b/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductApp.java new file mode 100644 index 0000000..b7a9d39 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductApp.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductDB.java b/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductDB.java new file mode 100644 index 0000000..a039657 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex1_Product/src/ProductDB.java @@ -0,0 +1,32 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } + else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } + else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } + else { + product.setDescription("Unknown"); + } + + return product; + } +} diff --git a/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.classpath b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.project b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.project new file mode 100644 index 0000000..e9c2fd7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch07_ex2_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch07_ex2_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..e7e13b0 Binary files /dev/null and b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..34c78c4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java @@ -0,0 +1,111 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.classpath b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.project b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.project new file mode 100644 index 0000000..4c148a1 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.project @@ -0,0 +1,17 @@ + + + ch07_ex3_AreaAndPerimeter + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/bin/AreaAndPerimeterApp.class b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/bin/AreaAndPerimeterApp.class new file mode 100644 index 0000000..74e33af Binary files /dev/null and b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/bin/AreaAndPerimeterApp.class differ diff --git a/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java new file mode 100644 index 0000000..f3e21a4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class AreaAndPerimeterApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Area and Perimeter Calculator"); + System.out.println(); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get input from user + System.out.print("Enter length: "); + double length = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter width: "); + double width = Double.parseDouble(sc.nextLine()); + + // calculate total + double area = width * length; + double perimeter = 2 * width + 2 * length; + + // format and display output + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String message = + "Area: " + number.format(area) + "\n" + + "Perimeter: " + number.format(perimeter) + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.classpath b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.project b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.project new file mode 100644 index 0000000..a4a9489 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.project @@ -0,0 +1,17 @@ + + + ch08_ex1_MonthSales + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/Console.class b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/Console.class new file mode 100644 index 0000000..91281af Binary files /dev/null and b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/Console.class differ diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/MonthSalesApp.class b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/MonthSalesApp.class new file mode 100644 index 0000000..f8abe43 Binary files /dev/null and b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/bin/MonthSalesApp.class differ diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/Console.java b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/Console.java new file mode 100644 index 0000000..97c32f2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java new file mode 100644 index 0000000..72c4dd9 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java @@ -0,0 +1,41 @@ +import java.text.NumberFormat; + +public class MonthSalesApp { + + public static void main(String[] args) { + System.out.println("Monthly Sales\n"); + + // declare monthNames and monthSales arrays + + + // get currency formatting + NumberFormat currency = NumberFormat.getCurrencyInstance(); + + // get one or more months + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + int monthNumber = Console.getInt("Enter month number: "); + + // validate input + if (monthNumber < 1 || monthNumber > 12) { + Console.displayLine("Invalid month number. Try again."); + continue; + } + + // get the index number for the month + // and display the month name and sales + + + // check if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + Console.displayLine(); + } + + // display the total sales for the year + + + Console.displayLine(); + } + +} diff --git a/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.classpath b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.project b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.project new file mode 100644 index 0000000..0d48832 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.project @@ -0,0 +1,17 @@ + + + ch08_ex2_CardDeck + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch08_ex2_CardDeck/bin/CardDeckApp.class b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/bin/CardDeckApp.class new file mode 100644 index 0000000..ef03814 Binary files /dev/null and b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/bin/CardDeckApp.class differ diff --git a/murach/eclipse/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java new file mode 100644 index 0000000..2ad0f67 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java @@ -0,0 +1,38 @@ +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] deck = new String[52]; + // add code that creates deck here + return deck; + } + + private static void displayCards(String[] cards) { + // add code that displays cards here + } + + private static void shuffleDeck(String[] deck) { + int randomIndex = (int) (Math.random() * deck.length-1); + + // add code that shuffles the deck here + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = new String[count]; + return hand; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.classpath b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.project b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.project new file mode 100644 index 0000000..b4781ea --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.project @@ -0,0 +1,17 @@ + + + ch08_ex3_CardDeck + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch08_ex3_CardDeck/bin/CardDeckApp.class b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/bin/CardDeckApp.class new file mode 100644 index 0000000..9e7586e Binary files /dev/null and b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/bin/CardDeckApp.class differ diff --git a/murach/eclipse/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java new file mode 100644 index 0000000..b76a93e --- /dev/null +++ b/murach/eclipse/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java @@ -0,0 +1,57 @@ +import java.util.Arrays; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + String[] deck = new String[52]; + int i = 0; + for (String suit : suits) { + for (String rank : ranks) { + deck[i] = rank + " of " + suit; + i++; + } + } + return deck; + } + + private static void displayCards(String[] cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(String[] deck) { + for (int i = 0; i < deck.length; i++) { + String savedCard = deck[i]; + int randomIndex = (int) (Math.random() * deck.length-1); + deck[i] = deck[randomIndex]; + deck[randomIndex] = savedCard; + } + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = Arrays.copyOfRange(deck, 0, count); + return hand; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.classpath b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.project b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.project new file mode 100644 index 0000000..e852a9f --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.project @@ -0,0 +1,17 @@ + + + ch09_ex1_CustomerManager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Console.class b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Console.class new file mode 100644 index 0000000..bf7a212 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Console.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Customer.class b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Customer.class new file mode 100644 index 0000000..b5abe18 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/Customer.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerDB.class b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerDB.class new file mode 100644 index 0000000..011e4e5 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerDB.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerManagerApp.class b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerManagerApp.class new file mode 100644 index 0000000..bb1e982 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/bin/CustomerManagerApp.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/customers.txt b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/customers.txt new file mode 100644 index 0000000..6419de1 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/customers.txt @@ -0,0 +1,3 @@ +Thomas Willliams tomwilliams@gmail.com +Jane Adams janeadams@yahoo.com +Robert Rodriguez robertrodriguez@sbcglobal.net diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Console.java b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Customer.java b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Customer.java new file mode 100644 index 0000000..ec622e7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/Customer.java @@ -0,0 +1,44 @@ +public class Customer { + + private String firstName; + private String lastName; + private String email; + + public Customer() { + this("", "", ""); + } + + public Customer(String firstName, String lastName, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getFirstName() { + return firstName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getLastName() { + return lastName; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEmail() { + return email; + } + + public String getName() { + return firstName + " " + lastName; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java new file mode 100644 index 0000000..f184c72 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java @@ -0,0 +1,20 @@ +import java.util.ArrayList; + +public final class CustomerDB { + + private static final String FILENAME = "customers.txt"; + private static final String COL_SEP = "\t"; + + public static ArrayList getAll() { + var customers = new ArrayList(); + + // load the array list with Customer objects created from + // the data in the file + + return customers; + } + + public static void saveAll(ArrayList customers) { + // save the Customer objects in the array list to the file + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java new file mode 100644 index 0000000..c0437cb --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java @@ -0,0 +1,86 @@ +import java.util.ArrayList; + +public class CustomerManagerApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Manager\n"); + + // create the db object and get the list of customers + ArrayList customers = CustomerDB.getAll(); + + // display the command menu + displayMenu(); + + // perform 1 or more actions + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + // get the input from the user + action = Console.getString("Enter a command: "); + System.out.println(); + + if (action.equalsIgnoreCase("list")) { + displayAll(customers); + } else if (action.equalsIgnoreCase("add")) { + addCustomer(customers); + } else if (action.equalsIgnoreCase("del") || + action.equalsIgnoreCase("delete")) { + deleteCustomer(customers); + } else if (action.equalsIgnoreCase("help") || + action.equalsIgnoreCase("menu")) { + displayMenu(); + } else if (action.equalsIgnoreCase("exit")) { + System.out.println("Bye.\n"); + } else { + System.out.println("Error! Not a valid command.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all customers"); + System.out.println("add - Add a customer"); + System.out.println("del - Delete a customer"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList customers) { + System.out.println("CUSTOMER LIST"); + + String format = "%-27s%-40s%n"; + for (Customer c : customers) { + System.out.printf(format, c.getName(), c.getEmail()); + } + System.out.println(); + } + + public static void addCustomer(ArrayList customers) { + String firstName = Console.getString("Enter first name: "); + String lastName = Console.getString("Enter last name: "); + String email = Console.getString("Enter customer email: "); + + Customer customer = new Customer(firstName, lastName, email); + customers.add(customer); + CustomerDB.saveAll(customers); + + System.out.println(customer.getName() + " has been added.\n"); + } + + public static void deleteCustomer(ArrayList customers) { + String email = Console.getString("Enter email to delete: "); + + for (Customer c : customers) { + if (c.getEmail().equals(email)) { + customers.remove(c); + CustomerDB.saveAll(customers); // save list to file + System.out.println(c.getName() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No customer matches that email.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.classpath b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.project b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.project new file mode 100644 index 0000000..d67e827 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.project @@ -0,0 +1,17 @@ + + + ch09_ex2_ProductManager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cd95bae --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,15 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=16 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=16 +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=16 diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Console.class b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Console.class new file mode 100644 index 0000000..86b38bb Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Console.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Product.class b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Product.class new file mode 100644 index 0000000..434b405 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductDB.class b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductDB.class new file mode 100644 index 0000000..ba8561d Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductManagerApp.class b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductManagerApp.class new file mode 100644 index 0000000..bbf6667 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/bin/ProductManagerApp.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/products.txt b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Console.java b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Product.java b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..71126ae --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "products.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..06cac58 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,75 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + var products = ProductDB.getAll(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.classpath b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.project b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.project new file mode 100644 index 0000000..2c99516 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.project @@ -0,0 +1,17 @@ + + + ch09_ex3_ExceptionTester + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/bin/ExceptionTesterApp.class b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/bin/ExceptionTesterApp.class new file mode 100644 index 0000000..8a5eb07 Binary files /dev/null and b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/bin/ExceptionTesterApp.class differ diff --git a/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java new file mode 100644 index 0000000..9689a01 --- /dev/null +++ b/murach/eclipse/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java @@ -0,0 +1,29 @@ +import java.io.*; + +public class ExceptionTesterApp { + + public static void main(String[] args) { + System.err.println("In main: calling method1."); + method1(); + System.err.println("In main: returned from method1."); + } + + public static void method1() { + System.err.println("\tIn method1: calling method2."); + method2(); + System.err.println("\tIn method1: returned from method2."); + } + + public static void method2() { + System.err.println("\t\tIn method2: calling method3."); + method3(); + System.err.println("\t\tIn method2: returned from method3."); + } + + public static void method3() { + System.err.println("\t\t\tIn method3: Entering."); + + //Add code to throw an exception here. + System.err.println("\t\t\tIn method3: Exiting."); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/.classpath b/murach/eclipse/ex_starts/ch10_ex1_Product/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/.project b/murach/eclipse/ex_starts/ch10_ex1_Product/.project new file mode 100644 index 0000000..da117f2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/.project @@ -0,0 +1,17 @@ + + + ch10_ex1_Product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch10_ex1_Product/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Book.class b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Book.class new file mode 100644 index 0000000..dce7248 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Book.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Product.class b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Product.class new file mode 100644 index 0000000..f72f22e Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductApp.class b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductApp.class new file mode 100644 index 0000000..33c40b4 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductDB.class b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductDB.class new file mode 100644 index 0000000..e0cdfee Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Software.class b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Software.class new file mode 100644 index 0000000..193c473 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex1_Product/bin/Software.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/src/Book.java b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/src/Product.java b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Product.java new file mode 100644 index 0000000..bb7f8e7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductApp.java b/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductDB.java b/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductDB.java new file mode 100644 index 0000000..caeb3b3 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} diff --git a/murach/eclipse/ex_starts/ch10_ex1_Product/src/Software.java b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex1_Product/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/.classpath b/murach/eclipse/ex_starts/ch10_ex2_Product/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/.project b/murach/eclipse/ex_starts/ch10_ex2_Product/.project new file mode 100644 index 0000000..97571cb --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/.project @@ -0,0 +1,17 @@ + + + ch10_ex2_Product + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch10_ex2_Product/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Book.class b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Book.class new file mode 100644 index 0000000..dce7248 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Book.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Product.class b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Product.class new file mode 100644 index 0000000..f72f22e Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductApp.class b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductApp.class new file mode 100644 index 0000000..33c40b4 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductApp.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductDB.class b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductDB.class new file mode 100644 index 0000000..e0cdfee Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Software.class b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Software.class new file mode 100644 index 0000000..193c473 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex2_Product/bin/Software.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/src/Book.java b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/src/Product.java b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Product.java new file mode 100644 index 0000000..95636e7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductApp.java b/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductDB.java b/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductDB.java new file mode 100644 index 0000000..944af49 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex2_Product/src/Software.java b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex2_Product/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.classpath b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.project b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.project new file mode 100644 index 0000000..238ab58 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.project @@ -0,0 +1,17 @@ + + + ch10_ex3_EqualsTest + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/EqualsTestApp.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/EqualsTestApp.class new file mode 100644 index 0000000..59256ce Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/EqualsTestApp.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/LineItem.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/LineItem.class new file mode 100644 index 0000000..babbe1c Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/LineItem.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/Product.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/built-jar.properties b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/built-jar.properties new file mode 100644 index 0000000..d7d655d --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/built-jar.properties @@ -0,0 +1,4 @@ +#Thu, 09 Sep 2021 16:14:39 -0700 + + +C\:\\Users\\Joel\\Dropbox\\Java\ 6ed\\java\\netbeans\\ex_starts\\ch10_ex3_EqualsTest= diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/EqualsTestApp.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/EqualsTestApp.class new file mode 100644 index 0000000..4c030a1 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/EqualsTestApp.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/LineItem.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/LineItem.class new file mode 100644 index 0000000..a2660f7 Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/LineItem.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/Product.class b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/Product.class new file mode 100644 index 0000000..a03657f Binary files /dev/null and b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/build/classes/Product.class differ diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java new file mode 100644 index 0000000..94af252 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java @@ -0,0 +1,41 @@ +public class EqualsTestApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Equals Tester\n"); + + //Both variables refer to different objects that store the same data + Product product1 = new Product("java", "Murach's Java Programming", 57.5); + Product product2 = new Product("java", "Murach's Java Programming", 57.5); + // test equals() method + if (product1.equals(product2)) { + System.out.println("The Product class is comparing data."); + } else { + System.out.println("The Product class is comparing references."); + } + // test hashCode() method + if (product1.hashCode() == product2.hashCode()) { + System.out.println("The Product object hash codes match."); + } else { + System.out.println("The Product object hash codes are different."); + } + System.out.println(); + + //Both variables refer to different objects that store the same data + LineItem li1 = new LineItem(product1, 1); + LineItem li2 = new LineItem(product2, 1); + // test equals() method + if (li1.equals(li2)) { + System.out.println("The LineItem class is comparing data."); + } else { + System.out.println("The LineItem class is comparing references."); + } + // test hashCode() method + if (li1.hashCode() == li2.hashCode()) { + System.out.println("The LineItem object hash codes match."); + } else { + System.out.println("The LineItem object hash codes are different."); + } + System.out.println(); + } + +} diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java new file mode 100644 index 0000000..1811f13 --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + product = new Product(); + quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + double total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/Product.java b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/Product.java new file mode 100644 index 0000000..81ad31a --- /dev/null +++ b/murach/eclipse/ex_starts/ch10_ex3_EqualsTest/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.classpath b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.project b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.project new file mode 100644 index 0000000..5a8b39a --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.project @@ -0,0 +1,17 @@ + + + ch11_ex1_DisplayableTest + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Displayable.class b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Displayable.class new file mode 100644 index 0000000..d03907b Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Displayable.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/DisplayableTestApp.class b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/DisplayableTestApp.class new file mode 100644 index 0000000..681d42c Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/DisplayableTestApp.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Employee.class b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Employee.class new file mode 100644 index 0000000..b3f6fb2 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Employee.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Product.class b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Product.class new file mode 100644 index 0000000..e31c4f0 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java new file mode 100644 index 0000000..67b1dae --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java @@ -0,0 +1,3 @@ +public interface Displayable { + String getDisplayText(); +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java new file mode 100644 index 0000000..62ebc63 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java @@ -0,0 +1,19 @@ +public class DisplayableTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Displayable Test application\n"); + + Employee e = new Employee(2, "Smith", "John"); + // TODO: add code that passes this object to the display method below + + Product p = new Product("java", "Murach's Java Programming", 57.50); + // TODO: add code that passes this object to the display method below + + System.out.println(); + } + + private static void display(Displayable d) { + System.out.println(d.getDisplayText()); + } + +} diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java new file mode 100644 index 0000000..fba5b3b --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java @@ -0,0 +1,12 @@ +public class Employee { + + private int department; + private String firstName; + private String lastName; + + public Employee(int department, String lastName, String firstName) { + this.department = department; + this.lastName = lastName; + this.firstName = firstName; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Product.java b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Product.java new file mode 100644 index 0000000..d3b95a2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex1_DisplayableTest/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.classpath b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.project b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.project new file mode 100644 index 0000000..4b2b809 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.project @@ -0,0 +1,17 @@ + + + ch11_ex2_Enumeration + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch11_ex2_Enumeration/bin/CustomerTypeApp.class b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/bin/CustomerTypeApp.class new file mode 100644 index 0000000..3b8e756 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/bin/CustomerTypeApp.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java new file mode 100644 index 0000000..5e78251 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java @@ -0,0 +1,12 @@ +public class CustomerTypeApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Type Test application\n"); + + // get and display the discount percent for a customer type + // display the value of the toString method of a customer type + } + + // a method that accepts a CustomerType enumeration +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/.classpath b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/.project b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.project new file mode 100644 index 0000000..70ebed4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.project @@ -0,0 +1,17 @@ + + + ch11_ex3_LineItem + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/LineItem.class b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/LineItem.class new file mode 100644 index 0000000..73aef50 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/LineItem.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/Product.class b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/Product.class new file mode 100644 index 0000000..dc95783 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/business/Product.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/data/ProductDB.class b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/data/ProductDB.class new file mode 100644 index 0000000..175a905 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/data/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/Console.class b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/Console.class new file mode 100644 index 0000000..b74916f Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/Console.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/LineItemApp.class b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/LineItemApp.class new file mode 100644 index 0000000..3fe2998 Binary files /dev/null and b/murach/eclipse/ex_starts/ch11_ex3_LineItem/bin/murach/ui/LineItemApp.class differ diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java new file mode 100644 index 0000000..70a2309 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java @@ -0,0 +1,51 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The LineItem class represents a line item and is used by the + * Product class. + */ +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + product = null; + quantity = 0; + total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getTotal() { + total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java new file mode 100644 index 0000000..9cd4082 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java @@ -0,0 +1,84 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product and is used by the + * LineItem class. + * @author Joel Murach + * @version 1.0.0 +*/ +public class Product { + + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Sets the product's code. + * @param code a String for the product's code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product's code. + * @return a String for the product's code + */ + public String getCode() { + return code; + } + + /** + * Sets the product's description. + * @param description a String for the product's description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Gets the product's description. + * @return a String for the product's description + */ + public String getDescription() { + return description; + } + + /** + * Sets the product's price. + * @param price a double value for the product's price + */ + public void setPrice(double price) { + this.price = price; + } + + /** + * Gets a double value for the product's price. + * @return a double value that represents the product's price + */ + public double getPrice() { + return price; + } + + /** + * Gets a String for the product's price with + * standard currency formatting + * @return a String for the product's price with + * standard currency formatting applied ($1,000.00). + */ + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java new file mode 100644 index 0000000..f4a982a --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.*; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java new file mode 100644 index 0000000..5ba353f --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java @@ -0,0 +1,59 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..c953983 --- /dev/null +++ b/murach/eclipse/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java @@ -0,0 +1,43 @@ +package murach.ui; + +import murach.business.*; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: ", 0, 1000); + + // use the ProductDB class to get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(); + lineItem.setProduct(product); + lineItem.setQuantity(quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + product.getCode()); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/.classpath b/murach/eclipse/ex_starts/ch12_ex1_MPG/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/.project b/murach/eclipse/ex_starts/ch12_ex1_MPG/.project new file mode 100644 index 0000000..0988608 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/.project @@ -0,0 +1,23 @@ + + + ch12_ex1_MPG + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch12_ex1_MPG/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/nbactions.xml b/murach/eclipse/ex_starts/ch12_ex1_MPG/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/pom.xml b/murach/eclipse/ex_starts/ch12_ex1_MPG/pom.xml new file mode 100644 index 0000000..70bf474 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java b/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..91df041 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,35 @@ +package com.murach.mpg; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + + @Override + public void start(Stage stage) { + Button btn = new Button(); + btn.setText("Say 'Hello World'"); + btn.setOnAction(event -> buttonClicked()); + + StackPane root = new StackPane(); + root.getChildren().add(btn); + + Scene scene = new Scene(root, 300, 250); + + stage.setTitle("Hello World!"); + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + System.out.println("Hello World!"); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java b/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.properties b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.properties new file mode 100644 index 0000000..4f5819c --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:49 EST 2024 +artifactId=ch12_ex1_MPG +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex1_MPG +m2e.projectName=ch12_ex1_MPG +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.xml b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.xml new file mode 100644 index 0000000..70bf474 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/META-INF/maven/com.murach/ch12_ex1_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..bced969 Binary files /dev/null and b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/module-info.class b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/module-info.class new file mode 100644 index 0000000..188a528 Binary files /dev/null and b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..68f13e4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\murach\mpg\MpgApp.class +module-info.class diff --git a/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..079d301 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex1_MPG\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex1_MPG\src\main\java\module-info.java diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/.classpath b/murach/eclipse/ex_starts/ch12_ex2_MPG/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/.project b/murach/eclipse/ex_starts/ch12_ex2_MPG/.project new file mode 100644 index 0000000..4cbd1fb --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/.project @@ -0,0 +1,23 @@ + + + ch12_ex2_MPG + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch12_ex2_MPG/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/nbactions.xml b/murach/eclipse/ex_starts/ch12_ex2_MPG/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/pom.xml b/murach/eclipse/ex_starts/ch12_ex2_MPG/pom.xml new file mode 100644 index 0000000..9305e12 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java b/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..d21fbf6 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,66 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java b/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.properties b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.properties new file mode 100644 index 0000000..d69a05b --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch12_ex2_MPG +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch12_ex2_MPG +m2e.projectName=ch12_ex2_MPG +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.xml b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.xml new file mode 100644 index 0000000..9305e12 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/META-INF/maven/com.murach/ch12_ex2_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..cb5481e Binary files /dev/null and b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/module-info.class b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/module-info.class new file mode 100644 index 0000000..188a528 Binary files /dev/null and b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..68f13e4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\murach\mpg\MpgApp.class +module-info.class diff --git a/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..2361166 --- /dev/null +++ b/murach/eclipse/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex2_MPG\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex2_MPG\src\main\java\module-info.java diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.classpath b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.project b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.project new file mode 100644 index 0000000..f798a84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.project @@ -0,0 +1,23 @@ + + + ch13_ex1_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/nbactions.xml b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/pom.xml b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/pom.xml new file mode 100644 index 0000000..251e920 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..acc9409 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java @@ -0,0 +1,119 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(yearsField.getText(), + "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + int years = Integer.parseInt( + yearsField.getText()); + + double futureValue = calculateFutureValue( + investment, rate, years); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java new file mode 100644 index 0000000..4a03e70 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java @@ -0,0 +1,42 @@ +package com.murach.future_value; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java new file mode 100644 index 0000000..bc26e83 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.future_value { + requires javafx.controls; + exports com.murach.future_value; // This is necessary, but why? +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.properties b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.properties new file mode 100644 index 0000000..1bfc6d2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:50 EST 2024 +artifactId=ch13_ex1_FutureValue +groupId=com.murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex1_FutureValue +m2e.projectName=ch13_ex1_FutureValue +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.xml b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.xml new file mode 100644 index 0000000..251e920 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/META-INF/maven/com.murach/ch13_ex1_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue + diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..661f1f6 Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class new file mode 100644 index 0000000..759135b Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class new file mode 100644 index 0000000..6093ae0 Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..85a5e9f --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\future_value\Validation.class +module-info.class +com\murach\future_value\FutureValueApplication.class diff --git a/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..0a18a46 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\com\murach\future_value\Validation.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\com\murach\future_value\FutureValueApplication.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\module-info.java diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.classpath b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.classpath new file mode 100644 index 0000000..4559ca0 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.project b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.project new file mode 100644 index 0000000..835d03f --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.project @@ -0,0 +1,23 @@ + + + ch13_ex2_PizzaCalculator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/pom.xml b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/pom.xml new file mode 100644 index 0000000..202b71b --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.ch13_ex2_pizzacalculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java new file mode 100644 index 0000000..4246710 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.ch13_ex2_pizzacalculator { + requires javafx.controls; + exports murach.ch13_ex2_pizzacalculator; +} diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java new file mode 100644 index 0000000..801572f --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/App.java @@ -0,0 +1,55 @@ +package murach.ch13_ex2_pizzacalculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + + // size + + // toppings + + // price output + + // calculate button + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + // calulation code here + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java new file mode 100644 index 0000000..1f4cc8a --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/ch13_ex2_pizzacalculator/SystemInfo.java @@ -0,0 +1,13 @@ +package murach.ch13_ex2_pizzacalculator; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/MANIFEST.MF b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000..0e15486 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Build-Jdk-Spec: 23 +Created-By: Maven Integration for Eclipse + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties new file mode 100644 index 0000000..6646a1f --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Dec 26 09:21:52 EST 2024 +artifactId=ch13_ex2_PizzaCalculator +groupId=Murach +m2e.projectLocation=C\:\\Users\\Dagostit\\OneDrive - The Mental Health Association of Westchester Inc\\Documents\\Code\\java\\eclipse\\ex_starts\\ch13_ex2_PizzaCalculator +m2e.projectName=ch13_ex2_PizzaCalculator +version=1.0-SNAPSHOT diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml new file mode 100644 index 0000000..202b71b --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/META-INF/maven/Murach/ch13_ex2_PizzaCalculator/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.ch13_ex2_pizzacalculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class new file mode 100644 index 0000000..684822e Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/App.class b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/App.class new file mode 100644 index 0000000..de1d36a Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/App.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class new file mode 100644 index 0000000..434585b Binary files /dev/null and b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/ch13_ex2_pizzacalculator/SystemInfo.class differ diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..6ed9c89 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +module-info.class +murach\ch13_ex2_pizzacalculator\SystemInfo.class +murach\ch13_ex2_pizzacalculator\App.class diff --git a/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..af1bdc9 --- /dev/null +++ b/murach/eclipse/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator\src\main\java\murach\ch13_ex2_pizzacalculator\App.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator\src\main\java\module-info.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator\src\main\java\murach\ch13_ex2_pizzacalculator\SystemInfo.java diff --git a/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.classpath b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.project b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.project new file mode 100644 index 0000000..e7593c5 --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/.project @@ -0,0 +1,17 @@ + + + ch14_ex1_CreateAccount + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/bin/CreateAccountApp.class b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/bin/CreateAccountApp.class new file mode 100644 index 0000000..1a1ed0a Binary files /dev/null and b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/bin/CreateAccountApp.class differ diff --git a/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java new file mode 100644 index 0000000..c81cce6 --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java @@ -0,0 +1,66 @@ +import java.util.Scanner; + +public class CreateAccountApp { + + private static final Scanner sc = new Scanner(System.in); + + public static void main(String[] args) { + String fullName = getFullName(); + System.out.println(); + + String password = getPassword(); + System.out.println(); + + String msg = getSuccessMessage(fullName); + System.out.println(msg); + } + + private static String getFullName() { + while(true) { + System.out.print("Enter full name: "); + String name = sc.nextLine().trim(); + if(name.contains(" ")) { + return name; + } else { + System.out.println("You must enter your full name.\n"); + } + } + } + + private static String getPassword() { + while(true) { + System.out.print("Enter password: "); + String password = sc.nextLine().trim(); + + boolean isMinLength = false; + boolean hasDigit = false; + boolean hasUppercase = false; + + if (password.length() >= 8) { + isMinLength = true; + } + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (isMinLength && hasDigit && hasUppercase) { + return password; + } else { + System.out.println("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getSuccessMessage(String fullName) { + int index = fullName.indexOf(" "); + String firstName = fullName.substring(0,1).toUpperCase() + + fullName.substring(1, index).toLowerCase(); + return "Hi " + firstName + ", thanks for creating an account!\n"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/.classpath b/murach/eclipse/ex_starts/ch14_ex2_Hangman/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex2_Hangman/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/.project b/murach/eclipse/ex_starts/ch14_ex2_Hangman/.project new file mode 100644 index 0000000..09a8b99 --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex2_Hangman/.project @@ -0,0 +1,17 @@ + + + ch14_ex2_Hangman + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/Hangman.class b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/Hangman.class new file mode 100644 index 0000000..5739b61 Binary files /dev/null and b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/Hangman.class differ diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/HangmanApp.class b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/HangmanApp.class new file mode 100644 index 0000000..93723ce Binary files /dev/null and b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/HangmanApp.class differ diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/WordList.class b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/WordList.class new file mode 100644 index 0000000..33e4dc7 Binary files /dev/null and b/murach/eclipse/ex_starts/ch14_ex2_Hangman/bin/WordList.class differ diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/Hangman.java b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/Hangman.java new file mode 100644 index 0000000..12f01f7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/Hangman.java @@ -0,0 +1,91 @@ +import java.util.Scanner; + +public class Hangman { + private final WordList wordList = new WordList(); + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses = 0; + private int numWrong = 0; + private String guessedLetters = ""; + private final Scanner sc = new Scanner(System.in); + + public Hangman() { + word = wordList.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + } + + public char getLetter() { + while (true) { + System.out.print("Enter a letter: "); + String s = sc.nextLine().toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if (Character.isLetter(c)) { + if (guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + System.out.println("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + System.out.println("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + System.out.println("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordList.addSpaces(displayedWord), + numGuesses, numWrong, + wordList.addSpaces(guessedLetters)); + System.out.println(display); + } + + public void playGame() { + drawScreen(); + + while (numWrong < 10 && remainingLetters > 0) { + char guess = getLetter(); + + int index = word.indexOf(guess); + if (index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if (guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if (remainingLetters == 0) { + System.out.println(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + System.out.println(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java new file mode 100644 index 0000000..0ce2efe --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class HangmanApp { + + public static void main(String[] args) { + System.out.println("Play the H A N G M A N game"); + + Scanner sc = new Scanner(System.in); + String again = "y"; + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.playGame(); + System.out.println(); + System.out.print("Play again? (y/n): "); + again = sc.nextLine(); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/WordList.java b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/WordList.java new file mode 100644 index 0000000..b495a0c --- /dev/null +++ b/murach/eclipse/ex_starts/ch14_ex2_Hangman/src/WordList.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class WordList { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public WordList() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.classpath b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.project b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.project new file mode 100644 index 0000000..488b7f9 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.project @@ -0,0 +1,17 @@ + + + ch15_ex1_FutureValue + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/Console.class b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/Console.class new file mode 100644 index 0000000..2013728 Binary files /dev/null and b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/Console.class differ diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/FutureValueApp.class b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/FutureValueApp.class new file mode 100644 index 0000000..4f06df5 Binary files /dev/null and b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/bin/FutureValueApp.class differ diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/Console.java b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/Console.java new file mode 100644 index 0000000..c2f2654 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/Console.java @@ -0,0 +1,81 @@ +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.next(); // read user entry + sc.nextLine(); // discard any other data entered on the line + return s; + } + + public static int getInt(String prompt) { + int i = 0; + boolean isValid = false; + while (!isValid) { + System.out.print(prompt); + if (sc.hasNextInt()) { + i = sc.nextInt(); + isValid = true; + } else { + System.out.println("Error! Invalid integer. Try again."); + } + sc.nextLine(); // discard any other data entered on the line + } + return i; + } + + public static int getInt(String prompt, int min, int max) { + int i = 0; + boolean isValid = false; + while (!isValid) { + i = getInt(prompt); + if (i <= min) { + System.out.println( + "Error! Number must be greater than " + min + "."); + } else if (i >= max) { + System.out.println( + "Error! Number must be less than " + max + "."); + } else { + isValid = true; + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + boolean isValid = false; + while (!isValid) { + System.out.print(prompt); + if (sc.hasNextDouble()) { + d = sc.nextDouble(); + isValid = true; + } else { + System.out.println("Error! Invalid number. Try again."); + } + sc.nextLine(); // discard any other data entered on the line + } + return d; + } + + public static double getDouble(String prompt, double min, double max) { + double d = 0; + boolean isValid = false; + while (!isValid) { + d = getDouble(prompt); + if (d <= min) { + System.out.println( + "Error! Number must be greater than " + min + "."); + } else if (d >= max) { + System.out.println( + "Error! Number must be less than " + max + "."); + } else { + isValid = true; + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..a3a414a --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,86 @@ +import java.util.*; +import java.text.*; + +public class FutureValueApp { + + public static void main(String[] args) { + + LinkedList calculations = new LinkedList<>(); + + // display a welcome message + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble( + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble( + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt( + "Enter number of years: ", 0, 100); + + // calculate the future value + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + double futureValue = calculateFutureValue( + monthlyInvestment, monthlyInterestRate, months); + + // get the currency and percent formatters + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + + // format the result as a single string + String results = + "Monthly investment:\t" + + currency.format(monthlyInvestment) + "\n" + + "Yearly interest rate:\t" + + percent.format(interestRate/100) + "\n" + + "Number of years:\t" + + years + "\n" + + "Future value:\t\t" + + currency.format(futureValue) + "\n"; + + // print the results + System.out.println(); + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // format the result and store it in the linked list + String result = currency.format(monthlyInvestment) + "\t" + + percent.format(interestRate/100) + "\t" + + Integer.toString(years) + "\t" + + currency.format(futureValue); + calculations.add(result); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + + // print the results + System.out.println(); + System.out.println("Future Value Calculations"); + System.out.println(); + System.out.println("Inv/Mo.\tRate\tYears\tFuture Value"); + while (calculations.size() > 0) + System.out.println(calculations.removeLast()); + System.out.println(); + } + + public static double calculateFutureValue(double monthlyInvestment, + double monthlyInterestRate, int months) { + double futureValue = 0; + for (int i = 1; i <= months; i++) { + futureValue = + (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.classpath b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.project b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.project new file mode 100644 index 0000000..5c56d23 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.project @@ -0,0 +1,17 @@ + + + ch15_ex2_GenericStack + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch15_ex2_GenericStack/bin/GenericStackApp.class b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/bin/GenericStackApp.class new file mode 100644 index 0000000..8862aa3 Binary files /dev/null and b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/bin/GenericStackApp.class differ diff --git a/murach/eclipse/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java new file mode 100644 index 0000000..959bec2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java @@ -0,0 +1,7 @@ +public class GenericStackApp { + + public static void main(String[] args) { + + } + +} diff --git a/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.classpath b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.project b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.project new file mode 100644 index 0000000..838c702 --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/.project @@ -0,0 +1,17 @@ + + + ch15_ex3_LoginCounter + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/bin/LoginCounterApp.class b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/bin/LoginCounterApp.class new file mode 100644 index 0000000..a9225c7 Binary files /dev/null and b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/bin/LoginCounterApp.class differ diff --git a/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java new file mode 100644 index 0000000..f07d36b --- /dev/null +++ b/murach/eclipse/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java @@ -0,0 +1,11 @@ +import java.util.Map; +import java.util.TreeMap; +import java.util.Scanner; + + +public class LoginCounterApp { + public static void main(String[] args) { + System.out.println("The Login Counter Application"); + + } +} diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.classpath b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.project b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.project new file mode 100644 index 0000000..c4a980f --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.project @@ -0,0 +1,17 @@ + + + ch16_ex1_BookCatalog + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/Book.class b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/Book.class new file mode 100644 index 0000000..8033119 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/Book.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookCatalog.class b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookCatalog.class new file mode 100644 index 0000000..57b9416 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookCatalog.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManager.class b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManager.class new file mode 100644 index 0000000..65806d5 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManager.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManagerApp.class b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManagerApp.class new file mode 100644 index 0000000..d303621 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/bin/BookManagerApp.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/Book.java b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java new file mode 100644 index 0000000..423a048 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java @@ -0,0 +1,40 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooksByTitle(String title) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getTitle().equals(title)) { + books.add(b); + } + } + return books; + } + + public List getBooksByCategory(String category) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getCategory().equals(category)) { + books.add(b); + } + } + return books; + } + + public List getBooksByFormat(String format) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getFormat().equals(format)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java new file mode 100644 index 0000000..a83c322 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java @@ -0,0 +1,27 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooksByTitle("Java Programming"); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooksByCategory(Book.JAVA); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooksByFormat(Book.PAPERBACK); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.classpath b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.project b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.project new file mode 100644 index 0000000..6d39d54 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.project @@ -0,0 +1,17 @@ + + + ch16_ex2_BookCatalog + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/Book.class b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/Book.class new file mode 100644 index 0000000..8033119 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/Book.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookCatalog.class b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookCatalog.class new file mode 100644 index 0000000..57b9416 Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookCatalog.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManager.class b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManager.class new file mode 100644 index 0000000..d83c6ba Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManager.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManagerApp.class b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManagerApp.class new file mode 100644 index 0000000..65f5a7e Binary files /dev/null and b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/bin/BookManagerApp.class differ diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/Book.java b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java new file mode 100644 index 0000000..d403bdc --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooks(Predicate condition) { + List books = new ArrayList<>(); + for (Book b: bookList) { + if (condition.test(b)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java new file mode 100644 index 0000000..0aacec2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooks( + b -> b.getTitle().equals("Java Programming")); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooks( + b -> b.getCategory().equals(Book.JAVA)); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooks( + b -> b.getFormat().equals(Book.PAPERBACK)); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.classpath b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.classpath new file mode 100644 index 0000000..0cbf9cd --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.project b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.project new file mode 100644 index 0000000..f7c9276 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.project @@ -0,0 +1,17 @@ + + + ch17_ex1_Fibonacci + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/bin/Ch17_ex1_Fibonacci.class b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/bin/Ch17_ex1_Fibonacci.class new file mode 100644 index 0000000..dd0270f Binary files /dev/null and b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/bin/Ch17_ex1_Fibonacci.class differ diff --git a/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/src/Ch17_ex1_Fibonacci.java b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/src/Ch17_ex1_Fibonacci.java new file mode 100644 index 0000000..da1d821 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex1_Fibonacci/src/Ch17_ex1_Fibonacci.java @@ -0,0 +1,40 @@ + +public class Ch17_ex1_Fibonacci { + + public static void main(String[] args) { + int iterResult; + int recResult; + iterResult = iterFibo(16); + recResult = recFibo(16); + + System.out.println(iterResult); + System.out.println(recResult); + } + + public static int iterFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } + int n1 = 0, n2 = 1, fib = 0; + for (int i = 2; i < n+1; i++) { + fib = n1 + n2; + n1 = n2; + n2 = fib; + } + return fib; + } + + public static int recFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } else { + return recFibo(n - 1) + recFibo(n - 2); + } + } + + +} diff --git a/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.classpath b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.project b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.project new file mode 100644 index 0000000..02feb6f --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/.project @@ -0,0 +1,17 @@ + + + ch17_ex2_StringReversal + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch17_ex2_StringReversal/bin/StringReversalApp.class b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/bin/StringReversalApp.class new file mode 100644 index 0000000..e5ef3b7 Binary files /dev/null and b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/bin/StringReversalApp.class differ diff --git a/murach/eclipse/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java new file mode 100644 index 0000000..3a7ea96 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class StringReversalApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.println("Enter string to reverse: "); + String input = sc.next(); + + System.out.println("Iterative string reversal..."); + String result = iterReverse(input); + System.out.println(result); + + System.out.println("Recursive string reversal..."); + result = recReverse(input); + System.out.println(result); + System.out.println(); + } + + // iterative + public static String iterReverse(String str) { + System.out.println("Iterative solution here..."); + return null; + } + + // recursive + public static String recReverse(String str) { + System.out.println("Recursive solution here..."); + return null; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch17_ex3_GCD/.classpath b/murach/eclipse/ex_starts/ch17_ex3_GCD/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex3_GCD/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch17_ex3_GCD/.project b/murach/eclipse/ex_starts/ch17_ex3_GCD/.project new file mode 100644 index 0000000..ead83e8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex3_GCD/.project @@ -0,0 +1,17 @@ + + + ch17_ex3_GCD + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch17_ex3_GCD/bin/GCDApp.class b/murach/eclipse/ex_starts/ch17_ex3_GCD/bin/GCDApp.class new file mode 100644 index 0000000..9514264 Binary files /dev/null and b/murach/eclipse/ex_starts/ch17_ex3_GCD/bin/GCDApp.class differ diff --git a/murach/eclipse/ex_starts/ch17_ex3_GCD/src/GCDApp.java b/murach/eclipse/ex_starts/ch17_ex3_GCD/src/GCDApp.java new file mode 100644 index 0000000..1fbccf7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch17_ex3_GCD/src/GCDApp.java @@ -0,0 +1,36 @@ + +import java.util.Scanner; + +public class GCDApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.println("Enter the first number: "); + int firstNumber = sc.nextInt(); + + System.out.println("Enter the second number: "); + int secondNumber = sc.nextInt(); + + System.out.println("Iterative GCD..."); + int result = iterGCD(firstNumber, secondNumber); + System.out.println(result); + + System.out.println("Recursive GCD..."); + result = recGCD(firstNumber, secondNumber); + System.out.println(result); + System.out.println(); + } + + // iterative + public static int iterGCD(int a, int b) { + System.out.println("Iterative solution here..."); + return 0; + } + + // recursive + public static int recGCD(int a, int b) { + System.out.println("Recursive solution here..."); + return 0; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/.classpath b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/.project b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.project new file mode 100644 index 0000000..ca13884 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.project @@ -0,0 +1,17 @@ + + + ch18_ex1_Invoice + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Invoice.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Invoice.class new file mode 100644 index 0000000..f5c465c Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Invoice.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/LineItem.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/LineItem.class new file mode 100644 index 0000000..078a141 Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/LineItem.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Product.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Product.class new file mode 100644 index 0000000..338da46 Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/business/Product.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/db/ProductDB.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/db/ProductDB.class new file mode 100644 index 0000000..1f5775b Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/db/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/Console.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/Console.class new file mode 100644 index 0000000..9c99b80 Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/Console.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/InvoiceApp.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/InvoiceApp.class new file mode 100644 index 0000000..e8efb71 Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/InvoiceApp.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/StringUtil.class b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/StringUtil.class new file mode 100644 index 0000000..cbf343d Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex1_Invoice/bin/murach/ui/StringUtil.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Invoice.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Invoice.java new file mode 100644 index 0000000..01ee2c4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Invoice.java @@ -0,0 +1,55 @@ +package murach.business; + +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setInvoiceDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getInvoiceDate() { + return invoiceDate; + } + + public String getInvoiceDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.SHORT); + return dtf.format(invoiceDate); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/LineItem.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/LineItem.java new file mode 100644 index 0000000..0c04941 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/LineItem.java @@ -0,0 +1,61 @@ +package murach.business; + + +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Product.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Product.java new file mode 100644 index 0000000..4bb78c3 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/business/Product.java @@ -0,0 +1,52 @@ +package murach.business; + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/db/ProductDB.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/db/ProductDB.java new file mode 100644 index 0000000..cbf7e7a --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/db/ProductDB.java @@ -0,0 +1,33 @@ +package murach.db; + +import murach.business.Product; + + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/Console.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/Console.java new file mode 100644 index 0000000..7765ddc --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/Console.java @@ -0,0 +1,50 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/InvoiceApp.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/InvoiceApp.java new file mode 100644 index 0000000..4ff66d8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/InvoiceApp.java @@ -0,0 +1,57 @@ +package murach.ui; + +import murach.db.ProductDB; +import murach.business.Invoice; +import murach.business.LineItem; +import murach.business.Product; + +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + StringBuilder sb = new StringBuilder(); + sb.append("Invoice date: "); + sb.append(invoice.getInvoiceDateFormatted()); + sb.append("\n\n"); + + sb.append(StringUtil.pad("Description", 34)); + sb.append(StringUtil.pad("Price", 10)); + sb.append(StringUtil.pad("Qty", 5)); + sb.append(StringUtil.pad("Total", 10)); + sb.append("\n"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + sb.append(StringUtil.pad(product.getDescription(), 34)); + sb.append(StringUtil.pad(product.getPriceFormatted(), 10)); + sb.append(StringUtil.pad(lineItem.getQuantityFormatted(), 5)); + sb.append(StringUtil.pad(lineItem.getTotalFormatted(), 10)); + sb.append("\n"); + } + sb.append("\nInvoice total: "); + sb.append(invoice.getTotalFormatted()); + sb.append("\n"); + System.out.println(sb); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/StringUtil.java b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/StringUtil.java new file mode 100644 index 0000000..e5fe012 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex1_Invoice/src/murach/ui/StringUtil.java @@ -0,0 +1,16 @@ +package murach.ui; + +public class StringUtil { + + public static String pad(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.classpath b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.classpath new file mode 100644 index 0000000..f00af9b --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.project b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.project new file mode 100644 index 0000000..96294f9 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.project @@ -0,0 +1,17 @@ + + + ch18_ex2_AgeCalculator + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/bin/AgeCalculatorApp.class b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/bin/AgeCalculatorApp.class new file mode 100644 index 0000000..266fd8a Binary files /dev/null and b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/bin/AgeCalculatorApp.class differ diff --git a/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java new file mode 100644 index 0000000..64798f5 --- /dev/null +++ b/murach/eclipse/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java @@ -0,0 +1,28 @@ +import java.util.Scanner; + +public class AgeCalculatorApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Age Calculator\n"); + + // Get the current date + + // Get input from the the user + Scanner sc = new Scanner(System.in); + System.out.print("Enter your date of birth (YYYY-MM-DD): "); + String dateOfBirthString = sc.nextLine(); + System.out.println(); + + // Get and validate user's date of birth + + // If user's date of birth is valid + // Format and print user's date of birth + System.out.println("Your date of birth is "); + + // Format and print the current date + System.out.println("The current date is "); + + // Calculate and print the user's age + System.out.println("Your age is "); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step05.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step05.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step05.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step06.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step06.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step06.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step07.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step07.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step07.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step08.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step08.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step08.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step09.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step09.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step09.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step10.sql b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step10.sql new file mode 100644 index 0000000..c9c44c4 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex1_SQLStatements/Step10.sql @@ -0,0 +1 @@ +Save SQL statement here \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/.classpath b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.classpath new file mode 100644 index 0000000..a7ff0ca --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/.project b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.project new file mode 100644 index 0000000..f7342f5 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.project @@ -0,0 +1,17 @@ + + + ch19_ex2_DBTester + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/.settings/org.eclipse.jdt.core.prefs b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f2525a8 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,14 @@ +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.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/DBTesterApp.class b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/DBTesterApp.class new file mode 100644 index 0000000..127d98f Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/DBTesterApp.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/Product.class b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/Product.class new file mode 100644 index 0000000..983962d Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/StringUtil.class b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/StringUtil.class new file mode 100644 index 0000000..193a645 Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex2_DBTester/bin/StringUtil.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/products.sqlite b/murach/eclipse/ex_starts/ch19_ex2_DBTester/products.sqlite new file mode 100644 index 0000000..dd08323 Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex2_DBTester/products.sqlite differ diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java new file mode 100644 index 0000000..4f0c0ec --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java @@ -0,0 +1,103 @@ +import java.sql.*; + +public class DBTesterApp { + + private static Connection connection; + + public static void main(String args[]) { + // open connection + try { + String dbUrl = "jdbc:sqlite:products.sqlite"; + connection = DriverManager.getConnection(dbUrl); + } catch (SQLException e) { + System.err.println(e); + return; + } + + // select data from database + printProducts(); + printFirstProduct(); + printProductByCode("jsp"); + + // modify data in the database + Product p = new Product("test", "Test Product", 49.50); + insertProduct(p); + printProducts(); + deleteProduct(p); + printProducts(); + + // close connection + try { + connection.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProducts() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + Product p; + + System.out.println("Product list:"); + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + p = new Product(code, description, price); + + printProduct(p); + } + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printFirstProduct() { + Product p = new Product(); + + // add code that prints the record for the first product in the Products table + System.out.println("First product:"); + printProduct(p); + System.out.println(); + } + + public static void printProductByCode(String productCode) { + Product p = new Product(); + + // add code that prints the product with the specified code + System.out.println("Product by code: " + productCode); + printProduct(p); + System.out.println(); + } + + public static void insertProduct(Product p) { + System.out.println("Insert test: "); + + // add code that inserts the specified product into the database + // if a product with the specifed code already exists, display an error message + printProduct(p); + System.out.println(); + } + + private static void deleteProduct(Product p) { + System.out.println("Delete test: "); + + // add code that deletes the specified product from the database + // if a product with the specified code doesn't exist, display an error message + printProduct(p); + System.out.println(); + } + + // use this method to print a Product object on a single line + private static void printProduct(Product p) { + String productString + = StringUtil.padWithSpaces(p.getCode(), 12) + + StringUtil.padWithSpaces(p.getDescription(), 38) + + p.getFormattedPrice(); + + System.out.println(productString); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/Product.java b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/Product.java new file mode 100644 index 0000000..22119c2 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/Product.java @@ -0,0 +1,67 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getFormattedPrice() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public boolean equals(Object object) { + if (object instanceof Product) { + Product product2 = (Product) object; + if (code.equals(product2.getCode()) + && description.equals(product2.getDescription()) + && price == product2.getPrice()) { + return true; + } + } + return false; + } + + public String toString() { + return "Code: " + code + "\n" + + "Description: " + description + "\n" + + "Price: " + this.getFormattedPrice() + "\n"; + } +} diff --git a/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/StringUtil.java b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/StringUtil.java new file mode 100644 index 0000000..518cb2e --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex2_DBTester/src/StringUtil.java @@ -0,0 +1,16 @@ + + +public class StringUtil { + + public static String padWithSpaces(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.classpath b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.classpath new file mode 100644 index 0000000..a7ff0ca --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.project b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.project new file mode 100644 index 0000000..90c1b64 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/.project @@ -0,0 +1,17 @@ + + + ch19_ex3_ProductManager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Console.class b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Console.class new file mode 100644 index 0000000..86b38bb Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Console.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Product.class b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Product.class new file mode 100644 index 0000000..a8b3035 Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/Product.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductDB.class b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductDB.class new file mode 100644 index 0000000..e7e1349 Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductDB.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductManagerApp.class b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductManagerApp.class new file mode 100644 index 0000000..68a1e9d Binary files /dev/null and b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/bin/ProductManagerApp.class differ diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/products.sqlite b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/products.sqlite new file mode 100644 index 0000000..e69de29 diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Console.java b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Product.java b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Product.java new file mode 100644 index 0000000..9bb48e9 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/Product.java @@ -0,0 +1,49 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..f906acf --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java @@ -0,0 +1,109 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + var products = new ArrayList(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + Product p = new Product(code, description, price); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..db8cef7 --- /dev/null +++ b/murach/eclipse/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,69 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file diff --git a/murach/files/FutureValueApp.java b/murach/files/FutureValueApp.java new file mode 100644 index 0000000..44854a0 --- /dev/null +++ b/murach/files/FutureValueApp.java @@ -0,0 +1,55 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); // create object to scan input + String choice = "y"; + while (choice.equals("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + String input = sc.nextLine(); + double monthlyInvestment = Double.parseDouble(input); + + System.out.print("Enter yearly interest rate: "); + input = sc.nextLine(); + double interestRate = Double.parseDouble(input); + + System.out.print("Enter number of years: "); + input = sc.nextLine(); + int years = Integer.parseInt(input); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + // convert yearly to monthly + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/files/InvoiceApp.java b/murach/files/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/files/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/files/TestScoreApp.java b/murach/files/TestScoreApp.java new file mode 100644 index 0000000..7d7b4ec --- /dev/null +++ b/murach/files/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/files/dir1/a.txt b/murach/files/dir1/a.txt new file mode 100644 index 0000000..8d14cbf --- /dev/null +++ b/murach/files/dir1/a.txt @@ -0,0 +1 @@ +a.txt \ No newline at end of file diff --git a/murach/files/dir1/dir2/b.txt b/murach/files/dir1/dir2/b.txt new file mode 100644 index 0000000..19acdd8 --- /dev/null +++ b/murach/files/dir1/dir2/b.txt @@ -0,0 +1 @@ +b.txt \ No newline at end of file diff --git a/murach/files/dir1/dir2/c.txt b/murach/files/dir1/dir2/c.txt new file mode 100644 index 0000000..f632129 --- /dev/null +++ b/murach/files/dir1/dir2/c.txt @@ -0,0 +1 @@ +c.txt \ No newline at end of file diff --git a/murach/files/dir1/dir2/dir4/z.txt b/murach/files/dir1/dir2/dir4/z.txt new file mode 100644 index 0000000..7c89efe --- /dev/null +++ b/murach/files/dir1/dir2/dir4/z.txt @@ -0,0 +1 @@ +z.txt \ No newline at end of file diff --git a/murach/files/dir1/dir3/z.txt b/murach/files/dir1/dir3/z.txt new file mode 100644 index 0000000..7c89efe --- /dev/null +++ b/murach/files/dir1/dir3/z.txt @@ -0,0 +1 @@ +z.txt \ No newline at end of file diff --git a/murach/files/products.bin b/murach/files/products.bin new file mode 100644 index 0000000..cb04869 Binary files /dev/null and b/murach/files/products.bin differ diff --git a/murach/files/products.txt b/murach/files/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/files/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/.classpath b/murach/netbeans/book_apps/ch01_FutureValueConsole/.classpath new file mode 100644 index 0000000..fb50116 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/.project b/murach/netbeans/book_apps/ch01_FutureValueConsole/.project new file mode 100644 index 0000000..e94a3ca --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/.project @@ -0,0 +1,17 @@ + + + NetBeans_ch01_FutureValueConsole + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/bin/murach/FutureValueApp.class b/murach/netbeans/book_apps/ch01_FutureValueConsole/bin/murach/FutureValueApp.class new file mode 100644 index 0000000..7862163 Binary files /dev/null and b/murach/netbeans/book_apps/ch01_FutureValueConsole/bin/murach/FutureValueApp.class differ diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/build.xml b/murach/netbeans/book_apps/ch01_FutureValueConsole/build.xml new file mode 100644 index 0000000..b1e30c7 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch01_FutureValueConsole. + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/manifest.mf b/murach/netbeans/book_apps/ch01_FutureValueConsole/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/build-impl.xml new file mode 100644 index 0000000..eb12a50 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/genfiles.properties new file mode 100644 index 0000000..7a7767c --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=b995d307 +build.xml.script.CRC32=0b599650 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=b995d307 +nbproject/build-impl.xml.script.CRC32=04f8f5b0 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/config.properties b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.properties b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.xml b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.properties b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.properties new file mode 100644 index 0000000..a2bda72 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch01_FutureValueConsole +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch01_FutureValueConsole.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch01_FutureValueConsole +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch01_FutureValueConsole +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.xml b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.xml new file mode 100644 index 0000000..1603ce3 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch01_FutureValueConsole + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java b/murach/netbeans/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java new file mode 100644 index 0000000..152342b --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueConsole/src/FutureValueApp.java @@ -0,0 +1,60 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); // blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + input = sc.nextLine(); + double monthlyInvestment = Double.parseDouble(input); + + System.out.print("Enter yearly interest rate: "); + input = sc.nextLine(); + double interestRate = Double.parseDouble(input); + + System.out.print("Enter number of years: "); + input = sc.nextLine(); + int years = Integer.parseInt(input); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) + { + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/nbactions.xml b/murach/netbeans/book_apps/ch01_FutureValueGUI/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/pom.xml b/murach/netbeans/book_apps/ch01_FutureValueGUI/pom.xml new file mode 100644 index 0000000..37080a1 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch01_FutureValueGUI + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java new file mode 100644 index 0000000..e41f56d --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach { + requires javafx.controls; + exports murach; +} diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java new file mode 100644 index 0000000..29e678e --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java @@ -0,0 +1,102 @@ +package murach; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class App extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + // get data from text fields + double investment = Double.parseDouble(investmentField.getText()); + double rate = Double.parseDouble(interestRateField.getText()); + int years = Integer.parseInt(yearsField.getText()); + + // calculate future value + double futureValue = calculateFutureValue(investment, rate, years); + + // set data in read-only text field + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate/12/100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java new file mode 100644 index 0000000..3ac5449 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java @@ -0,0 +1,13 @@ +package murach; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..7c750e0 Binary files /dev/null and b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/ch01_FutureValueGUI-1.0-SNAPSHOT.jar differ diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/module-info.class b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/module-info.class new file mode 100644 index 0000000..46f5e79 Binary files /dev/null and b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/module-info.class differ diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class new file mode 100644 index 0000000..a9c9191 Binary files /dev/null and b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/App.class differ diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class new file mode 100644 index 0000000..758240f Binary files /dev/null and b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/classes/murach/SystemInfo.class differ diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties new file mode 100644 index 0000000..d989566 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Aug 19 16:16:33 PDT 2021 +groupId=com.murach +artifactId=ch01_FutureValueGUI +version=1.0-SNAPSHOT diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e4b4a94 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +module-info.class diff --git a/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..6fa0680 --- /dev/null +++ b/murach/netbeans/book_apps/ch01_FutureValueGUI/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +/murach/java/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/App.java +/murach/java/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/module-info.java +/murach/java/netbeans/book_apps/ch01_FutureValueGUI/src/main/java/murach/SystemInfo.java diff --git a/murach/netbeans/book_apps/ch02_Invoice/build.xml b/murach/netbeans/book_apps/ch02_Invoice/build.xml new file mode 100644 index 0000000..d2b5e1a --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch02_Invoice/manifest.mf b/murach/netbeans/book_apps/ch02_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch02_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..08fca5a --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch02_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..213f5df --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3721e668 +build.xml.script.CRC32=c4628e40 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3721e668 +nbproject/build-impl.xml.script.CRC32=cae803c9 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/config.properties b/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.properties new file mode 100644 index 0000000..c506736 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch02_Invoice +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_Invoice +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.xml new file mode 100644 index 0000000..7bd3eb7 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_Invoice + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch02_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..7ee4768 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch02_TestScore/build.xml b/murach/netbeans/book_apps/ch02_TestScore/build.xml new file mode 100644 index 0000000..4479aa2 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_TestScore. + + + diff --git a/murach/netbeans/book_apps/ch02_TestScore/manifest.mf b/murach/netbeans/book_apps/ch02_TestScore/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch02_TestScore/nbproject/build-impl.xml new file mode 100644 index 0000000..d22deb2 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch02_TestScore/nbproject/genfiles.properties new file mode 100644 index 0000000..0bf5325 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=46a8f23f +build.xml.script.CRC32=93618406 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=46a8f23f +nbproject/build-impl.xml.script.CRC32=ed220b5d +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/config.properties b/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.properties b/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.xml b/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.properties b/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.properties new file mode 100644 index 0000000..2bb61c2 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch02_TestScore +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_TestScore.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_TestScore +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_TestScore +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.xml b/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.xml new file mode 100644 index 0000000..6014846 --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_TestScore + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch02_TestScore/src/TestScoreApp.java b/murach/netbeans/book_apps/ch02_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..a2c14ea --- /dev/null +++ b/murach/netbeans/book_apps/ch02_TestScore/src/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To exit, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch03_Invoice/build.xml b/murach/netbeans/book_apps/ch03_Invoice/build.xml new file mode 100644 index 0000000..3e3b58b --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch03_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch03_Invoice/manifest.mf b/murach/netbeans/book_apps/ch03_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch03_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..676448a --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch03_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..79eab6d --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f2bc36cb +build.xml.script.CRC32=cec205e1 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=f2bc36cb +nbproject/build-impl.xml.script.CRC32=460e61a7 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/config.properties b/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.properties new file mode 100644 index 0000000..04c03d6 --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch03_Invoice +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch03_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch03_Invoice +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch03_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.xml new file mode 100644 index 0000000..70701ed --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch03_Invoice + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch03_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch03_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..4bffdb7 --- /dev/null +++ b/murach/netbeans/book_apps/ch03_Invoice/src/InvoiceApp.java @@ -0,0 +1,48 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class InvoiceApp { + + public static void main(String[] args) { + final double DISCOUNT_PCT = .05; + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + System.out.println(); // print blank line + + // calculate the results + double discountAmount = subtotal * DISCOUNT_PCT; + discountAmount = (double) Math.round(discountAmount * 100) / 100; + double total = subtotal - discountAmount; + + // format and display the discount percent + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.printf("%-20s%12s%n", + "Discount percent:", percent.format(DISCOUNT_PCT)); + + // a debugging statement that has been commented out + /* + System.out.println("UNFORMATTED RESULTS\n" + + "Subtotal: " + subtotal + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n" + + "FORMATTED RESULTS"); + */ + + // format and display the floating-point numbers + String format = "%-20s%,12.2f%n"; + System.out.printf(format, "Subtotal:", subtotal); + System.out.printf(format, "Discount amount:", discountAmount); + System.out.printf(format, "Invoice total:", total); + System.out.println(); // print blank line + + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch04_FutureValue/build.xml b/murach/netbeans/book_apps/ch04_FutureValue/build.xml new file mode 100644 index 0000000..71a2474 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_FutureValue. + + + diff --git a/murach/netbeans/book_apps/ch04_FutureValue/manifest.mf b/murach/netbeans/book_apps/ch04_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..867bd36 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..921e13c --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a5a17c46 +build.xml.script.CRC32=ca32dfc9 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=a5a17c46 +nbproject/build-impl.xml.script.CRC32=2ec3f9bf +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/config.properties b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.properties b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.xml b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.properties b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..a287bd4 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch04_FutureValue +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_FutureValue +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.xml b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..5923115 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_FutureValue + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_FutureValue/src/FutureValueApp.java b/murach/netbeans/book_apps/ch04_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..1b3f7b8 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_FutureValue/src/FutureValueApp.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/build.xml b/murach/netbeans/book_apps/ch04_GuessNumber/build.xml new file mode 100644 index 0000000..52208fc --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_GuessNumber. + + + diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/manifest.mf b/murach/netbeans/book_apps/ch04_GuessNumber/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/build-impl.xml new file mode 100644 index 0000000..21858dd --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/genfiles.properties new file mode 100644 index 0000000..59c11d2 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=dbf2017d +build.xml.script.CRC32=9f104494 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=dbf2017d +nbproject/build-impl.xml.script.CRC32=c3fdd8cf +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.properties b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.xml b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.properties b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.properties new file mode 100644 index 0000000..c0f10ba --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_GuessNumber.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_GuessNumber +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_GuessNumber +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.xml b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.xml new file mode 100644 index 0000000..550f9f2 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_GuessNumber + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_GuessNumber/src/GuessNumberApp.java b/murach/netbeans/book_apps/ch04_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..cfd2c94 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,42 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + String input = sc.nextLine(); + int guess = Integer.parseInt(input); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch04_Invoice/build.xml b/murach/netbeans/book_apps/ch04_Invoice/build.xml new file mode 100644 index 0000000..c7ccd50 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch04_Invoice/manifest.mf b/murach/netbeans/book_apps/ch04_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch04_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..9d4828d --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch04_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..2a93547 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c7fe0f61 +build.xml.script.CRC32=fba1b786 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=c7fe0f61 +nbproject/build-impl.xml.script.CRC32=565f422f +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/config.properties b/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.properties new file mode 100644 index 0000000..32bc02d --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch04_Invoice +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_Invoice +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.xml new file mode 100644 index 0000000..39ede5a --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_Invoice + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch04_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch04_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..278512b --- /dev/null +++ b/murach/netbeans/book_apps/ch04_Invoice/src/InvoiceApp.java @@ -0,0 +1,71 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + System.out.println("The Invoice Total Calculator\n"); + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + System.out.println(); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + String format = "%-20s%12s%n"; + + System.out.println("INVOICE"); // print blank line + System.out.printf(format, "Subtotal:", + currency.format(subtotal)); + System.out.printf(format, "Discount percent:", + percent.format(discountPercent)); + System.out.printf(format, "Discount amount:", + currency.format(discountAmount)); + System.out.printf(format, "Total:", + currency.format(total)); + System.out.println(); // print blank line + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/build.xml b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/build.xml new file mode 100644 index 0000000..d319639 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_FutureValueWithMethod. + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/manifest.mf b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/build-impl.xml new file mode 100644 index 0000000..a232b3b --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/genfiles.properties new file mode 100644 index 0000000..f8e7512 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=af099099 +build.xml.script.CRC32=d595a04c +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=af099099 +nbproject/build-impl.xml.script.CRC32=eac54272 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.properties b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.xml b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.properties b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.properties new file mode 100644 index 0000000..70ebfdd --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_FutureValueWithMethod.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_FutureValueWithMethod +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_FutureValueWithMethod +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.xml b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.xml new file mode 100644 index 0000000..dc68009 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_FutureValueWithMethod + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java new file mode 100644 index 0000000..235c721 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithMethod/src/FutureValueApp.java @@ -0,0 +1,54 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + Scanner sc = new Scanner(System.in); + + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // call the method that calculates the future value + double futureValue = calculateFutureValue(monthlyInvestment, + interestRate, years); + + // format and display the result + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // calculate future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) + * (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/build.xml b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/build.xml new file mode 100644 index 0000000..09c5561 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_FutureValueWithValidation. + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/manifest.mf b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/build-impl.xml new file mode 100644 index 0000000..48dd51c --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/genfiles.properties new file mode 100644 index 0000000..0d51ac1 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=bae4a4e9 +build.xml.script.CRC32=e5ac43a1 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=bae4a4e9 +nbproject/build-impl.xml.script.CRC32=4f96c5d5 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.properties b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.xml b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.properties b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.properties new file mode 100644 index 0000000..81b0916 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_FutureValueWithValidation.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_FutureValueWithValidation +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_FutureValueWithValidation +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.xml b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.xml new file mode 100644 index 0000000..b94c0cf --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_FutureValueWithValidation + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java new file mode 100644 index 0000000..d307e63 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_FutureValueWithValidation/src/FutureValueApp.java @@ -0,0 +1,109 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // print the results + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + double value = Double.parseDouble(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + int value = Integer.parseInt(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/build.xml b/murach/netbeans/book_apps/ch05_GuessNumber/build.xml new file mode 100644 index 0000000..d189630 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_GuessNumber. + + + diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/manifest.mf b/murach/netbeans/book_apps/ch05_GuessNumber/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/build-impl.xml new file mode 100644 index 0000000..942c839 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/genfiles.properties new file mode 100644 index 0000000..1cf0c44 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=264440ce +build.xml.script.CRC32=e85ebe91 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=264440ce +nbproject/build-impl.xml.script.CRC32=a829b2b2 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.properties b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.xml b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.properties b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.properties new file mode 100644 index 0000000..f3f1729 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_GuessNumber.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_GuessNumber +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_GuessNumber +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.xml b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.xml new file mode 100644 index 0000000..cbd1e79 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_GuessNumber + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch05_GuessNumber/src/GuessNumberApp.java b/murach/netbeans/book_apps/ch05_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..fbaf218 --- /dev/null +++ b/murach/netbeans/book_apps/ch05_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/book_apps/ch06_FutureValue/build.xml b/murach/netbeans/book_apps/ch06_FutureValue/build.xml new file mode 100644 index 0000000..fc1d2de --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch06_FutureValue. + + + diff --git a/murach/netbeans/book_apps/ch06_FutureValue/manifest.mf b/murach/netbeans/book_apps/ch06_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..bb91b80 --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..0051b90 --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=85bcf961 +build.xml.script.CRC32=24af2bc3 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=85bcf961 +nbproject/build-impl.xml.script.CRC32=f96b2d45 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.properties b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.xml b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.properties b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..fab8ecc --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch06_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch06_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch06_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.xml b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..c3112fd --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch06_FutureValue + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch06_FutureValue/src/FutureValueApp.java b/murach/netbeans/book_apps/ch06_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..c738e5e --- /dev/null +++ b/murach/netbeans/book_apps/ch06_FutureValue/src/FutureValueApp.java @@ -0,0 +1,110 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println(); + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_LineItem/build.xml b/murach/netbeans/book_apps/ch07_LineItem/build.xml new file mode 100644 index 0000000..f209f88 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_LineItem. + + + diff --git a/murach/netbeans/book_apps/ch07_LineItem/manifest.mf b/murach/netbeans/book_apps/ch07_LineItem/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch07_LineItem/nbproject/build-impl.xml new file mode 100644 index 0000000..422cd46 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch07_LineItem/nbproject/genfiles.properties new file mode 100644 index 0000000..1713360 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=529e714e +build.xml.script.CRC32=236b5c94 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=529e714e +nbproject/build-impl.xml.script.CRC32=c3909ab8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.properties b/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.xml b/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.properties b/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.properties new file mode 100644 index 0000000..63af929 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_LineItem.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_LineItem +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_LineItem +main.class=LineItemApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.xml b/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.xml new file mode 100644 index 0000000..4f23adf --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_LineItem + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_LineItem/src/Console.java b/murach/netbeans/book_apps/ch07_LineItem/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_LineItem/src/LineItem.java b/murach/netbeans/book_apps/ch07_LineItem/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_LineItem/src/LineItemApp.java b/murach/netbeans/book_apps/ch07_LineItem/src/LineItemApp.java new file mode 100644 index 0000000..06c43df --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/src/LineItemApp.java @@ -0,0 +1,38 @@ +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // create 1 or more line items + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString( + "Enter product code: "); + int quantity = Console.getInt( + "Enter quantity: ", 0, 1000); + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(product, quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + lineItem.getProduct().getCode()); + System.out.println("Description: " + lineItem.getProduct().getDescription()); + System.out.println("Price: " + lineItem.getProduct().getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_LineItem/src/Product.java b/murach/netbeans/book_apps/ch07_LineItem/src/Product.java new file mode 100644 index 0000000..d3b95a2 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_LineItem/src/ProductDB.java b/murach/netbeans/book_apps/ch07_LineItem/src/ProductDB.java new file mode 100644 index 0000000..0c77034 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_LineItem/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String code) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(code); + if (code.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (code.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (code.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/netbeans/book_apps/ch07_Product/build.xml b/murach/netbeans/book_apps/ch07_Product/build.xml new file mode 100644 index 0000000..731e0bf --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_Product. + + + diff --git a/murach/netbeans/book_apps/ch07_Product/manifest.mf b/murach/netbeans/book_apps/ch07_Product/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch07_Product/nbproject/build-impl.xml new file mode 100644 index 0000000..7664c55 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch07_Product/nbproject/genfiles.properties new file mode 100644 index 0000000..a5e6602 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=40029655 +build.xml.script.CRC32=1646e5ca +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=40029655 +nbproject/build-impl.xml.script.CRC32=e0104120 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.properties b/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.xml b/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/project.properties b/murach/netbeans/book_apps/ch07_Product/nbproject/project.properties new file mode 100644 index 0000000..fe6137e --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_Product.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_Product +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_Product +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch07_Product/nbproject/project.xml b/murach/netbeans/book_apps/ch07_Product/nbproject/project.xml new file mode 100644 index 0000000..6f74273 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_Product + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch07_Product/src/Product.java b/murach/netbeans/book_apps/ch07_Product/src/Product.java new file mode 100644 index 0000000..9381cbd --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/src/Product.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_Product/src/ProductApp.java b/murach/netbeans/book_apps/ch07_Product/src/ProductApp.java new file mode 100644 index 0000000..b7a9d39 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/src/ProductApp.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch07_Product/src/ProductDB.java b/murach/netbeans/book_apps/ch07_Product/src/ProductDB.java new file mode 100644 index 0000000..4edcf88 --- /dev/null +++ b/murach/netbeans/book_apps/ch07_Product/src/ProductDB.java @@ -0,0 +1,32 @@ +public class ProductDB { + + public static Product getProduct(String code) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(code); + if (code.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } + else if (code.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } + else if (code.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } + else { + product.setDescription("Unknown"); + } + + return product; + } +} diff --git a/murach/netbeans/book_apps/ch08_Invoice/build.xml b/murach/netbeans/book_apps/ch08_Invoice/build.xml new file mode 100644 index 0000000..c71f7e9 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch08_Invoice/manifest.mf b/murach/netbeans/book_apps/ch08_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch08_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..827500f --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch08_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..27f1dd0 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=fd30db32 +build.xml.script.CRC32=8427c40a +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=fd30db32 +nbproject/build-impl.xml.script.CRC32=b440c7a2 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.properties new file mode 100644 index 0000000..79ca747 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.xml new file mode 100644 index 0000000..c59f734 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_Invoice + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/Console.java b/murach/netbeans/book_apps/ch08_Invoice/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/Invoice.java b/murach/netbeans/book_apps/ch08_Invoice/src/Invoice.java new file mode 100644 index 0000000..2eae8b5 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/Invoice.java @@ -0,0 +1,37 @@ +import java.text.NumberFormat; +import java.util.ArrayList; + +public class Invoice { + // the instance variable + private final ArrayList lineItems; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + } + + // a method that adds a line item + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + // the get accessor for the line item collection + public ArrayList getLineItems() { + return lineItems; + } + + // a method that gets the invoice total + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + // a method that returns the invoice total in currency format + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch08_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..e8a2ca2 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/InvoiceApp.java @@ -0,0 +1,41 @@ +public class InvoiceApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + + Invoice invoice = new Invoice(); + getLineItems(invoice); + displayInvoice(invoice); + } + + public static void getLineItems(Invoice invoice) { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice(Invoice invoice) { + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } + +} diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/LineItem.java b/murach/netbeans/book_apps/ch08_Invoice/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/Product.java b/murach/netbeans/book_apps/ch08_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch08_Invoice/src/ProductDB.java b/murach/netbeans/book_apps/ch08_Invoice/src/ProductDB.java new file mode 100644 index 0000000..bf7ed85 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/build.xml b/murach/netbeans/book_apps/ch08_NumberCruncher/build.xml new file mode 100644 index 0000000..0e38a79 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_NumberCruncher. + + + diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/manifest.mf b/murach/netbeans/book_apps/ch08_NumberCruncher/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/build-impl.xml new file mode 100644 index 0000000..fd5330b --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/genfiles.properties new file mode 100644 index 0000000..7fffd29 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c3750d7f +build.xml.script.CRC32=4375da7f +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=c3750d7f +nbproject/build-impl.xml.script.CRC32=1f265b02 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.properties b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.xml b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.properties b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.properties new file mode 100644 index 0000000..74aa623 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_NumberCruncher.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_NumberCruncher +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_NumberCruncher +main.class=NumberCruncherApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.xml b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.xml new file mode 100644 index 0000000..e9e64a4 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_NumberCruncher + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java b/murach/netbeans/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java new file mode 100644 index 0000000..762b184 --- /dev/null +++ b/murach/netbeans/book_apps/ch08_NumberCruncher/src/NumberCruncherApp.java @@ -0,0 +1,42 @@ +import java.util.Arrays; + +public class NumberCruncherApp { + + public static void main(String[] args) { + // create array of 11 random integers + var numbers = new int[11]; + for (int i = 0; i < numbers.length; i++) { + numbers[i] = (int) (Math.random() * 51); // num is >= 0 and <= 50 + } + + // sort the array + Arrays.sort(numbers); + + // get number string and calculate total + String numberString = ""; + int total = 0; + for (int number : numbers) { + numberString += number + " "; + total += number; + } + // display number string and total + System.out.println("Numbers: " + numberString); + System.out.println("Total: " + total); + + // get count of numbers and display + int count = numbers.length; + System.out.println("Count: " + count); + + // calculate average and display + double average = (double) total / count; + average = (double) Math.round(average * 10) / 10; + System.out.println("Average: " + average); + + // if count of numbers is odd + if (count % 2 != 0) { + int medianIndex = count / 2; + int median = numbers[medianIndex]; + System.out.println("Median: " + median); + } + } +} diff --git a/murach/netbeans/book_apps/ch09_ProductManager/build.xml b/murach/netbeans/book_apps/ch09_ProductManager/build.xml new file mode 100644 index 0000000..cbc96ad --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ProductManager. + + + diff --git a/murach/netbeans/book_apps/ch09_ProductManager/manifest.mf b/murach/netbeans/book_apps/ch09_ProductManager/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/build-impl.xml new file mode 100644 index 0000000..3f5ece7 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/genfiles.properties new file mode 100644 index 0000000..0ec69e9 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3134d0ae +build.xml.script.CRC32=559aef71 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3134d0ae +nbproject/build-impl.xml.script.CRC32=8d5f5de2 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/config.properties b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.properties b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.properties new file mode 100644 index 0000000..b07d11c --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.properties @@ -0,0 +1,4 @@ +compile.on.save=false +do.jlink=false +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.xml b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.properties b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.properties new file mode 100644 index 0000000..32afd25 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.properties @@ -0,0 +1,84 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch09_ProductManager +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ProductManager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch19_ProductMaintenance-src=src +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ProductManager +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +src.dir=${file.reference.ch19_ProductMaintenance-src} diff --git a/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.xml b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.xml new file mode 100644 index 0000000..7d7df21 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ProductManager + 1.6.5 + + + + + + + diff --git a/murach/netbeans/book_apps/ch09_ProductManager/products.txt b/murach/netbeans/book_apps/ch09_ProductManager/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/netbeans/book_apps/ch09_ProductManager/src/Console.java b/murach/netbeans/book_apps/ch09_ProductManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch09_ProductManager/src/Product.java b/murach/netbeans/book_apps/ch09_ProductManager/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch09_ProductManager/src/ProductDB.java b/murach/netbeans/book_apps/ch09_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..71126ae --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "products.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch09_ProductManager/src/ProductManagerApp.java b/murach/netbeans/book_apps/ch09_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..1e04dd7 --- /dev/null +++ b/murach/netbeans/book_apps/ch09_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,75 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + ArrayList products = ProductDB.getAll(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch10_Product/build.xml b/murach/netbeans/book_apps/ch10_Product/build.xml new file mode 100644 index 0000000..7bb18f9 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_Product. + + + diff --git a/murach/netbeans/book_apps/ch10_Product/manifest.mf b/murach/netbeans/book_apps/ch10_Product/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch10_Product/nbproject/build-impl.xml new file mode 100644 index 0000000..e4a1b23 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch10_Product/nbproject/genfiles.properties new file mode 100644 index 0000000..ae48cb8 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3a5ac07d +build.xml.script.CRC32=82fe6458 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3a5ac07d +nbproject/build-impl.xml.script.CRC32=5ac7c895 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.properties b/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.xml b/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/project.properties b/murach/netbeans/book_apps/ch10_Product/nbproject/project.properties new file mode 100644 index 0000000..cecdef5 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_Product.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_Product +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_Product +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch10_Product/nbproject/project.xml b/murach/netbeans/book_apps/ch10_Product/nbproject/project.xml new file mode 100644 index 0000000..9152727 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_Product + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch10_Product/src/Book.java b/murach/netbeans/book_apps/ch10_Product/src/Book.java new file mode 100644 index 0000000..b3e56a0 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/src/Book.java @@ -0,0 +1,21 @@ +public class Book extends Product { + private String author; + + public Book() { + super(); // call constructor of Product superclass + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} diff --git a/murach/netbeans/book_apps/ch10_Product/src/Product.java b/murach/netbeans/book_apps/ch10_Product/src/Product.java new file mode 100644 index 0000000..e52bfda --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/src/Product.java @@ -0,0 +1,44 @@ +import java.text.NumberFormat; + +public class Product { + private String code; + private String description; + private double price; + protected static int count = 0; + + public void setCode(String code) { + this.code = code; + } + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { // create public access for the count variable + return count; + } + +} diff --git a/murach/netbeans/book_apps/ch10_Product/src/ProductApp.java b/murach/netbeans/book_apps/ch10_Product/src/ProductApp.java new file mode 100644 index 0000000..3c29095 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/src/ProductApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p == null) { + System.out.println("No product matches this product code."); + } else { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} diff --git a/murach/netbeans/book_apps/ch10_Product/src/ProductDB.java b/murach/netbeans/book_apps/ch10_Product/src/ProductDB.java new file mode 100644 index 0000000..c075bbf --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database. + // For now, this code just uses if/else statements + // to return the correct product data. + + Product product = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book book = new Book(); + if (productCode.equalsIgnoreCase("java")) { + book.setCode(productCode); + book.setDescription("Murach's Java Programming"); + book.setPrice(57.50); + book.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + book.setCode(productCode); + book.setDescription("Murach's Java Servlets and JSP"); + book.setPrice(57.50); + book.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + book.setCode(productCode); + book.setDescription("Murach's MySQL"); + book.setPrice(54.50); + book.setAuthor("Joel Murach"); + } + product = book; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software software = new Software(); + software.setCode("netbeans"); + software.setDescription("NetBeans"); + software.setPrice(0.00); + software.setVersion("12.3"); + product = software; // set Product object equal to the Software object + } + return product; + } + +} diff --git a/murach/netbeans/book_apps/ch10_Product/src/Software.java b/murach/netbeans/book_apps/ch10_Product/src/Software.java new file mode 100644 index 0000000..a58b613 --- /dev/null +++ b/murach/netbeans/book_apps/ch10_Product/src/Software.java @@ -0,0 +1,21 @@ +public class Software extends Product { + private String version; + + public Software() { + super(); // call constructor of Product superclass + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + getVersion(); + } +} diff --git a/murach/netbeans/book_apps/ch11_LineItem/build.xml b/murach/netbeans/book_apps/ch11_LineItem/build.xml new file mode 100644 index 0000000..a392213 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_LineItem. + + + diff --git a/murach/netbeans/book_apps/ch11_LineItem/manifest.mf b/murach/netbeans/book_apps/ch11_LineItem/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch11_LineItem/nbproject/build-impl.xml new file mode 100644 index 0000000..769de76 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch11_LineItem/nbproject/genfiles.properties new file mode 100644 index 0000000..71f41b2 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=284bee60 +build.xml.script.CRC32=995880a8 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=284bee60 +nbproject/build-impl.xml.script.CRC32=739535ce +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.properties b/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.xml b/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.properties b/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.properties new file mode 100644 index 0000000..11e7b52 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_LineItem.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_LineItem +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_LineItem +main.class=murach.ui.LineItemApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.xml b/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.xml new file mode 100644 index 0000000..2384203 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_LineItem + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/LineItem.java b/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/LineItem.java new file mode 100644 index 0000000..f9a5768 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/LineItem.java @@ -0,0 +1,44 @@ +package murach.business; + +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/Product.java b/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/Product.java new file mode 100644 index 0000000..7f92ec9 --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/src/murach/business/Product.java @@ -0,0 +1,70 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product. +*/ +public class Product { + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Creates a Product with the specified values. + * @param code a String for the product code + * @param description a String for the product description + * @param price a double for the product price + */ + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + /** + * Sets the product code. + * @param code a String for the product code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product code. + * @return a String for the product code + */ + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch11_LineItem/src/murach/data/ProductDB.java b/murach/netbeans/book_apps/ch11_LineItem/src/murach/data/ProductDB.java new file mode 100644 index 0000000..c92c84b --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.Product; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/Console.java b/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/Console.java new file mode 100644 index 0000000..5ba353f --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/Console.java @@ -0,0 +1,59 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java b/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..3e6fbba --- /dev/null +++ b/murach/netbeans/book_apps/ch11_LineItem/src/murach/ui/LineItemApp.java @@ -0,0 +1,44 @@ +package murach.ui; + +import murach.business.LineItem; +import murach.business.Product; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // create 1 or more line items + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString( + "Enter product code: "); + int quantity = Console.getInt( + "Enter quantity: ", 0, 1000); + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(product, quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + lineItem.getProduct().getCode()); + System.out.println("Description: " + lineItem.getProduct().getDescription()); + System.out.println("Price: " + lineItem.getProduct().getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValue/nbactions.xml b/murach/netbeans/book_apps/ch12_FutureValue/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/book_apps/ch12_FutureValue/pom.xml b/murach/netbeans/book_apps/ch12_FutureValue/pom.xml new file mode 100644 index 0000000..a49ae0c --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValue + diff --git a/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/module-info.java b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/module-info.java new file mode 100644 index 0000000..8cbd6b7 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.future_value { + requires javafx.controls; + exports murach.future_value; // This is necessary for a JavaFX application +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java new file mode 100644 index 0000000..0184c77 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/business/FinancialCalculations.java @@ -0,0 +1,17 @@ +package murach.business; + +public class FinancialCalculations { + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..fe59eac --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/src/main/java/murach/future_value/FutureValueApplication.java @@ -0,0 +1,90 @@ +package murach.future_value; + +import murach.business.FinancialCalculations; +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + // get data from text fields + double investment = Double.parseDouble(investmentField.getText()); + double rate = Double.parseDouble(interestRateField.getText()); + int years = Integer.parseInt(yearsField.getText()); + + // calculate future value + double futureValue = FinancialCalculations.calculateFutureValue( + investment, rate, years); + + // set data in read-only text field + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValue/target/classes/module-info.class b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/module-info.class new file mode 100644 index 0000000..2009144 Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/module-info.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class new file mode 100644 index 0000000..04d277d Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/business/FinancialCalculations.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..b406da4 Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValue/target/classes/murach/future_value/FutureValueApplication.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..c34f750 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +module-info.class +murach\business\FinancialCalculations.class +murach\future_value\FutureValueApplication.class diff --git a/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..70a9052 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\murach\future_value\FutureValueApplication.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValue\src\main\java\murach\business\FinancialCalculations.java diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/nbactions.xml b/murach/netbeans/book_apps/ch12_FutureValueValidation/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/pom.xml b/murach/netbeans/book_apps/ch12_FutureValueValidation/pom.xml new file mode 100644 index 0000000..2e25ce7 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + murach + ch12_FutureValueValidation + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch12_FutureValueValidation + diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java new file mode 100644 index 0000000..8cbd6b7 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.future_value { + requires javafx.controls; + exports murach.future_value; // This is necessary for a JavaFX application +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java new file mode 100644 index 0000000..0184c77 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/business/FinancialCalculations.java @@ -0,0 +1,17 @@ +package murach.business; + +public class FinancialCalculations { + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + double monthlyInterestRate = interestRate/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..5678429 --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/future_value/FutureValueApplication.java @@ -0,0 +1,108 @@ +package murach.future_value; + +import murach.ui.Validation; +import murach.business.FinancialCalculations; +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(yearsField.getText(), + "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + int years = Integer.parseInt( + yearsField.getText()); + + double futureValue = FinancialCalculations.calculateFutureValue( + investment, rate, years); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java new file mode 100644 index 0000000..442315a --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/src/main/java/murach/ui/Validation.java @@ -0,0 +1,42 @@ +package murach.ui; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/module-info.class b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/module-info.class new file mode 100644 index 0000000..2009144 Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/module-info.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class new file mode 100644 index 0000000..04d277d Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/business/FinancialCalculations.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..81b923c Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/future_value/FutureValueApplication.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class new file mode 100644 index 0000000..cad236c Binary files /dev/null and b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/classes/murach/ui/Validation.class differ diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..f01dceb --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +murach\business\FinancialCalculations.class +murach\future_value\FutureValueApplication.class +murach\ui\Validation.class +module-info.class diff --git a/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..12a52db --- /dev/null +++ b/murach/netbeans/book_apps/ch12_FutureValueValidation/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,4 @@ +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\ui\Validation.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\module-info.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\business\FinancialCalculations.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch12_FutureValueValidation\src\main\java\murach\future_value\FutureValueApplication.java diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/nbactions.xml b/murach/netbeans/book_apps/ch13_SocialMediaSignup/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/pom.xml b/murach/netbeans/book_apps/ch13_SocialMediaSignup/pom.xml new file mode 100644 index 0000000..3300bbb --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_SocialMediaSignup + 1.0-SNAPSHOT + + UTF-8 + 16 + 16 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.signup.SignupApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java b/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java new file mode 100644 index 0000000..f8284dc --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.signup { + requires javafx.controls; + exports murach.signup; +} diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java b/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java new file mode 100644 index 0000000..c85d837 --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/src/main/java/murach/signup/SignupApp.java @@ -0,0 +1,161 @@ +package murach.signup; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.TextArea; +import javafx.scene.control.Button; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.SelectionMode; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.control.CheckBox; +import javafx.scene.control.Alert; +import javafx.scene.control.DatePicker; +import javafx.stage.Stage; + +import java.util.List; + +public class SignupApp extends Application { + + private TextField nameField = new TextField(); + private DatePicker dobPicker = new DatePicker(); + private ToggleGroup genderToggle = new ToggleGroup(); + private ListView genreListView = new ListView<>(); + private ComboBox countryCombo = new ComboBox<>(); + private TextArea descriptionArea = new TextArea(); + private CheckBox notifyCheckBox = new CheckBox("Receive notifications"); + + @Override + public void start(Stage stage) { + stage.setTitle("Social Media Signup"); + VBox vbox = new VBox(10); + + // name + HBox nameBox = new HBox(10); + Label nameLabel = new Label("Name: "); + nameField.setMinWidth(209); + nameBox.getChildren().add(nameLabel); + nameBox.getChildren().add(nameField); + vbox.getChildren().add(nameBox); + + // date of birth (DOB) + HBox dobBox = new HBox(10); + Label dobLabel = new Label("Date of Birth: "); + dobBox.getChildren().add(dobLabel); + dobBox.getChildren().add(dobPicker); + vbox.getChildren().add(dobBox); + + // gender + HBox genderBox = new HBox(10); + Label genderLabel = new Label("Gender: "); + + RadioButton maleButton = new RadioButton("Male"); + maleButton.setToggleGroup(genderToggle); + maleButton.setSelected(true); + RadioButton femaleButton = new RadioButton("Female"); + femaleButton.setToggleGroup(genderToggle); + RadioButton otherButton = new RadioButton("Other"); + otherButton.setToggleGroup(genderToggle); + + genderBox.getChildren().add(genderLabel); + genderBox.getChildren().add(maleButton); + genderBox.getChildren().add(femaleButton); + genderBox.getChildren().add(otherButton); + vbox.getChildren().add(genderBox); + + // country + Label countryLabel = new Label("Country: "); + countryCombo.setPromptText("Select Country"); + String[] countries = {"United States", "Canada", "Mexico"}; + for (String country : countries) { + countryCombo.getItems().add(country); + } + vbox.getChildren().add(countryLabel); + vbox.getChildren().add(countryCombo); + + // movie genres + Label movieLabel = new Label("Favorite Movie Genres: "); + genreListView.getSelectionModel() + .setSelectionMode(SelectionMode.MULTIPLE); + String[] genres = {"Action", "Comedy", "Sci-Fi", "Horror", "Drama"}; + for (String genre : genres) { + genreListView.getItems().add(genre); + } + genreListView.setPrefHeight(genres.length * 24); + vbox.getChildren().add(movieLabel); + vbox.getChildren().add(genreListView); + + // description + Label descriptionLabel = new Label("Profile Description: "); + descriptionArea.setPrefColumnCount(35); + descriptionArea.setPrefRowCount(4); + descriptionArea.setWrapText(true); + ScrollPane descriptionScroll = new ScrollPane(descriptionArea); + vbox.getChildren().add(descriptionLabel); + vbox.getChildren().add(descriptionScroll); + + // notification + vbox.getChildren().add(notifyCheckBox); + + // button + Button signUpButton = new Button("Sign Up"); + signUpButton.setOnAction(event -> signUpButtonClicked()); + vbox.getChildren().add(signUpButton); + + vbox.setPadding(new Insets(10, 10, 10, 10)); + Scene scene = new Scene(vbox); + stage.setScene(scene); + stage.show(); + } + + public void signUpButtonClicked() { + // preprocess a few controls + RadioButton selectedGender = + (RadioButton) genderToggle.getSelectedToggle(); + + String country = countryCombo.getSelectionModel().getSelectedItem(); + + String genresStr = ""; + List genres = + genreListView.getSelectionModel().getSelectedItems(); + for(String genre : genres) { + genresStr += genre + " "; + } + + String notifications; + if(notifyCheckBox.isSelected()) { + notifications = "On"; + } + else { + notifications = "Off"; + } + + // build output string + String outputString = + "Name: " + nameField.getText() + "\n" + + "DOB: " + dobPicker.getValue() + "\n" + + "Gender: " + selectedGender.getText() + "\n" + + "Country: " + country + "\n" + + "Favorite movie genres: " + genresStr + "\n" + + "Profile description: " + descriptionArea.getText() + "\n" + + "Notifications: " + notifications + "\n"; + + // display output string + Alert alert = new Alert(Alert.AlertType.INFORMATION); + alert.setTitle("Signup Info"); + alert.setHeaderText("Signup Confirmation"); + alert.setContentText(outputString); + alert.showAndWait(); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class new file mode 100644 index 0000000..fb9ea86 Binary files /dev/null and b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/module-info.class differ diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class new file mode 100644 index 0000000..c8d979a Binary files /dev/null and b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/classes/murach/signup/SignupApp.class differ diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..1b35638 --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +module-info.class +murach\signup\SignupApp.class diff --git a/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..164fc33 --- /dev/null +++ b/murach/netbeans/book_apps/ch13_SocialMediaSignup/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch13_SocialMediaSignup\src\main\java\murach\signup\SignupApp.java +C:\Users\Scott\Dropbox\Java 6ed\java\netbeans\book_apps\ch13_SocialMediaSignup\src\main\java\module-info.java diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/build.xml b/murach/netbeans/book_apps/ch14_CreateAccount/build.xml new file mode 100644 index 0000000..98ab344 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_CreateAccount. + + + diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/manifest.mf b/murach/netbeans/book_apps/ch14_CreateAccount/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/build-impl.xml new file mode 100644 index 0000000..fb1ede5 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/genfiles.properties new file mode 100644 index 0000000..57b6bb4 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=87c1a91e +build.xml.script.CRC32=6084319a +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=87c1a91e +nbproject/build-impl.xml.script.CRC32=75ae9cd1 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.properties b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.xml b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.properties b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.properties new file mode 100644 index 0000000..67d8907 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_CreateAccount.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_CreateAccount +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_CreateAccount +main.class=CreateAccountApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.xml b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.xml new file mode 100644 index 0000000..a830042 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_CreateAccount + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_CreateAccount/src/CreateAccountApp.java b/murach/netbeans/book_apps/ch14_CreateAccount/src/CreateAccountApp.java new file mode 100644 index 0000000..c81cce6 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_CreateAccount/src/CreateAccountApp.java @@ -0,0 +1,66 @@ +import java.util.Scanner; + +public class CreateAccountApp { + + private static final Scanner sc = new Scanner(System.in); + + public static void main(String[] args) { + String fullName = getFullName(); + System.out.println(); + + String password = getPassword(); + System.out.println(); + + String msg = getSuccessMessage(fullName); + System.out.println(msg); + } + + private static String getFullName() { + while(true) { + System.out.print("Enter full name: "); + String name = sc.nextLine().trim(); + if(name.contains(" ")) { + return name; + } else { + System.out.println("You must enter your full name.\n"); + } + } + } + + private static String getPassword() { + while(true) { + System.out.print("Enter password: "); + String password = sc.nextLine().trim(); + + boolean isMinLength = false; + boolean hasDigit = false; + boolean hasUppercase = false; + + if (password.length() >= 8) { + isMinLength = true; + } + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (isMinLength && hasDigit && hasUppercase) { + return password; + } else { + System.out.println("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getSuccessMessage(String fullName) { + int index = fullName.indexOf(" "); + String firstName = fullName.substring(0,1).toUpperCase() + + fullName.substring(1, index).toLowerCase(); + return "Hi " + firstName + ", thanks for creating an account!\n"; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch14_Hangman/build.xml b/murach/netbeans/book_apps/ch14_Hangman/build.xml new file mode 100644 index 0000000..44ae646 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_Hangman. + + + diff --git a/murach/netbeans/book_apps/ch14_Hangman/manifest.mf b/murach/netbeans/book_apps/ch14_Hangman/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch14_Hangman/nbproject/build-impl.xml new file mode 100644 index 0000000..d506b7f --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch14_Hangman/nbproject/genfiles.properties new file mode 100644 index 0000000..38c72a2 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d6eb40f1 +build.xml.script.CRC32=f7cb716d +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=d6eb40f1 +nbproject/build-impl.xml.script.CRC32=e7002b49 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/config.properties b/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.properties b/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.xml b/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.properties b/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.properties new file mode 100644 index 0000000..244af62 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.properties @@ -0,0 +1,116 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch14_Hangman +application.vendor=Scott +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_Hangman.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_Hangman +endorsed.classpath= +excludes= +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_Hangman +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=HangmanApp +# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found. +manifest.custom.application.library.allowable.codebase= +# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts. +manifest.custom.caller.allowable.codebase= +# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed +manifest.custom.codebase= +# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) +manifest.custom.permissions= +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.xml b/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.xml new file mode 100644 index 0000000..e62ed6f --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_Hangman + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch14_Hangman/src/Hangman.java b/murach/netbeans/book_apps/ch14_Hangman/src/Hangman.java new file mode 100644 index 0000000..12f01f7 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/src/Hangman.java @@ -0,0 +1,91 @@ +import java.util.Scanner; + +public class Hangman { + private final WordList wordList = new WordList(); + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses = 0; + private int numWrong = 0; + private String guessedLetters = ""; + private final Scanner sc = new Scanner(System.in); + + public Hangman() { + word = wordList.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + } + + public char getLetter() { + while (true) { + System.out.print("Enter a letter: "); + String s = sc.nextLine().toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if (Character.isLetter(c)) { + if (guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + System.out.println("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + System.out.println("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + System.out.println("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordList.addSpaces(displayedWord), + numGuesses, numWrong, + wordList.addSpaces(guessedLetters)); + System.out.println(display); + } + + public void playGame() { + drawScreen(); + + while (numWrong < 10 && remainingLetters > 0) { + char guess = getLetter(); + + int index = word.indexOf(guess); + if (index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if (guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if (remainingLetters == 0) { + System.out.println(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + System.out.println(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch14_Hangman/src/HangmanApp.java b/murach/netbeans/book_apps/ch14_Hangman/src/HangmanApp.java new file mode 100644 index 0000000..0ce2efe --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/src/HangmanApp.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class HangmanApp { + + public static void main(String[] args) { + System.out.println("Play the H A N G M A N game"); + + Scanner sc = new Scanner(System.in); + String again = "y"; + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.playGame(); + System.out.println(); + System.out.print("Play again? (y/n): "); + again = sc.nextLine(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch14_Hangman/src/WordList.java b/murach/netbeans/book_apps/ch14_Hangman/src/WordList.java new file mode 100644 index 0000000..b495a0c --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/src/WordList.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class WordList { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public WordList() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/netbeans/book_apps/ch14_Hangman/words.txt b/murach/netbeans/book_apps/ch14_Hangman/words.txt new file mode 100644 index 0000000..e97d1c0 --- /dev/null +++ b/murach/netbeans/book_apps/ch14_Hangman/words.txt @@ -0,0 +1,50 @@ +aardvark +action +activity +aftermath +agreement +air +beds +border +box +branch +cemetery +cheese +day +death +deer +design +edge +finger +fish +fruit +gold +haircut +home +ice +leather +line +look +mom +mountain +need +observation +ocean +oven +peace +pigs +playground +plough +quilt +sidewalk +smell +spade +spy +swing +throne +truck +twig +vessel +wave +wind +zipper \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch15_Invoice/build.xml b/murach/netbeans/book_apps/ch15_Invoice/build.xml new file mode 100644 index 0000000..528399e --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch15_Invoice/manifest.mf b/murach/netbeans/book_apps/ch15_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch15_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..6f6baa1 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch15_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..b7f0e69 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=4d79b040 +build.xml.script.CRC32=50da0fd2 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=4d79b040 +nbproject/build-impl.xml.script.CRC32=703f8a7c +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/config.properties b/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.properties new file mode 100644 index 0000000..2af0b3d --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_Invoice +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch15_Invoice +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch15_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.xml new file mode 100644 index 0000000..7b660c4 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_Invoice + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/Console.java b/murach/netbeans/book_apps/ch15_Invoice/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/Invoice.java b/murach/netbeans/book_apps/ch15_Invoice/src/Invoice.java new file mode 100644 index 0000000..d35b1af --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/Invoice.java @@ -0,0 +1,32 @@ +import java.text.NumberFormat; +import java.util.List; +import java.util.LinkedList; + +public class Invoice { + private List lineItems; + + public Invoice() { + lineItems = new LinkedList<>(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public List getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } +} diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch15_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..e8a2ca2 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/InvoiceApp.java @@ -0,0 +1,41 @@ +public class InvoiceApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + + Invoice invoice = new Invoice(); + getLineItems(invoice); + displayInvoice(invoice); + } + + public static void getLineItems(Invoice invoice) { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice(Invoice invoice) { + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + for (LineItem lineItem : invoice.getLineItems()) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } + +} diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/LineItem.java b/murach/netbeans/book_apps/ch15_Invoice/src/LineItem.java new file mode 100644 index 0000000..c552e21 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/LineItem.java @@ -0,0 +1,42 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + this.product = null; + this.quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + return product.getPrice() * quantity; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/Product.java b/murach/netbeans/book_apps/ch15_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch15_Invoice/src/ProductDB.java b/murach/netbeans/book_apps/ch15_Invoice/src/ProductDB.java new file mode 100644 index 0000000..bf7ed85 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} diff --git a/murach/netbeans/book_apps/ch15_WordCounter/build.xml b/murach/netbeans/book_apps/ch15_WordCounter/build.xml new file mode 100644 index 0000000..cdc0c75 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_WordCounter. + + + diff --git a/murach/netbeans/book_apps/ch15_WordCounter/manifest.mf b/murach/netbeans/book_apps/ch15_WordCounter/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/build-impl.xml new file mode 100644 index 0000000..d1131f7 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/genfiles.properties new file mode 100644 index 0000000..96d2bad --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=13629ae6 +build.xml.script.CRC32=a009bd58 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=13629ae6 +nbproject/build-impl.xml.script.CRC32=04f3636a +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.properties b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.xml b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.properties b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.properties new file mode 100644 index 0000000..25fcabb --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_WordCounter.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch15_WordCounter +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch15_WordCounter +main.class=WordCounterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.xml b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.xml new file mode 100644 index 0000000..b07bca7 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_WordCounter + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch15_WordCounter/src/WordCounterApp.java b/murach/netbeans/book_apps/ch15_WordCounter/src/WordCounterApp.java new file mode 100644 index 0000000..c0e2da1 --- /dev/null +++ b/murach/netbeans/book_apps/ch15_WordCounter/src/WordCounterApp.java @@ -0,0 +1,37 @@ +import java.util.TreeMap; + +public class WordCounterApp { + + public static void main(String[] args) { + System.out.println("The Word Counter application\n"); + + // define a string that contains text + String text = "To be or not to be, that is the question."; + + // process the string + text = text.replace(",", "") // remove commas + .replace(".", "") // remove periods + .toLowerCase(); // convert to lower case + + // split the string into an array + String[] words = text.split(" "); + + // define a map and fill it with words and their counts + var wordMap = new TreeMap(); + int count; + for (String word : words) { + if (wordMap.containsKey(word)) { // word is in map + count = wordMap.get(word); + count++; + wordMap.put(word, count); + } else { // new word for map + wordMap.put(word, 1); + } + } + + // print the entries + for (var entry : wordMap.entrySet()) { + System.out.println(entry.getKey() + ": " + entry.getValue()); + } + } +} diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/build.xml b/murach/netbeans/book_apps/ch17_DirectorySearch/build.xml new file mode 100644 index 0000000..346eb45 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_DirectorySearch. + + + diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/manifest.mf b/murach/netbeans/book_apps/ch17_DirectorySearch/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/build-impl.xml new file mode 100644 index 0000000..71ca590 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/genfiles.properties new file mode 100644 index 0000000..2c42416 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=dce1ac0d +build.xml.script.CRC32=34657575 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=dce1ac0d +nbproject/build-impl.xml.script.CRC32=3799f443 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.properties b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.xml b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.properties b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.properties new file mode 100644 index 0000000..ac2ff13 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_DirectorySearch.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_DirectorySearch +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_DirectorySearch +main.class=murach.DirectorySearchApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.xml b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.xml new file mode 100644 index 0000000..4d109e7 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_DirectorySearch + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java b/murach/netbeans/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java new file mode 100644 index 0000000..9d9a2c9 --- /dev/null +++ b/murach/netbeans/book_apps/ch17_DirectorySearch/src/murach/DirectorySearchApp.java @@ -0,0 +1,55 @@ +package murach; + +import java.util.Scanner; +import java.util.ArrayList; +import java.io.File; + +public class DirectorySearchApp { + + public static void main(String[] args) { + System.out.println("**** Directory Search ****"); + Scanner sc = new Scanner(System.in); + + System.out.print("Enter directory to search: "); + String directory = sc.nextLine(); + + System.out.print("Enter the file to search for: "); + String target = sc.nextLine(); + + ArrayList foundFiles = directorySearch(directory, target); + if (foundFiles.isEmpty()) { + System.out.println("NO FILES FOUND."); + } + else { + System.out.println("FILES"); + for (File file : foundFiles) { + System.out.println(file); + } + } + } + + public static ArrayList directorySearch(String directory, + String target) { + File dir = new File(directory); + File[] dirListing = dir.listFiles(); + + var foundFiles = new ArrayList(); // create empty list + if (dirListing != null) { + for (File child : dirListing) { + if (child.isDirectory()) { + ArrayList subtreeFoundFiles = directorySearch( + child.getAbsolutePath(), target); + for (File file : subtreeFoundFiles) { + foundFiles.add(file); + } + } + else { // not a directory - check if it's the target + if (child.getName().equals(target)) { + foundFiles.add(child); + } + } + } + } + return foundFiles; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch18_Invoice/build.xml b/murach/netbeans/book_apps/ch18_Invoice/build.xml new file mode 100644 index 0000000..464f032 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch18_Invoice. + + + diff --git a/murach/netbeans/book_apps/ch18_Invoice/manifest.mf b/murach/netbeans/book_apps/ch18_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch18_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..d62a765 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch18_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..8d102f2 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=17abd4bb +build.xml.script.CRC32=25fcf7ff +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=17abd4bb +nbproject/build-impl.xml.script.CRC32=ae19ba26 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/config.properties b/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.properties b/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..a347093 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.properties @@ -0,0 +1,10 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +file.reference.Ch11_Invoice1-src=C:\\murach\\java\\netbeans\\book_apps\\ch14_Invoice\\src +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.xml b/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.properties b/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.properties new file mode 100644 index 0000000..74c6ba8 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.properties @@ -0,0 +1,96 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch18_Invoice +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch18_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.Ch11_Invoice1-src=src +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch18_Invoice +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=InvoiceApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.xml b/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.xml new file mode 100644 index 0000000..34c2113 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch18_Invoice + 1.6.5 + + + + + + + diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/Console.java b/murach/netbeans/book_apps/ch18_Invoice/src/Console.java new file mode 100644 index 0000000..76a0331 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/Console.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/Invoice.java b/murach/netbeans/book_apps/ch18_Invoice/src/Invoice.java new file mode 100644 index 0000000..11b90fb --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/Invoice.java @@ -0,0 +1,53 @@ +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getDate() { + return invoiceDate; + } + + public String getDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.SHORT); + return dtf.format(invoiceDate); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/InvoiceApp.java b/murach/netbeans/book_apps/ch18_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..b8db34e --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + System.out.println("Invoice date: " + + invoice.getDateFormatted() + "\n"); + + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + var lineItems = invoice.getLineItems(); + + for (LineItem lineItem : lineItems) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/LineItem.java b/murach/netbeans/book_apps/ch18_Invoice/src/LineItem.java new file mode 100644 index 0000000..29d7cf2 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/LineItem.java @@ -0,0 +1,58 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/Product.java b/murach/netbeans/book_apps/ch18_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch18_Invoice/src/ProductDB.java b/murach/netbeans/book_apps/ch18_Invoice/src/ProductDB.java new file mode 100644 index 0000000..40487c0 --- /dev/null +++ b/murach/netbeans/book_apps/ch18_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch19_ProductManager/build.xml b/murach/netbeans/book_apps/ch19_ProductManager/build.xml new file mode 100644 index 0000000..2b11d58 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch21_ProductManager. + + + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/manifest.mf b/murach/netbeans/book_apps/ch19_ProductManager/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbbuild.xml b/murach/netbeans/book_apps/ch19_ProductManager/nbbuild.xml new file mode 100644 index 0000000..05755f5 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbbuild.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch19_ProductManager. + + + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/build-impl.xml b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/build-impl.xml new file mode 100644 index 0000000..2435a02 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/genfiles.properties b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/genfiles.properties new file mode 100644 index 0000000..ebd44ff --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +nbbuild.xml.data.CRC32=59bb8ff9 +nbbuild.xml.script.CRC32=eaa291c2 +nbbuild.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=59bb8ff9 +nbproject/build-impl.xml.script.CRC32=6d2cf7ef +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/config.properties b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.properties b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.xml b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.properties b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.properties new file mode 100644 index 0000000..4a2b74e --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.properties @@ -0,0 +1,93 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch19_ProductManager +application.vendor=Joel Murach +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 +buildfile=nbbuild.xml +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch19_ProductManager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch21_ProductMaint-DBTester=DBTester +file.reference.ch21_ProductMaint-ProductMaintenance=ProductMaintenance +file.reference.sqlite-jdbc.jar-1=sqlite-jdbc.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.sqlite-jdbc.jar-1} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch19_ProductManager +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.xml b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.xml new file mode 100644 index 0000000..c95efa2 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch19_ProductManager + + + + + + + diff --git a/murach/netbeans/book_apps/ch19_ProductManager/products.sqlite b/murach/netbeans/book_apps/ch19_ProductManager/products.sqlite new file mode 100644 index 0000000..4e159f8 Binary files /dev/null and b/murach/netbeans/book_apps/ch19_ProductManager/products.sqlite differ diff --git a/murach/netbeans/book_apps/ch19_ProductManager/sqlite-jdbc.jar b/murach/netbeans/book_apps/ch19_ProductManager/sqlite-jdbc.jar new file mode 100644 index 0000000..9e40219 Binary files /dev/null and b/murach/netbeans/book_apps/ch19_ProductManager/sqlite-jdbc.jar differ diff --git a/murach/netbeans/book_apps/ch19_ProductManager/src/Console.java b/murach/netbeans/book_apps/ch19_ProductManager/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch19_ProductManager/src/Product.java b/murach/netbeans/book_apps/ch19_ProductManager/src/Product.java new file mode 100644 index 0000000..9bb48e9 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/src/Product.java @@ -0,0 +1,49 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch19_ProductManager/src/ProductDB.java b/murach/netbeans/book_apps/ch19_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..f906acf --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/src/ProductDB.java @@ -0,0 +1,109 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + var products = new ArrayList(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + Product p = new Product(code, description, price); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/netbeans/book_apps/ch19_ProductManager/src/ProductManagerApp.java b/murach/netbeans/book_apps/ch19_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..db8cef7 --- /dev/null +++ b/murach/netbeans/book_apps/ch19_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,69 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch01_Test/build.xml b/murach/netbeans/ex_solutions/ch01_Test/build.xml new file mode 100644 index 0000000..e84d79a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch01_Test. + + + diff --git a/murach/netbeans/ex_solutions/ch01_Test/manifest.mf b/murach/netbeans/ex_solutions/ch01_Test/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch01_Test/nbproject/build-impl.xml new file mode 100644 index 0000000..83292da --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch01_Test/nbproject/genfiles.properties new file mode 100644 index 0000000..5963741 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=af852f38 +build.xml.script.CRC32=f5426f6e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=af852f38 +nbproject/build-impl.xml.script.CRC32=bb2ea288 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.properties b/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.properties new file mode 100644 index 0000000..4052e57 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch01_Test.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch01_Test +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch01_Test +main.class=TestApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.xml b/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.xml new file mode 100644 index 0000000..122312f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch01_Test + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch01_Test/src/TestApp.java b/murach/netbeans/ex_solutions/ch01_Test/src/TestApp.java new file mode 100644 index 0000000..c35ae5a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch01_Test/src/TestApp.java @@ -0,0 +1,5 @@ +public class TestApp { + public static void main(String[] args) { + System.out.println("Success!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/build.xml b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/build.xml new file mode 100644 index 0000000..be9c433 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_ex2_TestScore_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/manifest.mf b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..58cdc6c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..e825ffe --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=eadbd53a +build.xml.script.CRC32=b5546c5e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=eadbd53a +nbproject/build-impl.xml.script.CRC32=98c5b6ab +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.properties new file mode 100644 index 0000000..783d9c4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_ex2_TestScore_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_ex2_TestScore_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_ex2_TestScore_sol +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.xml new file mode 100644 index 0000000..28f10bf --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_ex2_TestScore_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java new file mode 100644 index 0000000..2c1bad6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex2_TestScore_sol/src/TestScoreApp.java @@ -0,0 +1,46 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, and average score +// double averageScore = (double) scoreTotal / scoreCount; + double averageScore = 0.0; + if (scoreCount > 0) { + averageScore = (double) scoreTotal / scoreCount; + } + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/build.xml b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/build.xml new file mode 100644 index 0000000..132fd99 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_ex3_Invoice_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/manifest.mf b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..f1acbae --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..4b0473b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=87325adf +build.xml.script.CRC32=ee4070ef +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=87325adf +nbproject/build-impl.xml.script.CRC32=b4f995a3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.properties new file mode 100644 index 0000000..55ecb20 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_ex3_Invoice_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_ex3_Invoice_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_ex3_Invoice_sol +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.xml new file mode 100644 index 0000000..d209e3e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_ex3_Invoice_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..233ed28 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch02_ex3_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,63 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // initialize variables for use in calculating averages + double invoiceTotal = 0.0; + double discountTotal = 0.0; + int invoiceCount = 0; + + // perform invoice calculations until choice is "n" or "N" + String choice = "y"; + while (!choice.equalsIgnoreCase("n")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 500) { + discountPercent = .25; + } else if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // accumulate the invoice count and invoice total + invoiceTotal = invoiceTotal + total; + discountTotal = discountTotal + discountAmount; + invoiceCount = invoiceCount + 1; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + + // calculate and display invoice count, average invoice, and average discount + String message = "Number of invoices: " + invoiceCount + "\n" + + "Average invoice: " + invoiceTotal / invoiceCount + "\n" + + "Average discount: " + discountTotal / invoiceCount + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/build.xml b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/build.xml new file mode 100644 index 0000000..f0427d5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch03_ex1_MPG_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/manifest.mf b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..04a27cd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..75134b6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=449f5b48 +build.xml.script.CRC32=23d3c25a +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=449f5b48 +nbproject/build-impl.xml.script.CRC32=088f2727 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.properties new file mode 100644 index 0000000..72427d5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch03_ex1_MPG_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch03_ex1_MPG_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch03_ex1_MPG_sol +main.class=MPGApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.xml new file mode 100644 index 0000000..8e04514 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch03_ex1_MPG_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java new file mode 100644 index 0000000..9cb8008 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex1_MPG_sol/src/MPGApp.java @@ -0,0 +1,37 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class MPGApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Miles Per Gallon calculator"); + System.out.println(); // print a blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter miles driven: "); + input = sc.nextLine(); + double miles = Double.parseDouble(input); + + System.out.print("Enter gallons of gas used: "); + input = sc.nextLine(); + double gallons = Double.parseDouble(input); + + double mpg = miles/gallons; + //mpg = (double) Math.round(mpg * 100) / 100; + //System.out.println("Miles per gallon is " + mpg + "."); + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMaximumFractionDigits(2); + System.out.println("Miles per gallon is " + number.format(mpg) + "."); + System.out.println(); + + System.out.print("Calculate another MPG? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/build.xml b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/build.xml new file mode 100644 index 0000000..6ba18cb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch03_ex2_TestScore_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/manifest.mf b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..805707d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..dc2554b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=961334dd +build.xml.script.CRC32=a8fe1e1c +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=961334dd +nbproject/build-impl.xml.script.CRC32=a59beb13 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.properties new file mode 100644 index 0000000..6c05bfd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch03_ex2_TestScore_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch03_ex2_TestScore_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch03_ex2_TestScore_sol +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.xml new file mode 100644 index 0000000..be37113 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch03_ex2_TestScore_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java new file mode 100644 index 0000000..c9eaf7b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch03_ex2_TestScore_sol/src/TestScoreApp.java @@ -0,0 +1,54 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + int maximumScore = 0; // start with the lowest score possible + int minimumScore = 100; // start with the highest score possible + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount++; + scoreTotal += testScore; + maximumScore = Math.max(maximumScore, testScore); + minimumScore = Math.min(minimumScore, testScore); + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, average score, + // highest score, and lowest score + double averageScore = (double) scoreTotal / scoreCount; + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMaximumFractionDigits(1); + + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + //+ "Average score: " + averageScore + "\n" + + "Average score: " + number.format(averageScore) + "\n" + + "Highest score: " + maximumScore + "\n" + + "Lowest score: " + minimumScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/build.xml new file mode 100644 index 0000000..f2711dc --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex1_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..c1ac44b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..7adf192 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=e431464d +build.xml.script.CRC32=0858a4b2 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=e431464d +nbproject/build-impl.xml.script.CRC32=158d1634 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..2bddec3 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex1_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex1_FutureValue_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex1_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..421bff7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex1_FutureValue_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..676ebc2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + System.out.println("Month " + i + ": " + futureValue); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/build.xml b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/build.xml new file mode 100644 index 0000000..55d6376 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex2_Invoice_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/manifest.mf b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..046f1ff --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..a5eca1b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=58af1d24 +build.xml.script.CRC32=b6b3c2e8 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=58af1d24 +nbproject/build-impl.xml.script.CRC32=fc54d8a3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.properties new file mode 100644 index 0000000..be595ad --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex2_Invoice_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex2_Invoice_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex2_Invoice_sol +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.xml new file mode 100644 index 0000000..fdd9a69 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex2_Invoice_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..4f63810 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex2_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,63 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c/t): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = .1; // default discount + if (customerType.equalsIgnoreCase("r")) { + if (subtotal >= 500) { + discountPercent = .3; + } else if (subtotal >= 250) { + discountPercent = .25; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + } + else if (customerType.equalsIgnoreCase("c")) { + discountPercent = .2; + } + else if (customerType.equalsIgnoreCase("t")) { + if (subtotal < 500) { + discountPercent = .4; + } else { + discountPercent = .5; + } + } + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/build.xml b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/build.xml new file mode 100644 index 0000000..bebcba1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex3_GuessNumber_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/manifest.mf b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..524c68a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..7d1fafd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a700927a +build.xml.script.CRC32=dd211265 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=a700927a +nbproject/build-impl.xml.script.CRC32=b92278a6 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.properties new file mode 100644 index 0000000..da20981 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex3_GuessNumber_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex3_GuessNumber_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex3_GuessNumber_sol +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.xml new file mode 100644 index 0000000..5e47c2a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex3_GuessNumber_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java new file mode 100644 index 0000000..f6afba4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex3_GuessNumber_sol/src/GuessNumberApp.java @@ -0,0 +1,37 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + int guess = 0; + while (guess != number) { + System.out.print("Your guess: "); + guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + } else if (guess < number) { + System.out.println("Too low."); + count++; + } else if (guess > number) { + System.out.println("Too high."); + count++; + } + } + System.out.println("You guessed it in " + count + " tries.\n"); + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/build.xml new file mode 100644 index 0000000..1c8a9f7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex4_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..c2c68de --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..8526083 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d70fc321 +build.xml.script.CRC32=eedfe8dd +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=d70fc321 +nbproject/build-impl.xml.script.CRC32=bd5e8e55 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..cd2e540 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex4_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex4_FutureValue_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex4_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..312c755 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex4_FutureValue_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..bc43bfa --- /dev/null +++ b/murach/netbeans/ex_solutions/ch04_ex4_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,62 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + System.out.println(); + + // get currency and percent formatters + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + + // display the header row + System.out.printf("%-5s", "Year"); + for (double rate = 5.0; rate < 7.0; rate += .5) { + System.out.printf("%12s", percent.format(rate/100)); + } + System.out.println(); + + // display one row for each year + for (int year = 1; year <= years; year++) { + // add year to first column + System.out.printf("%-5s", year); + + // display one column for each interest rate + for (double rate = 5.0; rate < 7.0; rate += .5) { + int months = year * 12; + double monthlyInterestRate = rate/12/100; + + // calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // add future value to its column + System.out.printf("%12s", currency.format(futureValue)); + } + System.out.println(); // start a new row + } + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/build.xml new file mode 100644 index 0000000..fd7146c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_ex1_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..1dea241 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..9a81ae5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=22038d40 +build.xml.script.CRC32=b594cb7d +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=22038d40 +nbproject/build-impl.xml.script.CRC32=150d823c +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..d28d4ec --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_ex1_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_ex1_FutureValue_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_ex1_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..40eacba --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_ex1_FutureValue_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..3e6f1a7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,120 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + printFormattedResults(monthlyInvestment, interestRate, + years, futureValue); + + // see if the user wants to continue + choice = askToContinue(sc); + } + } + + private static void printFormattedResults(double monthlyInvestment, + double interestRate, int years, double futureValue) { + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + } + + public static String askToContinue(Scanner sc) { + System.out.print("Continue? (y/n): "); + String choice = sc.nextLine(); + System.out.println(); + return choice; + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + double value = Double.parseDouble(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + int value = Integer.parseInt(sc.nextLine()); + return value; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/build.xml b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/build.xml new file mode 100644 index 0000000..b40b9d2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_ex2_GuessNumber_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/manifest.mf b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..d239b5a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..aa60bcd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=6e3ed86b +build.xml.script.CRC32=e2bc3c76 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=6e3ed86b +nbproject/build-impl.xml.script.CRC32=9b323e1b +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.properties new file mode 100644 index 0000000..dbe4338 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_ex2_GuessNumber_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_ex2_GuessNumber_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_ex2_GuessNumber_sol +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.xml new file mode 100644 index 0000000..4cd96d0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_ex2_GuessNumber_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java new file mode 100644 index 0000000..5a9653c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch05_ex2_GuessNumber_sol/src/GuessNumberApp.java @@ -0,0 +1,54 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess; + try { + guess = Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid number. Try again."); + continue; + } + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/build.xml b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/build.xml new file mode 100644 index 0000000..d276523 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch06_ex1_Invoice_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/manifest.mf b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..0014059 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..d0d03b4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=9b1ddb88 +build.xml.script.CRC32=c1f0e19e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=9b1ddb88 +nbproject/build-impl.xml.script.CRC32=8c3e64a7 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.properties new file mode 100644 index 0000000..2e79091 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch06_ex1_Invoice_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch06_ex1_Invoice_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch06_ex1_Invoice_sol +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.xml new file mode 100644 index 0000000..2b20ec2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch06_ex1_Invoice_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..5922a22 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex1_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,68 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + double subtotal = 0.0; + while (true) { // continue until user enters valid data + System.out.print("Enter subtotal: "); + try { + subtotal = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value.\n"); + } + } + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100 && subtotal < 250) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/build.xml new file mode 100644 index 0000000..0b532a4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch06_ex2_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..28c49e9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..714a208 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a2305532 +build.xml.script.CRC32=f533b948 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=a2305532 +nbproject/build-impl.xml.script.CRC32=733d49fb +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..fdee0bd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch06_ex2_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch06_ex2_FutureValue_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch06_ex2_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..ebef822 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch06_ex2_FutureValue_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..722e015 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch06_ex2_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,112 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + //System.out.println("month " + i + " futureValue: " + futureValue); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/build.xml b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/build.xml new file mode 100644 index 0000000..ac20c9c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex1_Product_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/manifest.mf b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..2781061 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..616cf06 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0fe4cabb +build.xml.script.CRC32=a6f25651 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=0fe4cabb +nbproject/build-impl.xml.script.CRC32=5ff3f265 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.properties new file mode 100644 index 0000000..12343fc --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex1_Product_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex1_Product_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex1_Product_sol +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.xml new file mode 100644 index 0000000..257ead9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex1_Product_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/Product.java b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/Product.java new file mode 100644 index 0000000..fc647eb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/Product.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public String getPriceNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(2); + String priceFormatted = number.format(price); + return priceFormatted; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..8e5f0ac --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + ProductDB db = new ProductDB(); + Product product = db.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceNumberFormat()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..780fa66 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex1_Product_sol/src/ProductDB.java @@ -0,0 +1,26 @@ +public class ProductDB { + + public Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product; + + // fill the Product object with data + if (productCode.equalsIgnoreCase("java")) { + product = new Product(productCode, "Murach's Java Programming", 57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product = new Product(productCode, "Murach's Java Servlets and JSP", 57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product = new Product(productCode, "Murach's MySQL", 54.50); + } else if (productCode.equalsIgnoreCase("andr")) { + product = new Product(productCode, "Murach's Android Programming", 57.50); + } else { + product = new Product(productCode, "Unknown", 0); + } + return product; + } +} diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/build.xml new file mode 100644 index 0000000..4f975fe --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex2_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..7166424 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..1fe2c3c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=64029e3f +build.xml.script.CRC32=48ffd687 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=64029e3f +nbproject/build-impl.xml.script.CRC32=73bdddf3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..95d7aa1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex2_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex2_FutureValue_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex2_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..3427361 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex2_FutureValue_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java new file mode 100644 index 0000000..cba5085 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/Console.java @@ -0,0 +1,51 @@ +import java.util.Scanner; + +public class Console { + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java new file mode 100644 index 0000000..b5eb693 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FinancialCalculations.java @@ -0,0 +1,16 @@ +public class FinancialCalculations { + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} diff --git a/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..1e40644 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex2_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,49 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = FinancialCalculations.calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/build.xml b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/build.xml new file mode 100644 index 0000000..0577a5b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex3_AreaAndPerimeter_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/manifest.mf b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..312a9cb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..1b7f243 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=7b178cbd +build.xml.script.CRC32=70f50aa0 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=7b178cbd +nbproject/build-impl.xml.script.CRC32=67db8f0e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.properties new file mode 100644 index 0000000..a86c726 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex3_AreaAndPerimeter_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex3_AreaAndPerimeter_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex3_AreaAndPerimeter_sol +main.class=AreaAndPerimeterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.xml new file mode 100644 index 0000000..ebec42a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex3_AreaAndPerimeter_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java new file mode 100644 index 0000000..8ac2dbd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/AreaAndPerimeterApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class AreaAndPerimeterApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Area and Perimeter Calculator"); + System.out.println(); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get input from user + System.out.print("Enter length: "); + double length = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter width: "); + double width = Double.parseDouble(sc.nextLine()); + + // create the Rectangle object + Rectangle r = new Rectangle(length, width); + + // format and display output + String message = + "Area: " + r.getAreaNumberFormat() + "\n" + + "Perimeter: " + r.getPerimeterNumberFormat() + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java new file mode 100644 index 0000000..7342de2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch07_ex3_AreaAndPerimeter_sol/src/Rectangle.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Rectangle { + private double length; + private double width; + + public Rectangle() { + length = 0; + width = 0; + } + + public Rectangle(double length, double width) { + this.length = length; + this.width = width; + } + + public double getLength() { + return length; + } + + public void setLength(double length) { + this.length = length; + } + + public double getWidth() { + return width; + } + + public void setWidth(double width) { + this.width = width; + } + + public double getArea() { + double area = width * length; + return area; + } + + public String getAreaNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String numberFormatted = number.format(this.getArea()); + return numberFormatted; + } + + public double getPerimeter() { + double perimeter = 2 * width + 2 * length; + return perimeter; + } + + public String getPerimeterNumberFormat() { + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String numberFormatted = number.format(this.getPerimeter()); + return numberFormatted; + } +} diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/build.xml b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/build.xml new file mode 100644 index 0000000..aee8b2f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex1_MonthSales_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/manifest.mf b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..c868dae --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..be727c0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5d049a83 +build.xml.script.CRC32=abdd6d27 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=5d049a83 +nbproject/build-impl.xml.script.CRC32=79da0bca +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.properties new file mode 100644 index 0000000..9b5e4ce --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex1_MonthSales_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex1_MonthSales_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex1_MonthSales_sol +main.class=MonthSalesApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.xml new file mode 100644 index 0000000..e80192d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex1_MonthSales_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java new file mode 100644 index 0000000..97c32f2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java new file mode 100644 index 0000000..4cc098a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex1_MonthSales_sol/src/MonthSalesApp.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class MonthSalesApp { + + public static void main(String[] args) { + System.out.println("Monthly Sales\n"); + + // declare monthName and monthSales arrays + String[] monthNames = {"January", "February", "March", "April", "May", + "June", "July", "August", "September", "October", "November", + "December"}; + double[] monthSales = {1287.45, 2814.57, 1784.59, 2287.66, 3174.73, + 2799.41, 2458.79, 2697.45, 3279.62, 2970.77, 2788.09, 2349.88}; + + // get currency formatting + NumberFormat currency = NumberFormat.getCurrencyInstance(); + + // get one or more months + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + int monthNumber = Console.getInt("Enter month number: "); + + // validate input + if (monthNumber < 1 || monthNumber > monthNames.length) { + Console.displayLine("Invalid month number. Try again."); + continue; + } + + // get the index number for the month + // and display the month name and sales + int monthIndex = monthNumber - 1; + Console.displayLine("Sales for " + monthNames[monthIndex] + + ": " + currency.format(monthSales[monthIndex]) + "\n"); + + // check if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + Console.displayLine(); + } + + // display the total sales for the year + double sum = 0.0; + for (double sales : monthSales) { + sum += sales; + } + Console.displayLine("Total sales: " + currency.format(sum)); + Console.displayLine(); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/build.xml b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/build.xml new file mode 100644 index 0000000..f3d97ea --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex2_CardDeck_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/manifest.mf b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..c5fb784 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..ea21c81 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=6ede371d +build.xml.script.CRC32=249f95a4 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=6ede371d +nbproject/build-impl.xml.script.CRC32=01db1c2f +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.properties new file mode 100644 index 0000000..519e75d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex2_CardDeck_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex2_CardDeck_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex2_CardDeck_sol +main.class=CardDeckApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.xml new file mode 100644 index 0000000..3ab803b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex2_CardDeck_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java new file mode 100644 index 0000000..b76a93e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex2_CardDeck_sol/src/CardDeckApp.java @@ -0,0 +1,57 @@ +import java.util.Arrays; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + String[] deck = new String[52]; + int i = 0; + for (String suit : suits) { + for (String rank : ranks) { + deck[i] = rank + " of " + suit; + i++; + } + } + return deck; + } + + private static void displayCards(String[] cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(String[] deck) { + for (int i = 0; i < deck.length; i++) { + String savedCard = deck[i]; + int randomIndex = (int) (Math.random() * deck.length-1); + deck[i] = deck[randomIndex]; + deck[randomIndex] = savedCard; + } + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = Arrays.copyOfRange(deck, 0, count); + return hand; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/build.xml b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/build.xml new file mode 100644 index 0000000..7e05870 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex3_CardDeck_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/manifest.mf b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..f0f46a3 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..97c0768 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3c4b636a +build.xml.script.CRC32=1e661460 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3c4b636a +nbproject/build-impl.xml.script.CRC32=5574ff94 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.properties new file mode 100644 index 0000000..18c149f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex3_CardDeck_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex3_CardDeck_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex3_CardDeck_sol +main.class=CardDeckApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.xml new file mode 100644 index 0000000..cd8fdee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex3_CardDeck_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java new file mode 100644 index 0000000..a87c888 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch08_ex3_CardDeck_sol/src/CardDeckApp.java @@ -0,0 +1,62 @@ +import java.util.ArrayList; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + ArrayList deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + int hands = 4; + System.out.println("FOUR HANDS OF " + count + " CARDS"); + for (int i = 0; i < hands; i++) { + ArrayList hand = dealCards(deck, count); + displayCards(hand); + } + System.out.println("CARDS LEFT IN DECK: " + deck.size()); + } + + private static ArrayList getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + var deck = new ArrayList(52); + for (String suit : suits) { + for (String rank : ranks) { + deck.add(rank + " of " + suit); + } + } + return deck; + } + + private static void displayCards(ArrayList cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(ArrayList deck) { + for (int i = 0; i < deck.size(); i++) { + String savedCard = deck.get(i); + int randomIndex = (int) (Math.random() * deck.size() - 1); + deck.set(i, deck.get(randomIndex)); + deck.set(randomIndex, savedCard); + } + } + + private static ArrayList dealCards(ArrayList deck, int count) { + var hand = new ArrayList(count); + for (int i = 0; i < count; i++) { + hand.add(deck.remove(i)); + } + return hand; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/build.xml b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/build.xml new file mode 100644 index 0000000..804542e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex1_CustomerManager_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt new file mode 100644 index 0000000..6419de1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/customers.txt @@ -0,0 +1,3 @@ +Thomas Willliams tomwilliams@gmail.com +Jane Adams janeadams@yahoo.com +Robert Rodriguez robertrodriguez@sbcglobal.net diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/manifest.mf b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..d73985f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..95983a6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c8f94b9b +build.xml.script.CRC32=31b5930b +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=c8f94b9b +nbproject/build-impl.xml.script.CRC32=6c32d79f +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.xml new file mode 100644 index 0000000..8505fc1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/private/private.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.properties new file mode 100644 index 0000000..d3b5eb4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.properties @@ -0,0 +1,88 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch09_ex1_CustomerManager_sol +application.vendor=Anne +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ex1_CustomerManager_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ex1_CustomerManager_sol +main.class=CustomerManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.xml new file mode 100644 index 0000000..aacb7d2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex1_CustomerManager_sol + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java new file mode 100644 index 0000000..ec622e7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/Customer.java @@ -0,0 +1,44 @@ +public class Customer { + + private String firstName; + private String lastName; + private String email; + + public Customer() { + this("", "", ""); + } + + public Customer(String firstName, String lastName, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getFirstName() { + return firstName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getLastName() { + return lastName; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEmail() { + return email; + } + + public String getName() { + return firstName + " " + lastName; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java new file mode 100644 index 0000000..5e5a963 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public final class CustomerDB { + + private static final String FILENAME = "customers.txt"; + private static final String COL_SEP = "\t"; + + public static ArrayList getAll() { + var customers = new ArrayList(); + + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COL_SEP); + String first = columns[0]; + String last = columns[1]; + String email = columns[2]; + + Customer c = new Customer(first, last, email); + customers.add(c); + + line = in.readLine(); + } + return customers; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList customers) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + for (Customer c : customers) { + out.print(c.getFirstName()+ COL_SEP); + out.print(c.getLastName()+ COL_SEP); + out.println(c.getEmail()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java new file mode 100644 index 0000000..c0437cb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex1_CustomerManager_sol/src/CustomerManagerApp.java @@ -0,0 +1,86 @@ +import java.util.ArrayList; + +public class CustomerManagerApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Manager\n"); + + // create the db object and get the list of customers + ArrayList customers = CustomerDB.getAll(); + + // display the command menu + displayMenu(); + + // perform 1 or more actions + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + // get the input from the user + action = Console.getString("Enter a command: "); + System.out.println(); + + if (action.equalsIgnoreCase("list")) { + displayAll(customers); + } else if (action.equalsIgnoreCase("add")) { + addCustomer(customers); + } else if (action.equalsIgnoreCase("del") || + action.equalsIgnoreCase("delete")) { + deleteCustomer(customers); + } else if (action.equalsIgnoreCase("help") || + action.equalsIgnoreCase("menu")) { + displayMenu(); + } else if (action.equalsIgnoreCase("exit")) { + System.out.println("Bye.\n"); + } else { + System.out.println("Error! Not a valid command.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all customers"); + System.out.println("add - Add a customer"); + System.out.println("del - Delete a customer"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList customers) { + System.out.println("CUSTOMER LIST"); + + String format = "%-27s%-40s%n"; + for (Customer c : customers) { + System.out.printf(format, c.getName(), c.getEmail()); + } + System.out.println(); + } + + public static void addCustomer(ArrayList customers) { + String firstName = Console.getString("Enter first name: "); + String lastName = Console.getString("Enter last name: "); + String email = Console.getString("Enter customer email: "); + + Customer customer = new Customer(firstName, lastName, email); + customers.add(customer); + CustomerDB.saveAll(customers); + + System.out.println(customer.getName() + " has been added.\n"); + } + + public static void deleteCustomer(ArrayList customers) { + String email = Console.getString("Enter email to delete: "); + + for (Customer c : customers) { + if (c.getEmail().equals(email)) { + customers.remove(c); + CustomerDB.saveAll(customers); // save list to file + System.out.println(c.getName() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No customer matches that email.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/build.xml b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/build.xml new file mode 100644 index 0000000..cbf5f8f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex2_ProductManager_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/manifest.mf b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..2d66325 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f8236c8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2ebe5e1d +build.xml.script.CRC32=12753a97 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=2ebe5e1d +nbproject/build-impl.xml.script.CRC32=d736a89c +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.properties new file mode 100644 index 0000000..f63173d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.properties @@ -0,0 +1,84 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch09_ex2_ProductManager_sol +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ex2_ProductManager_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch19_ProductMaintenance-src=src +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ex2_ProductManager_sol +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +src.dir=${file.reference.ch19_ProductMaintenance-src} diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.xml new file mode 100644 index 0000000..732f783 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex2_ProductManager_sol + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/products.txt b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java new file mode 100644 index 0000000..9d6260b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "productsX.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java new file mode 100644 index 0000000..d55c4f5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex2_ProductManager_sol/src/ProductManagerApp.java @@ -0,0 +1,82 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + var products = ProductDB.getAll(); + + // check if read was successful + if (products == null) { + System.out.println("Unable to read data."); + System.out.println("Exiting application."); + return; // exit main() method + } + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/build.xml b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/build.xml new file mode 100644 index 0000000..1dca708 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex3_ExceptionTester_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/manifest.mf b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..cb2cdac --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..ba2ee9c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=4387c4ed +build.xml.script.CRC32=a4a1fb65 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=4387c4ed +nbproject/build-impl.xml.script.CRC32=ce9b299a +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.properties new file mode 100644 index 0000000..1304e28 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch09_ex3_ExceptionTester_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch09_ex3_ExceptionTester_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch09_ex3_ExceptionTester_sol +main.class=ExceptionTesterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.xml new file mode 100644 index 0000000..5ba539e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex3_ExceptionTester_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java new file mode 100644 index 0000000..39e352b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch09_ex3_ExceptionTester_sol/src/ExceptionTesterApp.java @@ -0,0 +1,36 @@ +import java.io.*; + +public class ExceptionTesterApp { + + public static void main(String[] args) { + System.err.println("In main: calling method1."); + method1(); + System.err.println("In main: returned from method1."); + } + + public static void method1() { + System.err.println("\tIn method1: calling method2."); + try { + method2(); + } catch (FileNotFoundException e) { + System.err.println(e); + } + System.err.println("\tIn method1: returned from method2."); + } + + public static void method2() throws FileNotFoundException { + System.err.println("\t\tIn method2: calling method3."); + method3(); + System.err.println("\t\tIn method2: returned from method3."); + } + + public static void method3() throws FileNotFoundException { + System.err.println("\t\t\tIn method3: Entering."); + + if (true) { + throw new FileNotFoundException("This is a test"); + } + + System.err.println("\t\t\tIn method3: Exiting."); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/build.xml b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/build.xml new file mode 100644 index 0000000..39165dd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex1_Product_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/manifest.mf b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..8d66d7f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..7c733b0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=36cd1d21 +build.xml.script.CRC32=13548b9d +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=36cd1d21 +nbproject/build-impl.xml.script.CRC32=aff5f9d8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.properties new file mode 100644 index 0000000..3b01dde --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex1_Product_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex1_Product_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex1_Product_sol +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.xml new file mode 100644 index 0000000..1bba8cd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex1_Product_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Album.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Album.java new file mode 100644 index 0000000..c7e684f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Album.java @@ -0,0 +1,23 @@ +public class Album extends Product { + + private String artist; + + public Album() { + super(); + artist = ""; + count++; + } + + public void setArtist(String artist) { + this.artist = artist; + } + + public String getArtist() { + return artist; + } + + @Override + public String toString() { + return super.toString() + " (" + artist + ")"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Book.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Product.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Product.java new file mode 100644 index 0000000..14fb621 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..e1b62bb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/ProductDB.java @@ -0,0 +1,49 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } else if (productCode.equalsIgnoreCase("sgtp")) { + Album a = new Album(); + a.setCode("sgtp"); + a.setDescription("Sgt. Peppers"); + a.setPrice(14.99); + a.setArtist("The Beatles"); + p = a; // set Product object equal to the Album object + } + return p; + } +} diff --git a/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Software.java b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex1_Product_sol/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/build.xml b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/build.xml new file mode 100644 index 0000000..c4aea3e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex2_Product_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/manifest.mf b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..4226309 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..c404727 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=eb66d9b5 +build.xml.script.CRC32=d8e69704 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=eb66d9b5 +nbproject/build-impl.xml.script.CRC32=f5f81f1d +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.properties new file mode 100644 index 0000000..fec3b78 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex2_Product_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex2_Product_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex2_Product_sol +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.xml new file mode 100644 index 0000000..c2140a1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex2_Product_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Book.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Book.java new file mode 100644 index 0000000..8c2089e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String getDisplayText() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Product.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Product.java new file mode 100644 index 0000000..6e77dbd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Product.java @@ -0,0 +1,52 @@ +import java.text.NumberFormat; + +public abstract class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public abstract String getDisplayText(); + + public static int getCount() { + return count; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java new file mode 100644 index 0000000..d9cc3ac --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.getDisplayText()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java new file mode 100644 index 0000000..944af49 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Software.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Software.java new file mode 100644 index 0000000..e2e50bd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String getDisplayText() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java new file mode 100644 index 0000000..f314f02 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex2_Product_sol/src/UsedBook.java @@ -0,0 +1,8 @@ +public class UsedBook extends Book { + + @Override + public String getDisplayText() { + return ""; + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/build.xml b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/build.xml new file mode 100644 index 0000000..99f8b93 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex3_EqualsTest_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/manifest.mf b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..9f9b08d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..3fbc035 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a92e546f +build.xml.script.CRC32=3813ea1e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=a92e546f +nbproject/build-impl.xml.script.CRC32=6c4a89ab +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.properties new file mode 100644 index 0000000..6d574a1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch10_ex3_EqualsTest_sol +application.vendor=maryd +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex3_EqualsTest_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex3_EqualsTest_sol +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs=\ --enable-preview +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex3_EqualsTest_sol +main.class=EqualsTestApp +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=\ --enable-preview +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.xml new file mode 100644 index 0000000..3e5ce5b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex3_EqualsTest_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java new file mode 100644 index 0000000..15dad47 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/EqualsTestApp.java @@ -0,0 +1,40 @@ +public class EqualsTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Equals Tester\n"); + + //Both variables refer to different objects that store the same data + Product product1 = new Product("java", "Murach's Java Programming", 57.5); + Product product2 = new Product("java", "Murach's Java Programming", 57.5); + // test equals() method + if (product1.equals(product2)) { + System.out.println("The Product class is comparing data."); + } else { + System.out.println("The Product class is comparing references."); + } + // test hashCode() method + if (product1.hashCode() == product2.hashCode()) { + System.out.println("The Product object hash codes match."); + } else { + System.out.println("The Product object hash codes are different."); + } + System.out.println(); + + //Both variables refer to different objects that store the same data + LineItem li1 = new LineItem(product1, 1); + LineItem li2 = new LineItem(product2, 1); + // test equals() method + if (li1.equals(li2)) { + System.out.println("The LineItem class is comparing data."); + } else { + System.out.println("The LineItem class is comparing references."); + } + // test hashCode() method + if (li1.hashCode() == li2.hashCode()) { + System.out.println("The LineItem object hash codes match."); + } else { + System.out.println("The LineItem object hash codes are different."); + } + System.out.println(); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java new file mode 100644 index 0000000..722724e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/LineItem.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + product = new Product(); + quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + double total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object instanceof LineItem lineItem){ + return product.equals(lineItem.product) && + quantity == lineItem.quantity; + } else { + return false; + } + } + + @Override + public int hashCode() { + return product.hashCode() + quantity; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java new file mode 100644 index 0000000..8871d39 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch10_ex3_EqualsTest_sol/src/Product.java @@ -0,0 +1,67 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object instanceof Product p){ + return code.equals(p.code) && + description.equals(p.description) && + price == p.price; + } else { + return false; + } + } + + @Override + public int hashCode() { + return code.hashCode() + description.hashCode() + (int) price; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/build.xml b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/build.xml new file mode 100644 index 0000000..4e9a3fc --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex1_DisplayableTest_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/manifest.mf b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..f58fbe4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f2fcd45 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=818ae569 +build.xml.script.CRC32=afefa139 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=818ae569 +nbproject/build-impl.xml.script.CRC32=6a42f9ce +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.properties new file mode 100644 index 0000000..a2d673a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex1_DisplayableTest_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex1_DisplayableTest_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex1_DisplayableTest_sol +main.class=DisplayableTestApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.xml new file mode 100644 index 0000000..9f633fb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex1_DisplayableTest_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java new file mode 100644 index 0000000..44c68be --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DepartmentConstants.java @@ -0,0 +1,5 @@ +public interface DepartmentConstants { + int ADMIN = 1; + int EDITORIAL = 2; + int MARKETING = 3; +} diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java new file mode 100644 index 0000000..1ab1f0f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Displayable.java @@ -0,0 +1,5 @@ +public interface Displayable { + default String getDisplayText() { + return toString(); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java new file mode 100644 index 0000000..8cb5962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/DisplayableTestApp.java @@ -0,0 +1,21 @@ +public class DisplayableTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Displayable Test application\n"); + + // create an Employee object and display it + Displayable e = new Employee(2, "Smith", "John"); + display(e); + + // create a Product object and display it + Displayable p = new Product("java", "Murach's Java Programming", 57.50); + display(p); + + System.out.println(); + } + + private static void display(Displayable d) { + System.out.println(d.getDisplayText()); + } + +} diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java new file mode 100644 index 0000000..1159ef1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Employee.java @@ -0,0 +1,26 @@ +public class Employee implements DepartmentConstants, Displayable { + + private int department; + private String firstName; + private String lastName; + + public Employee(int department, String lastName, String firstName) { + this.department = department; + this.lastName = lastName; + this.firstName = firstName; + } + + @Override + public String toString() { + String text = ""; + text += firstName + " " + lastName; + String dept = switch (department) { + case ADMIN -> "Administration"; + case EDITORIAL -> "Editorial"; + case MARKETING -> "Marketing"; + default -> ""; + }; + text += " (" + dept + ")"; + return text; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java new file mode 100644 index 0000000..9476e2a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex1_DisplayableTest_sol/src/Product.java @@ -0,0 +1,56 @@ +import java.text.NumberFormat; + +public class Product implements Displayable { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return getDescription(); + } + + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/build.xml b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/build.xml new file mode 100644 index 0000000..5444d8e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex2_Enumeration_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/manifest.mf b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..1ba8a7b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..a2a4df3 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=223f101e +build.xml.script.CRC32=89cc4fe9 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=223f101e +nbproject/build-impl.xml.script.CRC32=ccfb4e05 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.properties new file mode 100644 index 0000000..02d3092 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex2_Enumeration_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex2_Enumeration_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex2_Enumeration_sol +main.class=CustomerTypeApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.xml new file mode 100644 index 0000000..2115d6b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex2_Enumeration_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java new file mode 100644 index 0000000..3a695f6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerType.java @@ -0,0 +1,16 @@ +public enum CustomerType { + RETAIL, + TRADE, + COLLEGE; + + @Override + public String toString() { + String s = switch (this.ordinal()) { + case 0 -> "Retail customer"; + case 1 -> "Trade customer"; + case 2 -> "College customer"; + default -> ""; + }; + return s; + } +} diff --git a/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java new file mode 100644 index 0000000..2efa04c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex2_Enumeration_sol/src/CustomerTypeApp.java @@ -0,0 +1,28 @@ +public class CustomerTypeApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Type Test application\n"); + + // get and display the discount percent for a customer type + CustomerType trade = CustomerType.TRADE; + double discountPercent = getDiscountPercent(trade); + System.out.println("discountPercent: " + discountPercent + "\n"); + + // display the value of the toString method of a customer type + System.out.println("toString: " + trade.toString() + "\n"); + } + + // a method that accepts a CustomerType enumeration + public static double getDiscountPercent(CustomerType ct) { + double discountPercent = 0; + if (ct != null) { + switch (ct) { + case RETAIL -> discountPercent = 0.10; + case TRADE -> discountPercent = 0.30; + case COLLEGE -> discountPercent = 0.20; + } + } + return discountPercent; + } +} diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/build.xml b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/build.xml new file mode 100644 index 0000000..e7e75cf --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex3_LineItem_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/manifest.mf b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..dab766f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f3facaa --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d0f980d4 +build.xml.script.CRC32=23b07238 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=d0f980d4 +nbproject/build-impl.xml.script.CRC32=3ae2ac14 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.properties new file mode 100644 index 0000000..110db9f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex3_LineItem_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex3_LineItem_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex3_LineItem_sol +main.class=ui.LineItemApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.xml new file mode 100644 index 0000000..25d6116 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex3_LineItem_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java new file mode 100644 index 0000000..70a2309 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/LineItem.java @@ -0,0 +1,51 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The LineItem class represents a line item and is used by the + * Product class. + */ +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + product = null; + quantity = 0; + total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getTotal() { + total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java new file mode 100644 index 0000000..9cd4082 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/business/Product.java @@ -0,0 +1,84 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product and is used by the + * LineItem class. + * @author Joel Murach + * @version 1.0.0 +*/ +public class Product { + + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Sets the product's code. + * @param code a String for the product's code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product's code. + * @return a String for the product's code + */ + public String getCode() { + return code; + } + + /** + * Sets the product's description. + * @param description a String for the product's description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Gets the product's description. + * @return a String for the product's description + */ + public String getDescription() { + return description; + } + + /** + * Sets the product's price. + * @param price a double value for the product's price + */ + public void setPrice(double price) { + this.price = price; + } + + /** + * Gets a double value for the product's price. + * @return a double value that represents the product's price + */ + public double getPrice() { + return price; + } + + /** + * Gets a String for the product's price with + * standard currency formatting + * @return a String for the product's price with + * standard currency formatting applied ($1,000.00). + */ + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java new file mode 100644 index 0000000..f4a982a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.*; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java new file mode 100644 index 0000000..2b64312 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/Console.java @@ -0,0 +1,104 @@ +package murach.ui; + +import java.util.Scanner; + +/** + * The Console class provides methods that can be used to get + * input from a console application. + */ +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + /** + * Displays the specified prompt to the console and gets + * a String from the user. + * + * @param prompt A String prompt to the user. + * @return A String entered by the user. + */ + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + /** + * Displays the specified prompt to the console and + * gets an int value from the user. + * + * @param prompt A String prompt to the user. + * @return An int value entered by the user. + */ + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets an int value from the user + * that's within the specified range. + * + * @param prompt A String prompt to the user. + * @param min The minimum int value. + * @param max The maximum int value. + * @return An int value entered by the user. + */ + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets a double value from the user. + * + * @param prompt A String prompt to the user. + * @return A double value entered by the user. + */ + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + /** + * Displays the specified prompt to the console and + * gets a double value from the user + * that's within the specified range. + * + * @param prompt A String prompt to the user. + * @param min The minimum double value. + * @param max The maximum double value. + * @return A double value entered by the user. + */ + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..c953983 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch11_ex3_LineItem_sol/src/murach/ui/LineItemApp.java @@ -0,0 +1,43 @@ +package murach.ui; + +import murach.business.*; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: ", 0, 1000); + + // use the ProductDB class to get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(); + lineItem.setProduct(product); + lineItem.setQuantity(quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + product.getCode()); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/pom.xml b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/pom.xml new file mode 100644 index 0000000..2d22234 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..d21fbf6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,66 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..e04d628 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class new file mode 100644 index 0000000..54de3f1 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e4b4a94 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +module-info.class diff --git a/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..c532f41 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex1_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +/murach/java/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/module-info.java +/murach/java/netbeans/ex_solutions/ch12_ex1_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/pom.xml b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/pom.xml new file mode 100644 index 0000000..b313014 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..fd3bd7e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,82 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + private Label milesError; + private Label gallonsError; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + Validation v = new Validation(); + + String errorMsg = ""; + errorMsg += v.isDouble(milesField.getText(), "Miles"); + errorMsg += v.isDouble(gallonsField.getText(), "Gallons"); + + if (errorMsg.isEmpty()) { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java new file mode 100644 index 0000000..eea2014 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/com/murach/mpg/Validation.java @@ -0,0 +1,42 @@ +package com.murach.mpg; + +public class Validation { + + private String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..00ba589 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class new file mode 100644 index 0000000..bef7ee1 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/com/murach/mpg/Validation.class differ diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class new file mode 100644 index 0000000..54de3f1 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..c9ba0cd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\mpg\MpgApp.class +module-info.class +com\murach\mpg\Validation.class diff --git a/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..55d2160 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch12_ex2_MPG_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch12_ex2_MPG_sol\src\main\java\com\murach\mpg\Validation.java diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml new file mode 100644 index 0000000..a0ba80f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue_sol + diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..6c37f15 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/FutureValueApplication.java @@ -0,0 +1,128 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.control.ComboBox; +import javafx.scene.control.ListView; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private ComboBox yearsCombo = new ComboBox<>(); + private ListView futureValues = new ListView<>(); + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + + grid.add(new Label("Years:"), 0, 2); + yearsCombo.setPromptText("Select Number of Years"); + for(int i = 1; i <= 20; i++) { + yearsCombo.getItems().add(i); + } + grid.add(yearsCombo, 1, 2); + + HBox listViewContainer = new HBox(10); + futureValues.setPrefHeight(5*24); + listViewContainer.getChildren().add(futureValues); + grid.add(new Label("Future Value:"), 0, 3); + grid.add(listViewContainer, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + int years = yearsCombo.getSelectionModel().getSelectedItem(); + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(String.valueOf(years), "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + for(int i = 1; i <= years; i++) { + double futureValue = calculateFutureValue( + investment, rate, i); + futureValues.getItems().add( + "Year " + i + ": " + currency.format(futureValue)); + } + + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java new file mode 100644 index 0000000..4a03e70 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/com/murach/future_value/Validation.java @@ -0,0 +1,42 @@ +package com.murach.future_value; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java new file mode 100644 index 0000000..bc26e83 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.future_value { + requires javafx.controls; + exports com.murach.future_value; // This is necessary, but why? +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..a0215ad Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/ch13_ex1_FutureValue_sol-1.0-SNAPSHOT.jar differ diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..5d42958 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/FutureValueApplication.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class new file mode 100644 index 0000000..04d728d Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/com/murach/future_value/Validation.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class new file mode 100644 index 0000000..d656ad2 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties new file mode 100644 index 0000000..09b2951 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Tue Aug 24 10:56:13 PDT 2021 +groupId=com.murach +artifactId=ch13_ex1_FutureValue_sol +version=1.0-SNAPSHOT diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..dd7d16d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\future_value\FutureValueApplication.class +com\murach\future_value\Validation.class +module-info.class diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..a628004 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\module-info.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\com\murach\future_value\Validation.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex1_FutureValue_sol\src\main\java\com\murach\future_value\FutureValueApplication.java diff --git a/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/murach/netbeans/ex_solutions/ch13_ex1_FutureValue_sol/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml new file mode 100644 index 0000000..7b873a0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator_sol + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.pizza_calculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex2_PizzaCalculator_sol + diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java new file mode 100644 index 0000000..63a5e0f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.ch13_ex2_pizzacalculator { + requires javafx.controls; + exports murach.pizza_calculator; +} diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/App.java b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/App.java new file mode 100644 index 0000000..70e7b7e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/App.java @@ -0,0 +1,130 @@ +package murach.pizza_calculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + private ToggleGroup sizeToggle = new ToggleGroup(); + private CheckBox sausageBox = new CheckBox("Sausage"); + private CheckBox peppBox = new CheckBox("Pepperoni"); + private CheckBox salamiBox = new CheckBox("Salami"); + private CheckBox oliveBox = new CheckBox("Olives"); + private CheckBox mushBox = new CheckBox("Mushrooms"); + private CheckBox anchBox = new CheckBox("Anchovies"); + private TextField priceField = new TextField(); + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + // size + Label sizeLabel = new Label("Size"); + HBox sizeBox = new HBox(10); + + RadioButton smallButton = new RadioButton("Small"); + smallButton.setToggleGroup(sizeToggle); + smallButton.setSelected(true); + RadioButton mediumButton = new RadioButton("Medium"); + mediumButton.setToggleGroup(sizeToggle); + RadioButton largeButton = new RadioButton("Large"); + largeButton.setToggleGroup(sizeToggle); + + sizeBox.getChildren().add(smallButton); + sizeBox.getChildren().add(mediumButton); + sizeBox.getChildren().add(largeButton); + appContainer.getChildren().add(sizeLabel); + appContainer.getChildren().add(sizeBox); + + // toppings + Label toppingsLabel = new Label("Toppings"); + HBox sizeContainer = new HBox(10); + VBox sizeCol1 = new VBox(10); + VBox sizeCol2 = new VBox(10); + + sizeCol1.getChildren().add(sausageBox); + sizeCol1.getChildren().add(peppBox); + sizeCol1.getChildren().add(salamiBox); + sizeCol2.getChildren().add(oliveBox); + sizeCol2.getChildren().add(mushBox); + sizeCol2.getChildren().add(anchBox); + sizeContainer.getChildren().add(sizeCol1); + sizeContainer.getChildren().add(sizeCol2); + appContainer.getChildren().add(toppingsLabel); + appContainer.getChildren().add(sizeContainer); + + // price output + Label priceLabel = new Label("Price: "); + HBox priceContainer = new HBox(10); + priceField.setEditable(false); + priceContainer.getChildren().add(priceLabel); + priceContainer.getChildren().add(priceField); + appContainer.getChildren().add(priceContainer); + + // calculate button + Button signUpButton = new Button("Calculate"); + signUpButton.setOnAction(event -> calculatePrice(stage)); + appContainer.getChildren().add(signUpButton); + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + RadioButton size = + (RadioButton) sizeToggle.getSelectedToggle(); + if(size.getText() == "Small") { + price += 6.99; + } else if(size.getText() == "Medium") { + price += 8.99; + } else { + price += 10.99; + } + + if(sausageBox.isSelected()) { + price += 1.49; + } + if(peppBox.isSelected()) { + price += 1.49; + } + if(salamiBox.isSelected()) { + price += 1.49; + } + if(oliveBox.isSelected()) { + price += 0.99; + } + if(mushBox.isSelected()) { + price += 0.99; + } + if(anchBox.isSelected()) { + price += 0.99; + } + price = (double)Math.round(price * 100.0) / 100.0; + priceField.setText("$" + price); + } + + public static void main(String[] args) { + launch(); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/SystemInfo.java b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/SystemInfo.java new file mode 100644 index 0000000..e164e4f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/src/main/java/murach/pizza_calculator/SystemInfo.java @@ -0,0 +1,13 @@ +package murach.pizza_calculator; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class new file mode 100644 index 0000000..53d8067 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/App.class b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/App.class new file mode 100644 index 0000000..c1e0d13 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/App.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/SystemInfo.class b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/SystemInfo.class new file mode 100644 index 0000000..0c970b5 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/classes/murach/pizza_calculator/SystemInfo.class differ diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e4b4a94 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +module-info.class diff --git a/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..5524360 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch13_ex2_PizzaCalculator_sol/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\murach\pizza_calculator\SystemInfo.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\murach\pizza_calculator\App.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_solutions\ch13_ex2_PizzaCalculator_sol\src\main\java\module-info.java diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/build.xml b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/build.xml new file mode 100644 index 0000000..f44245e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_ex1_CreateAccount_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/manifest.mf b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..74112ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..6785fa4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3068aa1f +build.xml.script.CRC32=75766219 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3068aa1f +nbproject/build-impl.xml.script.CRC32=9830da06 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.properties new file mode 100644 index 0000000..7aa1ccd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_ex1_CreateAccount_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_ex1_CreateAccount_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_ex1_CreateAccount_sol +main.class=CreateAccountApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.xml new file mode 100644 index 0000000..4c5f4f7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_ex1_CreateAccount_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java new file mode 100644 index 0000000..7c3eff9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex1_CreateAccount_sol/src/CreateAccountApp.java @@ -0,0 +1,110 @@ +import java.util.Scanner; + +public class CreateAccountApp { + + private static final Scanner sc = new Scanner(System.in); + + public static void main(String[] args) { + String fullName = getFullName(); + // String password = getPassword(); + // String email = getEmail(); + String phone = getPhone(); + System.out.println(); + + String msg = getSuccessMessage(fullName, phone); + System.out.println(msg); + } + + private static String getFullName() { + while(true) { + System.out.print("Enter full name: "); + String name = sc.nextLine().trim(); + if(name.contains(" ")) { + return name; + } else { + System.out.println("You must enter your full name.\n"); + } + } + } + + private static String getPassword() { + while(true) { + System.out.print("Enter password: "); + String password = sc.nextLine().trim(); + + boolean isMinLength = false; + boolean hasDigit = false; + boolean hasUppercase = false; + + if (password.length() >= 8) { + isMinLength = true; + } + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (isMinLength && hasDigit && hasUppercase) { + return password; + } else { + System.out.println("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getEmail() { + while (true) { + System.out.print("Enter email: "); + String email = sc.nextLine().trim(); + + if (email.contains("@") && email.contains(".com")) { + return email; + } + else { + System.out.println("Please enter a valid email address."); + } + } + } + + private static String getPhone() { + while (true) { + System.out.print("Enter phone number: "); + String phone = sc.nextLine().trim(); + + String[] illegalChars = " -().".split(""); + for (String illegalChar : illegalChars) { + phone = phone.replace(illegalChar, ""); + } + + boolean allDigits = true; + for (char c: phone.toCharArray()) { + if (!Character.isDigit(c)) { + allDigits = false; + } + } + + if (phone.length() == 10 && allDigits) { + phone = phone.substring(0,3) + "." + + phone.substring(3,6) + "." + + phone.substring(6); + return phone; + } + else { + System.out.println("Please enter a 10-digit phone number."); + } + } + } + + private static String getSuccessMessage(String fullName, String phone) { + int index = fullName.indexOf(" "); + String firstName = fullName.substring(0,1).toUpperCase() + + fullName.substring(1, index).toLowerCase(); + return "Hi " + firstName + ", thanks for creating an account!\n" + + "We'll text your confirmation code to this number: " + phone; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/build.xml b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/build.xml new file mode 100644 index 0000000..f31fe5a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_ex2_Hangman_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/manifest.mf b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..d2ed049 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..ee18130 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=85b7f422 +build.xml.script.CRC32=44dd2f74 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=85b7f422 +nbproject/build-impl.xml.script.CRC32=4eee5ef9 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.properties new file mode 100644 index 0000000..00d2faf --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_ex2_Hangman_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_ex2_Hangman_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_ex2_Hangman_sol +main.class=HangmanApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.xml new file mode 100644 index 0000000..cf8abd4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_ex2_Hangman_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java new file mode 100644 index 0000000..fcbf62a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/Hangman.java @@ -0,0 +1,147 @@ +import java.util.Scanner; + +public class Hangman { + private final WordList wordList = new WordList(); + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses = 0; + private int numWrong = 0; + private String guessedLetters = ""; + private final Scanner sc = new Scanner(System.in); + + public Hangman() { + word = wordList.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + } + + public char getLetter() { + while (true) { + System.out.print("Enter a letter: "); + String s = sc.nextLine().toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if (Character.isLetter(c)) { + if (guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + System.out.println("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + System.out.println("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + System.out.println("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + drawHangman(numWrong); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordList.addSpaces(displayedWord), + numGuesses, numWrong, + wordList.addSpaces(guessedLetters)); + System.out.println(display); + } + + public void playGame() { + drawScreen(); + + while (numWrong < 7 && remainingLetters > 0) { + char guess = getLetter(); + + int index = word.indexOf(guess); + if (index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if (guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if (remainingLetters == 0) { + System.out.println(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + System.out.println(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } + + public void drawHangman(int numWrong) { + switch (numWrong) { + case 0 -> System.out.println(""" + ____ + | + """); + case 1 -> System.out.println(""" + ____ + | + O + """); + case 2 -> System.out.println(""" + ____ + | + O + \\ + """); + case 3 -> System.out.println(""" + ____ + | + O + \\| + """); + case 4 -> System.out.println(""" + ____ + | + O + \\|/ + """); + case 5 -> System.out.println(""" + ____ + | + O + \\|/ + | + """); + case 6 -> System.out.println(""" + ____ + | + O + \\|/ + | + / + """); + case 7 -> System.out.println(""" + ____ + | + O + \\|/ + | + / \\ + """); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java new file mode 100644 index 0000000..af0f7d8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/HangmanApp.java @@ -0,0 +1,19 @@ +import java.util.Scanner; + +public class HangmanApp { + + public static void main(String[] args) { + System.out.println("Play the H A N G M A N game"); + + Scanner sc = new Scanner(System.in); + String again = "y"; + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.drawHangman(7); + hangman.playGame(); + System.out.println(); + System.out.print("Play again? (y/n): "); + again = sc.nextLine(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java new file mode 100644 index 0000000..b495a0c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/src/WordList.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class WordList { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public WordList() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/words.txt b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/words.txt new file mode 100644 index 0000000..e97d1c0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch14_ex2_Hangman_sol/words.txt @@ -0,0 +1,50 @@ +aardvark +action +activity +aftermath +agreement +air +beds +border +box +branch +cemetery +cheese +day +death +deer +design +edge +finger +fish +fruit +gold +haircut +home +ice +leather +line +look +mom +mountain +need +observation +ocean +oven +peace +pigs +playground +plough +quilt +sidewalk +smell +spade +spy +swing +throne +truck +twig +vessel +wave +wind +zipper \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/build.xml b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/build.xml new file mode 100644 index 0000000..efd1847 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex1_FutureValue_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/manifest.mf b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..ee8b978 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..8f72fdd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2df90f53 +build.xml.script.CRC32=bef2d833 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=2df90f53 +nbproject/build-impl.xml.script.CRC32=acffc5d1 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.properties new file mode 100644 index 0000000..a7074dd --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.properties @@ -0,0 +1,4 @@ +compile.on.save=true +do.jlink=false +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.properties new file mode 100644 index 0000000..f976898 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.properties @@ -0,0 +1,90 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_ex1_FutureValue_sol +application.vendor=Anne +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_ex1_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch15_ex1_FutureValue_sol +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.xml new file mode 100644 index 0000000..dfad2bb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex1_FutureValue_sol + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java new file mode 100644 index 0000000..fdbead1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValue.java @@ -0,0 +1,54 @@ +import java.text.NumberFormat; + +public class FutureValue implements Comparable { + private double monthlyInvestment; + private double interestRate; + private int years; + + public FutureValue(double monthlyInvestment, double interestRate, int years) { + this.monthlyInvestment = monthlyInvestment; + this.interestRate = interestRate; + this.years = years; + } + + public double getFutureValue() { + int months = years * 12; + double monthlyInterestRate = interestRate / 12 / 100; + double futureValue = 0; + for (int i = 1; i <= months; i++) { + futureValue = + (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + public String getMonthlyInvestmentFormatted() { + return NumberFormat.getCurrencyInstance() + .format(monthlyInvestment); + } + + public String getInterestRateFormatted() { + var percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + return percent.format(interestRate/100); + } + + public int getYears() { + return this.years; + } + + public String getFutureValueFormatted() { + return NumberFormat.getCurrencyInstance() + .format(getFutureValue()); + } + + @Override + public int compareTo(Object o) { + FutureValue calc = (FutureValue) o; + if (this.getFutureValue() < calc.getFutureValue()) return -1; + else if (this.getFutureValue() > calc.getFutureValue()) return 1; + else return 0; + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java new file mode 100644 index 0000000..644423e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex1_FutureValue_sol/src/FutureValueApp.java @@ -0,0 +1,70 @@ +import java.util.Collections; +import java.util.LinkedList; + +public class FutureValueApp { + + public static void main(String[] args) { + + LinkedList calculations = new LinkedList<>(); + + // display a welcome message + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble( + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble( + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt( + "Enter number of years: ", 0, 100); + System.out.println(); + + // create FutureValue object + FutureValue fv = new FutureValue( + monthlyInvestment, interestRate, years); + + // add to calculations collection + calculations.add(fv); + + // print the results + System.out.println("\nFORMATTED RESULTS\n" + + "Monthly investment: " + fv.getMonthlyInvestmentFormatted() + "\n" + + "Yearly interest rate: " + fv.getInterestRateFormatted() + "\n" + + "Number of years: " + fv.getYears() + "\n" + + "Future value: " + fv.getFutureValueFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + + // sort the calcuations + Collections.sort(calculations); + // this works too, but only after you've implemented the Comparable interface + /* + Collections.sort(calculations, (c1, c2) -> { + if (c1.getFutureValue()< c2.getFutureValue()) return -1; + else if (c1.getFutureValue()> c2.getFutureValue()) return 1; + else return 0; + }); + */ + + // print the results for all calculations + System.out.println("ALL CALCULATIONS (SORTED)"); + System.out.println(); + System.out.println("Inv/Mo. Rate Years Future Value"); + for (FutureValue calc : calculations) { + System.out.printf("%-12s%6s%7d%14s\n", + calc.getMonthlyInvestmentFormatted(), + calc.getInterestRateFormatted(), + calc.getYears(), + calc.getFutureValueFormatted()); + } + } +} diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/build.xml b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/build.xml new file mode 100644 index 0000000..31cc034 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex2_GenericStack_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/manifest.mf b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..beebac8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f000c3c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=8d5d7941 +build.xml.script.CRC32=2f98d7d0 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=8d5d7941 +nbproject/build-impl.xml.script.CRC32=48b05d14 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.properties new file mode 100644 index 0000000..08df567 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.properties @@ -0,0 +1,91 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_ex2_GenericStack_sol +application.vendor=Joel +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_ex2_GenericStack_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch15_ex2_GenericStack_sol +main.class=GenericStackApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.xml new file mode 100644 index 0000000..7c89e11 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex2_GenericStack_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java new file mode 100644 index 0000000..f8a5fc9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStack.java @@ -0,0 +1,21 @@ +import java.util.LinkedList; + +public class GenericStack { + private LinkedList list = new LinkedList(); + + public void push(E s) { + list.addFirst(s); + } + + public E pop() { + return list.removeFirst(); + } + + public E peek() { + return list.getFirst(); + } + + public int size() { + return list.size(); + } +} diff --git a/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java new file mode 100644 index 0000000..75de069 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex2_GenericStack_sol/src/GenericStackApp.java @@ -0,0 +1,26 @@ +public class GenericStackApp { + + public static void main(String[] args) { + GenericStack stack = new GenericStack<>(); + + // push three items onto the stack + stack.push("Apples"); + System.out.println("Push: " + stack.peek()); + stack.push("Oranges"); + System.out.println("Push: " + stack.peek()); + stack.push("Bananas"); + System.out.println("Push: " + stack.peek()); + System.out.println("The stack contains " + stack.size() + " items\n"); + + // peek at the first item + System.out.println("Peek: " + stack.peek()); + System.out.println("The stack contains " + stack.size() + " items\n"); + + // pop all three items + while (stack.size() > 0) { + System.out.println("Pop: " + stack.pop()); + } + System.out.println("The stack contains " + stack.size() + " items\n"); + } + +} diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/build.xml b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/build.xml new file mode 100644 index 0000000..4afcbc2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex3_LoginCounter_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/manifest.mf b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..2878469 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..de221d8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0cbf48b8 +build.xml.script.CRC32=345c71da +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=0cbf48b8 +nbproject/build-impl.xml.script.CRC32=93074582 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.properties new file mode 100644 index 0000000..7f2208a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.properties @@ -0,0 +1,91 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_ex3_LoginCounter_sol +application.vendor=Scott +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_ex3_LoginCounter_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch12_ex3_GenericStack_sol +main.class=LoginCounterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.xml new file mode 100644 index 0000000..6b5d1ac --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex3_LoginCounter_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/src/LoginCounterApp.java b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/src/LoginCounterApp.java new file mode 100644 index 0000000..17c3925 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch15_ex3_LoginCounter_sol/src/LoginCounterApp.java @@ -0,0 +1,33 @@ +import java.util.Map; +import java.util.TreeMap; +import java.util.Scanner; + +public class LoginCounterApp { + private static Map loginCounter = new TreeMap<>(); + + public static void main(String[] args) { + System.out.println("The Login Counter Application"); + Scanner sc = new Scanner(System.in); + while(true) { + System.out.print("Enter a username (q to quit): "); + String username = sc.nextLine(); + if (username.equals("q")) { + break; + } + login(username); + } + for (var entry : loginCounter.entrySet()) { + System.out.println(entry.getKey() + ": " + entry.getValue()); + } + } + + public static void login(String username) { + if (loginCounter.containsKey(username)) { // word is in map + int count = (int) loginCounter.get(username); + count++; + loginCounter.put(username, count); + } else { // new word for map + loginCounter.put(username, 1); + } + } +} diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/build.xml b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/build.xml new file mode 100644 index 0000000..0baff0f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch16_ex1_BookCatalog_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/manifest.mf b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..48aa676 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..28cd01a --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f3f8e6a4 +build.xml.script.CRC32=297fde9a +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=f3f8e6a4 +nbproject/build-impl.xml.script.CRC32=cd4f0d7e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.properties new file mode 100644 index 0000000..7a2cdeb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.properties @@ -0,0 +1,85 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch16_ex1_BookCatalog_sol.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.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +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=BookManagerApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.xml new file mode 100644 index 0000000..b54f1d1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch16_ex1_BookCatalog_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java new file mode 100644 index 0000000..d403bdc --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManager.java @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooks(Predicate condition) { + List books = new ArrayList<>(); + for (Book b: bookList) { + if (condition.test(b)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java new file mode 100644 index 0000000..c7a7ecf --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex1_BookCatalog_sol/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooks( + b -> b.getTitle().contains("Java")); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooks( + b -> b.getCategory().equals(Book.JAVA)); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooks( + b -> b.getFormat().equals(Book.PAPERBACK)); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/build.xml b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/build.xml new file mode 100644 index 0000000..4237d49 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch16_ex2_BookCatalog_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/manifest.mf b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..53cb94e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..7b746e8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=e2ed6580 +build.xml.script.CRC32=74fd1abf +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=e2ed6580 +nbproject/build-impl.xml.script.CRC32=aafe7aa1 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.properties new file mode 100644 index 0000000..5a75ffe --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.properties @@ -0,0 +1 @@ +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.properties new file mode 100644 index 0000000..1fc6fb8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.properties @@ -0,0 +1,85 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch16_ex2_BookCatalog_sol.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.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +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=BookManagerApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.xml new file mode 100644 index 0000000..8303cae --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch16_ex2_BookCatalog_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java new file mode 100644 index 0000000..ee47356 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch16_ex2_BookCatalog_sol/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + List bookList = new BookCatalog().getCatalog(); + + System.out.println("\nBOOKS BY TITLE:"); + bookList.stream() + .filter(b -> b.getTitle().contains("Java Programming")) + .forEach(System.out::println); + + System.out.println("\nBOOKS BY CATEGORY:"); + bookList.stream() + .filter(b -> b.getCategory().equals(Book.JAVA)) + .forEach(System.out::println); + + System.out.println("\nBOOKS BY FORMAT:"); + bookList.stream() + .filter(b -> b.getFormat().equals(Book.PAPERBACK)) + .forEach(System.out::println); + + System.out.println("\nDATABASE BOOK TITLES:"); + bookList.stream() + .filter(b -> b.getCategory().equals(Book.DATABASE)) + .map(b -> b.getTitle() + " (" + b.getFormat() + ")") + .forEach(System.out::println); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/build.xml b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/build.xml new file mode 100644 index 0000000..ac46d33 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex1_Fibonacci_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/manifest.mf b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..abab37c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f1d0dbc --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d13904ed +build.xml.script.CRC32=5c255c1f +build.xml.stylesheet.CRC32=f85dc8f2@1.95.0.48 +# 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=d13904ed +nbproject/build-impl.xml.script.CRC32=745c6406 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.properties new file mode 100644 index 0000000..3de28c8 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex1_Fibonacci_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex1_Fibonacci_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex1_Fibonacci_sol +main.class=FibonacciApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.xml new file mode 100644 index 0000000..c996cac --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex1_Fibonacci_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java new file mode 100644 index 0000000..1d765ce --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex1_Fibonacci_sol/src/FibonacciApp.java @@ -0,0 +1,36 @@ +public class FibonacciApp { + + public static void main(String[] args) { + long iterResult = iterFibo(100); + // long recResult = recFibo(45); + + System.out.println(iterResult); + // System.out.println(recResult); + } + + public static int iterFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } + int n1 = 0, n2 = 1, fib = 0; + for (int i = 2; i < n+1; i++) { + fib = n1 + n2; + n1 = n2; + n2 = fib; + } + return fib; + } + + public static int recFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } else { + return recFibo(n - 1) + recFibo(n - 2); + } + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/build.xml b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/build.xml new file mode 100644 index 0000000..9077bd4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex2_StringReversal_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/manifest.mf b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..fafef7e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..f4a4eab --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1c185915 +build.xml.script.CRC32=d84e17a8 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=1c185915 +nbproject/build-impl.xml.script.CRC32=8d63977d +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.properties new file mode 100644 index 0000000..e41251e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex2_StringReversal_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex2_StringReversal_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex2_StringReversal_sol +main.class=StringReversalApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.xml new file mode 100644 index 0000000..608dd6c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex2_StringReversal_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java new file mode 100644 index 0000000..9ea83f7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex2_StringReversal_sol/src/StringReversalApp.java @@ -0,0 +1,49 @@ +import java.util.Scanner; + +public class StringReversalApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.print("Enter string to reverse: "); + String input = sc.nextLine(); + + System.out.println("Iterative string reversal..."); + String result = iterReverse(input); + System.out.println(result); + + System.out.println("Recursive string reversal..."); + result = recReverse(input); + System.out.println(result); + System.out.println(); + } + + /* + ALGORITHM + if str has one character or less, return the string + otherwise, get the last character and add it to the beginning of the string + */ + + // iterative + public static String iterReverse(String str) { + if (str.length() <= 1) { + return str; + } + String reverseStr = ""; + for (int i = str.length()-1; i >= 0; i--) { + reverseStr += str.charAt(i); + } + return reverseStr; + } + + // recursive + public static String recReverse(String str) { + // This method will make 1 recursive call for each character in the string + if (str.length() <= 1) { // base case + return str; + } + else { + return str.charAt(str.length()-1) + recReverse(str.substring(0, str.length()-1)); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/build.xml b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/build.xml new file mode 100644 index 0000000..87ba101 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex3_GCD_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/manifest.mf b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..db54239 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..40fcc68 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=231ee65b +build.xml.script.CRC32=9700c6fc +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=231ee65b +nbproject/build-impl.xml.script.CRC32=6a887cf8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.properties new file mode 100644 index 0000000..77413d2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex3_GCD_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex3_GCD_sol +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex3_GCD_sol +main.class=GCDApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.xml new file mode 100644 index 0000000..5cb5b81 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex3_GCD_sol + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/src/GCDApp.java b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/src/GCDApp.java new file mode 100644 index 0000000..4953a31 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch17_ex3_GCD_sol/src/GCDApp.java @@ -0,0 +1,47 @@ +import java.util.Scanner; + +public class GCDApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.print("Enter the first number: "); + int firstNumber = Integer.parseInt(sc.nextLine()); + + System.out.print("Enter the second number: "); + int secondNumber = Integer.parseInt(sc.nextLine()); + + System.out.println("Iterative GCD..."); + int result = iterGCD(firstNumber, secondNumber); + System.out.println(result); + + System.out.println("Recursive GCD..."); + result = recGCD(firstNumber, secondNumber); + System.out.println(result); + System.out.println(); + } + + // iterative + public static int iterGCD(int a, int b) { + int temp; + while (b != 0) { + temp = a % b; + a = b; + b = temp; + } + return a; + } + + // recursive + public static int recGCD(int a, int b) { + // This method will make a small number of recursive calls + // because it reduces the search space exponentially with each iteration + if (b == 0) { // base case + return a; + } + else { + System.out.println("Recursive call"); + return recGCD(b, a % b); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/build.xml b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/build.xml new file mode 100644 index 0000000..45c6207 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch18_ex1_Invoice_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/manifest.mf b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..4684f60 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..8b09bbb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=07cb2f6f +build.xml.script.CRC32=59c1d5fa +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=07cb2f6f +nbproject/build-impl.xml.script.CRC32=c77fe7bb +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.properties new file mode 100644 index 0000000..2af6f4e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.properties @@ -0,0 +1,10 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +file.reference.Ch11_Invoice1-src=C:\\murach\\java\\netbeans\\ex_solutions\\ch14_ex1_Invoice_sol\\src +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.properties new file mode 100644 index 0000000..e16e5c1 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.properties @@ -0,0 +1,96 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch18_ex1_Invoice_sol +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch18_ex1_Invoice_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.Ch11_Invoice1-src=src +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch18_ex1_Invoice_sol +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=InvoiceApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.xml new file mode 100644 index 0000000..36c76bb --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch18_ex1_Invoice_sol + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Console.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Console.java new file mode 100644 index 0000000..76a0331 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Console.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Invoice.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Invoice.java new file mode 100644 index 0000000..21b710f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Invoice.java @@ -0,0 +1,64 @@ +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getDate() { + return invoiceDate; + } + + public String getDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.MEDIUM); + return dtf.format(invoiceDate); + } + + public LocalDateTime getDueDate() { + LocalDateTime dueDate = invoiceDate.plusDays(30); + return dueDate; + } + + public String getDueDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.MEDIUM); + return dtf.format(getDueDate()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/InvoiceApp.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/InvoiceApp.java new file mode 100644 index 0000000..e3df04d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/InvoiceApp.java @@ -0,0 +1,47 @@ +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + System.out.println("Invoice date: " + + invoice.getDateFormatted()); + System.out.println("Due date: " + + invoice.getDueDateFormatted() + "\n"); + + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + var lineItems = invoice.getLineItems(); + + for (LineItem lineItem : lineItems) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/LineItem.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/LineItem.java new file mode 100644 index 0000000..29d7cf2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/LineItem.java @@ -0,0 +1,58 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Product.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/ProductDB.java new file mode 100644 index 0000000..40487c0 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex1_Invoice_sol/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/build.xml b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/build.xml new file mode 100644 index 0000000..eeaa060 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch18_ex2_AgeCalculator_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/manifest.mf b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..259b198 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/build-impl.xml @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..5111e72 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=52be9e91 +build.xml.script.CRC32=cdeb6beb +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=3bcf1555 +nbproject/build-impl.xml.script.CRC32=d1426e70 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.properties new file mode 100644 index 0000000..9070b0f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +file.reference.ch12_AgeCalculator-src=C:\\murach\\java\\netbeans\\ex_solutions\\ch14_ex2_AgeCalculator_sol\\src +javac.debug=true +javadoc.preview=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.xml new file mode 100644 index 0000000..cd3e03d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/private/private.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.properties new file mode 100644 index 0000000..9907f89 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.properties @@ -0,0 +1,80 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch18_ex2_AgeCalculator_sol +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch18_ex2_AgeCalculator_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.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=AgeCalculatorApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.xml new file mode 100644 index 0000000..3f0e097 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch18_ex2_AgeCalculator_sol + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java new file mode 100644 index 0000000..c679b38 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch18_ex2_AgeCalculator_sol/src/AgeCalculatorApp.java @@ -0,0 +1,44 @@ +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.time.temporal.ChronoUnit; +import java.util.Scanner; + +public class AgeCalculatorApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Age Calculator\n"); + + // Get the current date + LocalDate currentDate = LocalDate.now(); + + // Get input from the the user + Scanner sc = new Scanner(System.in); + System.out.print("Enter your date of birth (YYYY-MM-DD): "); + String dateOfBirthString = sc.nextLine(); + System.out.println(); + + // Get and validate user's date of birth + LocalDate dateOfBirth = LocalDate.parse(dateOfBirthString); + if (dateOfBirth.isAfter(currentDate)) { + System.out.println("Date of birth must be before current date."); + } + // If user's date of birth is valid + else { + // Format and print user's date of birth + DateTimeFormatter mediumDate = + DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM); + System.out.println("Your date of birth is " + + mediumDate.format(dateOfBirth)); + + // Format and print the current date + System.out.println("The current date is " + + mediumDate.format(currentDate)); + + // Calculate and print the user's age + long age = ChronoUnit.YEARS.between(dateOfBirth, currentDate); + System.out.println("Your age is " + age); + } + + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql new file mode 100644 index 0000000..4e8f5c7 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step05.sql @@ -0,0 +1,3 @@ +SELECT * +FROM Products +WHERE ProductCode = 'java' \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql new file mode 100644 index 0000000..5ec9c98 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step06.sql @@ -0,0 +1,3 @@ +SELECT * +FROM Products +WHERE ProductCode = 'jscr' \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql new file mode 100644 index 0000000..76b1f2b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step07.sql @@ -0,0 +1,3 @@ +SELECT Description, Price +FROM Products +WHERE ProductCode = 'jscr' \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql new file mode 100644 index 0000000..0fec3e2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step08.sql @@ -0,0 +1,3 @@ +SELECT Description, Price +FROM Products +ORDER BY Price DESC \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql new file mode 100644 index 0000000..7f59c00 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step09.sql @@ -0,0 +1,2 @@ +INSERT INTO Products (ProductCode, Description, Price) +VALUES ('test', 'Murach''s Test', 99.99) diff --git a/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql new file mode 100644 index 0000000..c82e2d4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex1_SQLStatements_sol/Step10.sql @@ -0,0 +1,2 @@ +DELETE FROM Products +WHERE ProductCode = 'test' diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/build.xml b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/build.xml new file mode 100644 index 0000000..82526db --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch19_ex2_DBTester_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/manifest.mf b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..9c0bb0c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/build-impl.xml @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..307e8c6 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d2489a22 +build.xml.script.CRC32=85cf1c3d +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=1527db2a +nbproject/build-impl.xml.script.CRC32=8c25191b +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.properties new file mode 100644 index 0000000..d935ab2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.properties @@ -0,0 +1,9 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.xml b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.properties new file mode 100644 index 0000000..c9d39d3 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.properties @@ -0,0 +1,86 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch19_ex2_DBTester_sol +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch19_ex2_DBTester_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.sqlite-jdbc.jar=../../../db/sqlite-jdbc.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.sqlite-jdbc.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch19_ex2_DBTester_sol +main.class=DBTesterApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.xml new file mode 100644 index 0000000..9e05d00 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch19_ex2_DBTester_sol + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite new file mode 100644 index 0000000..c75d643 Binary files /dev/null and b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/products.sqlite differ diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java new file mode 100644 index 0000000..607df56 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/DBTesterApp.java @@ -0,0 +1,148 @@ +import java.sql.*; + +public class DBTesterApp { + + private static Connection connection; + + public static void main(String args[]) { + // open connection + try { + String dbUrl = "jdbc:sqlite:products.sqlite"; + connection = DriverManager.getConnection(dbUrl); + } catch (SQLException e) { + System.err.println(e); + return; + } + + // select data from database + printProducts(); + printFirstProduct(); + printProductByCode("jsp"); + + // modify data in the database + Product p = new Product("test", "Test Product", 49.50); + insertProduct(p); + printProducts(); + deleteProduct(p); + printProducts(); + + // close connection + try { + connection.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProducts() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + Product p; + + System.out.println("Product list:"); + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + p = new Product(code, description, price); + + printProduct(p); + } + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printFirstProduct() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + if (rs.next()) { + // code that uses column names + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + + System.out.println("First product:"); + printProduct(p); + System.out.println(); + } + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProductByCode(String productCode) { + try (PreparedStatement ps = connection.prepareStatement( + "SELECT * FROM Products WHERE ProductCode = ?")) { + ps.setString(1, productCode); + ResultSet rs = ps.executeQuery(); + + if (rs.next()) { + String code = rs.getString(1); + String description = rs.getString(2); + double price = rs.getDouble(3); + Product p = new Product(code, description, price); + + System.out.println("Product by code: " + productCode); + printProduct(p); + System.out.println(); + } + + rs.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void insertProduct(Product p) { + String insertProduct + = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + + try (PreparedStatement ps = connection.prepareStatement(insertProduct)) { + System.out.println("Insert test: "); + + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + + printProduct(p); + System.out.println(); + + } catch (SQLException e) { + System.out.println(e); + } + } + + private static void deleteProduct(Product p) { + String deleteProduct + = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + + try (PreparedStatement ps = connection.prepareStatement(deleteProduct)) { + System.out.println("Delete test: "); + + ps.setString(1, p.getCode()); + ps.executeUpdate(); + printProduct(p); + + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + // use this method to print a Product object on a single line + private static void printProduct(Product p) { + String productString + = StringUtil.padWithSpaces(p.getCode(), 12) + + StringUtil.padWithSpaces(p.getDescription(), 38) + + p.getFormattedPrice(); + + System.out.println(productString); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java new file mode 100644 index 0000000..22119c2 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/Product.java @@ -0,0 +1,67 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getFormattedPrice() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public boolean equals(Object object) { + if (object instanceof Product) { + Product product2 = (Product) object; + if (code.equals(product2.getCode()) + && description.equals(product2.getDescription()) + && price == product2.getPrice()) { + return true; + } + } + return false; + } + + public String toString() { + return "Code: " + code + "\n" + + "Description: " + description + "\n" + + "Price: " + this.getFormattedPrice() + "\n"; + } +} diff --git a/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java new file mode 100644 index 0000000..518cb2e --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex2_DBTester_sol/src/StringUtil.java @@ -0,0 +1,16 @@ + + +public class StringUtil { + + public static String padWithSpaces(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/build.xml b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/build.xml new file mode 100644 index 0000000..2b11d58 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch21_ProductManager. + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/manifest.mf b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbbuild.xml b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbbuild.xml new file mode 100644 index 0000000..4cb83d4 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbbuild.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch19_ex3_ProductManager_sol. + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/build-impl.xml b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/build-impl.xml new file mode 100644 index 0000000..b8e051b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/genfiles.properties b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/genfiles.properties new file mode 100644 index 0000000..5ba4b32 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +nbbuild.xml.data.CRC32=47ec1dce +nbbuild.xml.script.CRC32=81849c66 +nbbuild.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=47ec1dce +nbproject/build-impl.xml.script.CRC32=2a250d38 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/private/config.properties b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/private/private.properties b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.properties b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.properties new file mode 100644 index 0000000..e98beb9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.properties @@ -0,0 +1,93 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch19_ex3_ProductManager_sol +application.vendor=Joel Murach +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 +buildfile=nbbuild.xml +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch19_ex3_ProductManager_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch21_ProductMaint-DBTester=DBTester +file.reference.ch21_ProductMaint-ProductMaintenance=ProductMaintenance +file.reference.sqlite-jdbc.jar=../../../db/sqlite-jdbc.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.sqlite-jdbc.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch19_ex3_ProductManager_sol +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.xml b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.xml new file mode 100644 index 0000000..534bf6d --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch19_ex3_ProductManager_sol + + + + + + + diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite new file mode 100644 index 0000000..afbff3c Binary files /dev/null and b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/products.sqlite differ diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java new file mode 100644 index 0000000..9bb48e9 --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/Product.java @@ -0,0 +1,49 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java new file mode 100644 index 0000000..3eaf20c --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductDB.java @@ -0,0 +1,112 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + private static Product getFromRow(ResultSet rs) throws SQLException { + String code = rs.getString(1); + String description = rs.getString(2); + double price = rs.getDouble(3); + + Product product = new Product(code, description, price); + return product; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + ArrayList products = new ArrayList<>(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + Product p = getFromRow(rs); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + Product p = getFromRow(rs); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java new file mode 100644 index 0000000..379941b --- /dev/null +++ b/murach/netbeans/ex_solutions/ch19_ex3_ProductManager_sol/src/ProductManagerApp.java @@ -0,0 +1,95 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "update" -> updateProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void updateProduct() { + String code = Console.getString("Enter product code to update: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + product.setDescription(description); + product.setPrice(price); + + boolean success = ProductDB.update(product); + if (success) { + System.out.println(code + + " has been updated in the database.\n"); + } else { + System.out.println("Error! Unable to upldate product.\n"); + } + + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/build.xml b/murach/netbeans/ex_starts/ch01_ex1_Invoice/build.xml new file mode 100644 index 0000000..5ae258f --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch01_ex1_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch01_ex1_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..ee2bbcb --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..521e26b --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=329b5a7f +build.xml.script.CRC32=c2755c6f +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=329b5a7f +nbproject/build-impl.xml.script.CRC32=ef7d3dfa +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.properties new file mode 100644 index 0000000..93b7f06 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch01_ex1_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch01_ex1_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch01_ex1_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.xml new file mode 100644 index 0000000..21e7783 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch01_ex1_Invoice + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/build.xml b/murach/netbeans/ex_starts/ch01_ex2_TestScore/build.xml new file mode 100644 index 0000000..e27c414 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch01_ex2_TestScore. + + + diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/manifest.mf b/murach/netbeans/ex_starts/ch01_ex2_TestScore/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/build-impl.xml new file mode 100644 index 0000000..ccc8cb4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/genfiles.properties new file mode 100644 index 0000000..637edbf --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=85f68411 +build.xml.script.CRC32=aff916ef +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=85f68411 +nbproject/build-impl.xml.script.CRC32=363e3e44 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.properties b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.properties new file mode 100644 index 0000000..71edcd2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch01_ex2_TestScore.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch01_ex2_TestScore +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch01_ex2_TestScore +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.xml b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.xml new file mode 100644 index 0000000..76f9009 --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch01_ex2_TestScore + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java b/murach/netbeans/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..7d7b4ec --- /dev/null +++ b/murach/netbeans/ex_starts/ch01_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/build.xml b/murach/netbeans/ex_starts/ch02_ex1_Invoice/build.xml new file mode 100644 index 0000000..6296898 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_ex1_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch02_ex1_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..168e1eb --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..b4f4c76 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=ef309eeb +build.xml.script.CRC32=5ba65260 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=ef309eeb +nbproject/build-impl.xml.script.CRC32=5301837d +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.properties new file mode 100644 index 0000000..56f3598 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_ex1_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_ex1_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_ex1_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.xml new file mode 100644 index 0000000..37437d2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_ex1_Invoice + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/build.xml b/murach/netbeans/ex_starts/ch02_ex2_TestScore/build.xml new file mode 100644 index 0000000..c25ce3f --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_ex2_TestScore. + + + diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/manifest.mf b/murach/netbeans/ex_starts/ch02_ex2_TestScore/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/build-impl.xml new file mode 100644 index 0000000..9972ee1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/genfiles.properties new file mode 100644 index 0000000..75e6827 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0cd2100d +build.xml.script.CRC32=f9114edd +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=0cd2100d +nbproject/build-impl.xml.script.CRC32=95bad0fe +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.properties b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.properties new file mode 100644 index 0000000..4faa63e --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_ex2_TestScore.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_ex2_TestScore +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_ex2_TestScore +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.xml b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.xml new file mode 100644 index 0000000..930d806 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_ex2_TestScore + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java b/murach/netbeans/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..7d7b4ec --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore <= 100) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + } + + // display the score count, score total, and average score + double averageScore = (double) scoreTotal / scoreCount; + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/build.xml b/murach/netbeans/ex_starts/ch02_ex3_Invoice/build.xml new file mode 100644 index 0000000..0463179 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch02_ex3_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch02_ex3_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..8492da3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..55e4fab --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=bf7a39ec +build.xml.script.CRC32=a2946185 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=bf7a39ec +nbproject/build-impl.xml.script.CRC32=75a00be3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.properties new file mode 100644 index 0000000..0d6db54 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch02_ex3_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch02_ex3_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch02_ex3_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.xml new file mode 100644 index 0000000..221a11f --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch02_ex3_Invoice + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..2e91844 --- /dev/null +++ b/murach/netbeans/ex_starts/ch02_ex3_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + // welcome the user to the program + System.out.println("Welcome to the Invoice Total Calculator"); + System.out.println(); // print a blank line + + // create a Scanner object named sc + Scanner sc = new Scanner(System.in); + + // perform invoice calculations until choice isn't equal to "y" or "Y" + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the invoice subtotal from the user + System.out.print("Enter subtotal: "); + String input = sc.nextLine(); + double subtotal = Double.parseDouble(input); + + // calculate the discount amount and total + double discountPercent; + if (subtotal >= 200) { + discountPercent = .2; + } else if (subtotal >= 100) { + discountPercent = .1; + } else { + discountPercent = 0.0; + } + double discountAmount = subtotal * discountPercent; + double total = subtotal - discountAmount; + + // display the discount amount and total + String message = "Discount percent: " + discountPercent + "\n" + + "Discount amount: " + discountAmount + "\n" + + "Invoice total: " + total + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/build.xml b/murach/netbeans/ex_starts/ch03_ex1_MPG/build.xml new file mode 100644 index 0000000..0a37bcd --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch03_ex1_MPG. + + + diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/manifest.mf b/murach/netbeans/ex_starts/ch03_ex1_MPG/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/build-impl.xml new file mode 100644 index 0000000..052b11c --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/genfiles.properties new file mode 100644 index 0000000..7fdf23d --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=74feef26 +build.xml.script.CRC32=0bff49e4 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=74feef26 +nbproject/build-impl.xml.script.CRC32=6632de05 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.properties b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.properties new file mode 100644 index 0000000..b8f6cb4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch03_ex1_MPG.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch03_ex1_MPG +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch03_ex1_MPG +main.class=MPGApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.xml b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.xml new file mode 100644 index 0000000..9d635d4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch03_ex1_MPG + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex1_MPG/src/MPGApp.java b/murach/netbeans/ex_starts/ch03_ex1_MPG/src/MPGApp.java new file mode 100644 index 0000000..d5b8c5c --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex1_MPG/src/MPGApp.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class MPGApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Miles Per Gallon calculator"); + System.out.println(); // print a blank line + + Scanner sc = new Scanner(System.in); + String input; + + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter miles driven: "); + input = sc.nextLine(); + double miles = Double.parseDouble(input); + + System.out.print("Enter gallons of gas used: "); + input = sc.nextLine(); + double gallons = Double.parseDouble(input); + + double mpg = miles/gallons; + System.out.println("Miles per gallon is " + mpg + "."); + System.out.println(); + + System.out.print("Calculate another MPG? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + +} diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/build.xml b/murach/netbeans/ex_starts/ch03_ex2_TestScore/build.xml new file mode 100644 index 0000000..a82bc9e --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch03_ex2_TestScore. + + + diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/manifest.mf b/murach/netbeans/ex_starts/ch03_ex2_TestScore/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/build-impl.xml new file mode 100644 index 0000000..8dbca79 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/genfiles.properties new file mode 100644 index 0000000..120a1d5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c2e161c6 +build.xml.script.CRC32=cb497933 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=c2e161c6 +nbproject/build-impl.xml.script.CRC32=42167757 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.properties b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.properties new file mode 100644 index 0000000..71cc4fa --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch03_ex2_TestScore.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch03_ex2_TestScore +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch03_ex2_TestScore +main.class=TestScoreApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.xml b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.xml new file mode 100644 index 0000000..1a339f6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch03_ex2_TestScore + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java b/murach/netbeans/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java new file mode 100644 index 0000000..32c0c5e --- /dev/null +++ b/murach/netbeans/ex_starts/ch03_ex2_TestScore/src/TestScoreApp.java @@ -0,0 +1,45 @@ +import java.util.Scanner; + +public class TestScoreApp { + + public static void main(String[] args) { + // display operational messages + System.out.println("Enter test scores that range from 0 to 100."); + System.out.println("To end the program, enter 999."); + System.out.println(); // print a blank line + + // initialize variables and create a Scanner object + int scoreTotal = 0; + int scoreCount = 0; + int testScore = 0; + Scanner sc = new Scanner(System.in); + + // get a series of test scores from the user + while (testScore != 999) { + // get the input from the user + System.out.print("Enter score: "); + String input = sc.nextLine(); + testScore = Integer.parseInt(input); + + // accumulate score count and score total + if (testScore <= 100) { + scoreCount = scoreCount + 1; + scoreTotal = scoreTotal + testScore; + } + else if (testScore != 999) { + System.out.println("Invalid entry; not counted"); + } + } + + // display the score count, score total, and average score + double averageScore = 0.0; + if (scoreCount > 0) { + averageScore = (double) scoreTotal / scoreCount; + } + String message = "\n" + + "Score count: " + scoreCount + "\n" + + "Score total: " + scoreTotal + "\n" + + "Average score: " + averageScore + "\n"; + System.out.println(message); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/build.xml b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/build.xml new file mode 100644 index 0000000..9a424f9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex1_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..7db6cf3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..8349971 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=9973acac +build.xml.script.CRC32=e7ffe9f6 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=9973acac +nbproject/build-impl.xml.script.CRC32=c46905af +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..ed71e29 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex1_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex1_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex1_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..0688941 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex1_FutureValue + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..19ac4ed --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/build.xml b/murach/netbeans/ex_starts/ch04_ex2_Invoice/build.xml new file mode 100644 index 0000000..a7215fa --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex2_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch04_ex2_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..64c63dc --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..e2f9a52 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1ac16626 +build.xml.script.CRC32=db62e108 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=1ac16626 +nbproject/build-impl.xml.script.CRC32=c578b4e3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.properties new file mode 100644 index 0000000..5600eb1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex2_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex2_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex2_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.xml new file mode 100644 index 0000000..1f705e4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex2_Invoice + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..817cfae --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex2_Invoice/src/InvoiceApp.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/build.xml b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/build.xml new file mode 100644 index 0000000..788e5c0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex3_GuessNumber. + + + diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/manifest.mf b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/build-impl.xml new file mode 100644 index 0000000..3223279 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/genfiles.properties new file mode 100644 index 0000000..2fdd625 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c73d54b0 +build.xml.script.CRC32=4819520c +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=c73d54b0 +nbproject/build-impl.xml.script.CRC32=df44db84 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.properties b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.properties new file mode 100644 index 0000000..fe55d69 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex3_GuessNumber.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex3_GuessNumber +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex3_GuessNumber +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.xml b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.xml new file mode 100644 index 0000000..29b8b03 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex3_GuessNumber + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..49bc238 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex3_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + public static void main(String[] args) { + final int LIMIT = 10; + + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + LIMIT); + System.out.println(); + + // get a random number between 1 and the limit + double d = Math.random() * LIMIT; // d is >= 0.0 and < limit + int number = (int) d; // convert double to int + number++; // int is >= 1 and <= limit + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/build.xml b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/build.xml new file mode 100644 index 0000000..84d5264 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch04_ex4_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..4903b0e --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..4e4fa57 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=24fee751 +build.xml.script.CRC32=6058ca1c +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=24fee751 +nbproject/build-impl.xml.script.CRC32=2a7f2ee0 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..086a016 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch04_ex4_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch04_ex4_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch04_ex4_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..82237c7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch04_ex4_FutureValue + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..19ac4ed --- /dev/null +++ b/murach/netbeans/ex_starts/ch04_ex4_FutureValue/src/FutureValueApp.java @@ -0,0 +1,44 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("The Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter monthly investment: "); + double monthlyInvestment = Double.parseDouble(sc.nextLine()); + System.out.print("Enter yearly interest rate: "); + double interestRate = Double.parseDouble(sc.nextLine()); + System.out.print("Enter number of years: "); + int years = Integer.parseInt(sc.nextLine()); + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate / 12 / 100; + int months = years * 12; + + // use a for loop to calculate the future value + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + + // format the result and display it to the user + NumberFormat currency = NumberFormat.getCurrencyInstance(); + System.out.println("Future value: " + + currency.format(futureValue)); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/build.xml b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/build.xml new file mode 100644 index 0000000..4b16378 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_ex1_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..eb6d733 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..f34189c --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=967f2db0 +build.xml.script.CRC32=543ff521 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=967f2db0 +nbproject/build-impl.xml.script.CRC32=3ce22bef +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..a9defba --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_ex1_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_ex1_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_ex1_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..874e259 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_ex1_FutureValue + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..b47efba --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,107 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // print the results + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + private static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + private static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + private static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/build.xml b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/build.xml new file mode 100644 index 0000000..edd25bf --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch05_ex2_GuessNumber. + + + diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/manifest.mf b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/build-impl.xml new file mode 100644 index 0000000..439b929 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/genfiles.properties new file mode 100644 index 0000000..dbd644d --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=3587941f +build.xml.script.CRC32=bd48baac +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=3587941f +nbproject/build-impl.xml.script.CRC32=11cb5787 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.properties b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.properties new file mode 100644 index 0000000..601d0d4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch05_ex2_GuessNumber.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch05_ex2_GuessNumber +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch05_ex2_GuessNumber +main.class=GuessNumberApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.xml b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.xml new file mode 100644 index 0000000..fae21ce --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch05_ex2_GuessNumber + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java new file mode 100644 index 0000000..2669fc1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch05_ex2_GuessNumber/src/GuessNumberApp.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class GuessNumberApp { + + private static void displayWelcome(int limit) { + System.out.println("Guess the number!"); + System.out.println("I'm thinking of a number from 1 to " + limit); + System.out.println(); + } + + public static int getRandomInt(int limit) { + double d = Math.random() * limit; // d is >= 0.0 and < limit + int i = (int) d; // convert double to int + i++; // int is >= 1 and <= limit + return i; + } + + public static void main(String[] args) { + final int LIMIT = 10; + + displayWelcome(LIMIT); + int number = getRandomInt(LIMIT); + + Scanner sc = new Scanner(System.in); + int count = 1; + while (true) { + System.out.print("Your guess: "); + int guess = Integer.parseInt(sc.nextLine()); + + if (guess < 1 || guess > LIMIT) { + System.out.println("Invalid guess. Try again."); + continue; + } + + if (guess < number) { + System.out.println("Too low."); + } else if (guess > number) { + System.out.println("Too high."); + } else { + System.out.println("You guessed it in " + + count + " tries.\n"); + break; + } + count++; + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/build.xml b/murach/netbeans/ex_starts/ch06_ex1_Invoice/build.xml new file mode 100644 index 0000000..ba398eb --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch06_ex1_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch06_ex1_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..c2c048b --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..769b99b --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=af0b94a5 +build.xml.script.CRC32=5decbc35 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=af0b94a5 +nbproject/build-impl.xml.script.CRC32=27212cc8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.properties new file mode 100644 index 0000000..71cddc3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch06_ex1_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch06_ex1_Invoice +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch06_ex1_Invoice +main.class=InvoiceApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.xml new file mode 100644 index 0000000..2eebee4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch06_ex1_Invoice + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..933c702 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,60 @@ +import java.text.NumberFormat; +import java.util.Scanner; + +public class InvoiceApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String choice = "y"; + + while (!choice.equalsIgnoreCase("n")) { + // get the input from the user + System.out.print("Enter customer type (r/c): "); + String customerType = sc.nextLine(); + + System.out.print("Enter subtotal: "); + double subtotal = Double.parseDouble(sc.nextLine()); + + // get the discount percent + double discountPercent = switch(customerType) { + case "r", "R" -> { + if (subtotal >= 250) { + yield .2; + } else if (subtotal >= 100 && subtotal < 250) { + yield .1; + } else { + yield 0.0; + } + } + case "c", "C" -> { + if (subtotal >= 250) { + yield .3; + } else { + yield .2; + } + } + default -> .1; + }; + + // calculate the discount amount and round to 2 decimals + double discountAmount = subtotal * discountPercent; + discountAmount = Math.ceil(discountAmount * 100) / 100; + + // calculate the total + double total = subtotal - discountAmount; + + // format and display the results + NumberFormat currency = NumberFormat.getCurrencyInstance(); + NumberFormat percent = NumberFormat.getPercentInstance(); + System.out.println( + "Discount percent: " + percent.format(discountPercent) + "\n" + + "Discount amount: " + currency.format(discountAmount) + "\n" + + "Total: " + currency.format(total) + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/build.xml b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/build.xml new file mode 100644 index 0000000..6c9d206 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch06_ex2_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..6b4ef94 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..9fe57e4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5ac16a00 +build.xml.script.CRC32=90bcca80 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=5ac16a00 +nbproject/build-impl.xml.script.CRC32=b403b9ab +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..1d99936 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch06_ex2_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch06_ex2_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch06_ex2_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..1ed571a --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch06_ex2_FutureValue + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..712fb89 --- /dev/null +++ b/murach/netbeans/ex_starts/ch06_ex2_FutureValue/src/FutureValueApp.java @@ -0,0 +1,111 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getdouble(sc, prompt) + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 0; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/build.xml b/murach/netbeans/ex_starts/ch07_ex1_Product/build.xml new file mode 100644 index 0000000..b13c830 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex1_Product. + + + diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/manifest.mf b/murach/netbeans/ex_starts/ch07_ex1_Product/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/build-impl.xml new file mode 100644 index 0000000..1dd3206 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/genfiles.properties new file mode 100644 index 0000000..8c03896 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=40963b86 +build.xml.script.CRC32=be85f2b0 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=40963b86 +nbproject/build-impl.xml.script.CRC32=588f9546 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.properties b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.properties new file mode 100644 index 0000000..413f4f8 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex1_Product.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex1_Product +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex1_Product +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.xml b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.xml new file mode 100644 index 0000000..2364c93 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex1_Product + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/src/Product.java b/murach/netbeans/ex_starts/ch07_ex1_Product/src/Product.java new file mode 100644 index 0000000..51e57f4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/src/Product.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductApp.java b/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductApp.java new file mode 100644 index 0000000..b7a9d39 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductApp.java @@ -0,0 +1,34 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // display 1 or more products + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product product = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + System.out.println("SELECTED PRODUCT"); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println(); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductDB.java b/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductDB.java new file mode 100644 index 0000000..a039657 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex1_Product/src/ProductDB.java @@ -0,0 +1,32 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } + else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } + else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } + else { + product.setDescription("Unknown"); + } + + return product; + } +} diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/build.xml b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/build.xml new file mode 100644 index 0000000..21925bc --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex2_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..acb8b03 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..47be663 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=55cdeb1c +build.xml.script.CRC32=237cd657 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=55cdeb1c +nbproject/build-impl.xml.script.CRC32=4c8897eb +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..8815eec --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex2_FutureValue.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex2_FutureValue +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex2_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..c5fa755 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex2_FutureValue + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..34c78c4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex2_FutureValue/src/FutureValueApp.java @@ -0,0 +1,111 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class FutureValueApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Future Value Calculator\n"); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = getDouble(sc, + "Enter monthly investment: ", 0, 1000); + double interestRate = getDouble(sc, + "Enter yearly interest rate: ", 0, 30); + int years = getInt(sc, + "Enter number of years: ", 0, 100); + System.out.println(); + + // calculate the future value + double futureValue = calculateFutureValue( + monthlyInvestment, interestRate, years); + + // get the currency and percent formatters + NumberFormat c = NumberFormat.getCurrencyInstance(); + NumberFormat p = NumberFormat.getPercentInstance(); + p.setMinimumFractionDigits(1); + + // format the result as a single string + String results + = "Monthly investment: " + c.format(monthlyInvestment) + "\n" + + "Yearly interest rate: " + p.format(interestRate / 100) + "\n" + + "Number of years: " + years + "\n" + + "Future value: " + c.format(futureValue) + "\n"; + + // print the results + System.out.println("FORMATTED RESULTS"); + System.out.println(results); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } + + public static double getDouble(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal value."); + } + } + } + + public static double getDouble(Scanner sc, String prompt, + double min, double max) { + while (true) { + double value = getDouble(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static int getInt(Scanner sc, String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(Scanner sc, String prompt, + int min, int max) { + while (true) { + int value = getInt(sc, prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double calculateFutureValue(double monthlyInvestment, + double interestRate, int years) { + + // convert yearly values to monthly values + double monthlyInterestRate = interestRate/12/100; + int months = years * 12; + + double futureValue = 0.0; + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/build.xml b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/build.xml new file mode 100644 index 0000000..a20b55e --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch07_ex3_AreaAndPerimeter. + + + diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/manifest.mf b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/build-impl.xml new file mode 100644 index 0000000..5482a63 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/genfiles.properties new file mode 100644 index 0000000..6a53e1a --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=926fc2e9 +build.xml.script.CRC32=a8a340f5 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=926fc2e9 +nbproject/build-impl.xml.script.CRC32=756096a1 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.properties b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.properties new file mode 100644 index 0000000..e0a30e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch07_ex3_AreaAndPerimeter.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch07_ex3_AreaAndPerimeter +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch07_ex3_AreaAndPerimeter +main.class=AreaAndPerimeterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.xml b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.xml new file mode 100644 index 0000000..e3fb751 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch07_ex3_AreaAndPerimeter + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java new file mode 100644 index 0000000..f3e21a4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch07_ex3_AreaAndPerimeter/src/AreaAndPerimeterApp.java @@ -0,0 +1,39 @@ +import java.util.Scanner; +import java.text.NumberFormat; + +public class AreaAndPerimeterApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Area and Perimeter Calculator"); + System.out.println(); + + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get input from user + System.out.print("Enter length: "); + double length = Double.parseDouble(sc.nextLine()); + + System.out.print("Enter width: "); + double width = Double.parseDouble(sc.nextLine()); + + // calculate total + double area = width * length; + double perimeter = 2 * width + 2 * length; + + // format and display output + NumberFormat number = NumberFormat.getNumberInstance(); + number.setMinimumFractionDigits(3); + String message = + "Area: " + number.format(area) + "\n" + + "Perimeter: " + number.format(perimeter) + "\n"; + System.out.println(message); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + System.out.println("Bye!"); + } +} diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/build.xml b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/build.xml new file mode 100644 index 0000000..64bf2a2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex1_MonthSales. + + + diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/manifest.mf b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/build-impl.xml new file mode 100644 index 0000000..6a940ac --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/genfiles.properties new file mode 100644 index 0000000..50a3af7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=9d0a1195 +build.xml.script.CRC32=7db18044 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=9d0a1195 +nbproject/build-impl.xml.script.CRC32=9b6261d3 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.properties b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.properties new file mode 100644 index 0000000..926f50c --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex1_MonthSales.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex1_MonthSales +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex1_MonthSales +main.class=MonthSalesApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.xml b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.xml new file mode 100644 index 0000000..aa3cf1f --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex1_MonthSales + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/Console.java b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/Console.java new file mode 100644 index 0000000..97c32f2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/Console.java @@ -0,0 +1,65 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java new file mode 100644 index 0000000..72c4dd9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex1_MonthSales/src/MonthSalesApp.java @@ -0,0 +1,41 @@ +import java.text.NumberFormat; + +public class MonthSalesApp { + + public static void main(String[] args) { + System.out.println("Monthly Sales\n"); + + // declare monthNames and monthSales arrays + + + // get currency formatting + NumberFormat currency = NumberFormat.getCurrencyInstance(); + + // get one or more months + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + int monthNumber = Console.getInt("Enter month number: "); + + // validate input + if (monthNumber < 1 || monthNumber > 12) { + Console.displayLine("Invalid month number. Try again."); + continue; + } + + // get the index number for the month + // and display the month name and sales + + + // check if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + Console.displayLine(); + } + + // display the total sales for the year + + + Console.displayLine(); + } + +} diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/build.xml b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/build.xml new file mode 100644 index 0000000..70be9d8 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex2_CardDeck. + + + diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/manifest.mf b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/build-impl.xml new file mode 100644 index 0000000..0f8c90c --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/genfiles.properties new file mode 100644 index 0000000..a2e59ac --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=156861e4 +build.xml.script.CRC32=ad1193fd +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=156861e4 +nbproject/build-impl.xml.script.CRC32=52cdfcda +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.properties b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.properties new file mode 100644 index 0000000..6cc32d7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex2_CardDeck.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex2_CardDeck +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex2_CardDeck +main.class=CardDeckApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.xml b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.xml new file mode 100644 index 0000000..9b580ac --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex2_CardDeck + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java new file mode 100644 index 0000000..2ad0f67 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex2_CardDeck/src/CardDeckApp.java @@ -0,0 +1,38 @@ +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] deck = new String[52]; + // add code that creates deck here + return deck; + } + + private static void displayCards(String[] cards) { + // add code that displays cards here + } + + private static void shuffleDeck(String[] deck) { + int randomIndex = (int) (Math.random() * deck.length-1); + + // add code that shuffles the deck here + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = new String[count]; + return hand; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/build.xml b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/build.xml new file mode 100644 index 0000000..ef82681 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch08_ex3_CardDeck. + + + diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/manifest.mf b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/build-impl.xml new file mode 100644 index 0000000..7b39fec --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/genfiles.properties new file mode 100644 index 0000000..14c7c64 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5a720e66 +build.xml.script.CRC32=650a653e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=5a720e66 +nbproject/build-impl.xml.script.CRC32=52813e9e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.properties b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.properties new file mode 100644 index 0000000..3978663 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch08_ex3_CardDeck.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch08_ex3_CardDeck +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch08_ex3_CardDeck +main.class=CardDeckApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.xml b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.xml new file mode 100644 index 0000000..db3eaf3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch08_ex3_CardDeck + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java new file mode 100644 index 0000000..b76a93e --- /dev/null +++ b/murach/netbeans/ex_starts/ch08_ex3_CardDeck/src/CardDeckApp.java @@ -0,0 +1,57 @@ +import java.util.Arrays; + +public class CardDeckApp { + + public static void main(String[] args) { + System.out.println("DECK"); + String[] deck = getDeck(); + displayCards(deck); + + System.out.println("SHUFFLED DECK"); + shuffleDeck(deck); + displayCards(deck); + + int count = 2; + System.out.println("HAND OF " + count + " CARDS"); + String[] hand = dealCards(deck, count); + displayCards(hand); + } + + private static String[] getDeck() { + String[] suits = {"Spades", "Hearts", "Diamonds", "Clubs"}; + String[] ranks = {"Ace", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "Jack", "Queen", "King"}; + + String[] deck = new String[52]; + int i = 0; + for (String suit : suits) { + for (String rank : ranks) { + deck[i] = rank + " of " + suit; + i++; + } + } + return deck; + } + + private static void displayCards(String[] cards) { + System.out.print("|"); + for (String card : cards) { + System.out.print(card + "|"); + } + System.out.println(); + } + + private static void shuffleDeck(String[] deck) { + for (int i = 0; i < deck.length; i++) { + String savedCard = deck[i]; + int randomIndex = (int) (Math.random() * deck.length-1); + deck[i] = deck[randomIndex]; + deck[randomIndex] = savedCard; + } + } + + private static String[] dealCards(String[] deck, int count) { + String[] hand = Arrays.copyOfRange(deck, 0, count); + return hand; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/build.xml b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/build.xml new file mode 100644 index 0000000..df9cba1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex1_CustomerManager. + + + diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/customers.txt b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/customers.txt new file mode 100644 index 0000000..6419de1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/customers.txt @@ -0,0 +1,3 @@ +Thomas Willliams tomwilliams@gmail.com +Jane Adams janeadams@yahoo.com +Robert Rodriguez robertrodriguez@sbcglobal.net diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/manifest.mf b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/build-impl.xml new file mode 100644 index 0000000..7753e9a --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/genfiles.properties new file mode 100644 index 0000000..883ccd5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=084ba8b0 +build.xml.script.CRC32=e6612bae +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=084ba8b0 +nbproject/build-impl.xml.script.CRC32=738f404e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.xml new file mode 100644 index 0000000..cd3e03d --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/private/private.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.properties b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.properties new file mode 100644 index 0000000..99c5ca0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.properties @@ -0,0 +1,88 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch09_ex1_CustomerManager +application.vendor=Anne +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ex1_CustomerManager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ex1_CustomerManager +main.class=CustomerManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.xml b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.xml new file mode 100644 index 0000000..e3ce05a --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex1_CustomerManager + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Console.java b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Customer.java b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Customer.java new file mode 100644 index 0000000..ec622e7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/Customer.java @@ -0,0 +1,44 @@ +public class Customer { + + private String firstName; + private String lastName; + private String email; + + public Customer() { + this("", "", ""); + } + + public Customer(String firstName, String lastName, String email) { + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getFirstName() { + return firstName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getLastName() { + return lastName; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEmail() { + return email; + } + + public String getName() { + return firstName + " " + lastName; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java new file mode 100644 index 0000000..f184c72 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerDB.java @@ -0,0 +1,20 @@ +import java.util.ArrayList; + +public final class CustomerDB { + + private static final String FILENAME = "customers.txt"; + private static final String COL_SEP = "\t"; + + public static ArrayList getAll() { + var customers = new ArrayList(); + + // load the array list with Customer objects created from + // the data in the file + + return customers; + } + + public static void saveAll(ArrayList customers) { + // save the Customer objects in the array list to the file + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java new file mode 100644 index 0000000..c0437cb --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex1_CustomerManager/src/CustomerManagerApp.java @@ -0,0 +1,86 @@ +import java.util.ArrayList; + +public class CustomerManagerApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Manager\n"); + + // create the db object and get the list of customers + ArrayList customers = CustomerDB.getAll(); + + // display the command menu + displayMenu(); + + // perform 1 or more actions + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + // get the input from the user + action = Console.getString("Enter a command: "); + System.out.println(); + + if (action.equalsIgnoreCase("list")) { + displayAll(customers); + } else if (action.equalsIgnoreCase("add")) { + addCustomer(customers); + } else if (action.equalsIgnoreCase("del") || + action.equalsIgnoreCase("delete")) { + deleteCustomer(customers); + } else if (action.equalsIgnoreCase("help") || + action.equalsIgnoreCase("menu")) { + displayMenu(); + } else if (action.equalsIgnoreCase("exit")) { + System.out.println("Bye.\n"); + } else { + System.out.println("Error! Not a valid command.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all customers"); + System.out.println("add - Add a customer"); + System.out.println("del - Delete a customer"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList customers) { + System.out.println("CUSTOMER LIST"); + + String format = "%-27s%-40s%n"; + for (Customer c : customers) { + System.out.printf(format, c.getName(), c.getEmail()); + } + System.out.println(); + } + + public static void addCustomer(ArrayList customers) { + String firstName = Console.getString("Enter first name: "); + String lastName = Console.getString("Enter last name: "); + String email = Console.getString("Enter customer email: "); + + Customer customer = new Customer(firstName, lastName, email); + customers.add(customer); + CustomerDB.saveAll(customers); + + System.out.println(customer.getName() + " has been added.\n"); + } + + public static void deleteCustomer(ArrayList customers) { + String email = Console.getString("Enter email to delete: "); + + for (Customer c : customers) { + if (c.getEmail().equals(email)) { + customers.remove(c); + CustomerDB.saveAll(customers); // save list to file + System.out.println(c.getName() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No customer matches that email.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/build.xml b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/build.xml new file mode 100644 index 0000000..acbe91e --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex2_ProductManager. + + + diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/manifest.mf b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/build-impl.xml new file mode 100644 index 0000000..463ad6b --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/genfiles.properties new file mode 100644 index 0000000..b1d1498 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5e9b307d +build.xml.script.CRC32=354663e7 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=5e9b307d +nbproject/build-impl.xml.script.CRC32=5b025660 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.properties b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.properties new file mode 100644 index 0000000..931b1dc --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.properties @@ -0,0 +1,84 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch09_ex2_ProductManager +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ex2_ProductManager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch19_ProductMaintenance-src=src +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ex2_ProductManager +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +src.dir=${file.reference.ch19_ProductMaintenance-src} diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.xml b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.xml new file mode 100644 index 0000000..27176b6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex2_ProductManager + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/products.txt b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/products.txt new file mode 100644 index 0000000..dbb2c95 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/products.txt @@ -0,0 +1,7 @@ +java Murach's Java Programming 57.5 +jsp Murach's Java Servlets and JSP 57.5 +mysql Murach's MySQL 54.5 +orac Murach's Oracle and PL/SQL 54.5 +andr Murach's Android Programming 57.5 +html Murach's HTML and CSS 54.5 +jscr Murach's JavaScript and jQuery 54.5 diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Console.java b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Product.java b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Product.java new file mode 100644 index 0000000..208adbe --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/Product.java @@ -0,0 +1,47 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..71126ae --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductDB.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.util.ArrayList; + +public class ProductDB { + private static final String FILENAME = "products.txt"; + private static final String COLUMN_SEP = "\t"; + + public static ArrayList getAll() { + var products = new ArrayList(); + try (BufferedReader in = new BufferedReader( + new FileReader(FILENAME))) { + + String line = in.readLine(); + while (line != null) { + String[] columns = line.split(COLUMN_SEP); + String code = columns[0]; + String description = columns[1]; + String price = columns[2]; + + Product p = new Product( + code, description, Double.parseDouble(price)); + products.add(p); + + line = in.readLine(); + } + return products; + } + catch (FileNotFoundException e) { + System.out.println(FILENAME + " doesn't exist."); + return null; + } + catch (IOException e) { + System.out.println(e); + return null; + } + } + + public static void saveAll(ArrayList products) { + try (PrintWriter out = new PrintWriter( + new BufferedWriter( + new FileWriter(FILENAME)))) { + + // write all products to the file + for (Product p : products) { + out.print(p.getCode() + COLUMN_SEP); + out.print(p.getDescription() + COLUMN_SEP); + out.println(p.getPrice()); + } + } + catch (IOException e) { + System.out.println(e); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..06cac58 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex2_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,75 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + // read list of products from file + var products = ProductDB.getAll(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(products); + case "add" -> addProduct(products); + case "del", "delete" -> deleteProduct(products); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll(ArrayList products) { + System.out.println("PRODUCT LIST"); + + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product p = new Product(code, description, price); + products.add(p); + ProductDB.saveAll(products); // save product list to file + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct(ArrayList products) { + String code = Console.getString("Enter product code: "); + + for (Product p : products) { + if (p.getCode().equals(code)) { + products.remove(p); + ProductDB.saveAll(products); // save product list to file + System.out.println(p.getDescription() + + " has been deleted.\n"); + return; + } + } + + System.out.println("No product matches that code.\n"); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/build.xml b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/build.xml new file mode 100644 index 0000000..f97fbda --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch09_ex3_ExceptionTester. + + + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/manifest.mf b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml new file mode 100644 index 0000000..e2abc48 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml~ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml~ new file mode 100644 index 0000000..ff1fa8c --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/build-impl.xml~ @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/genfiles.properties new file mode 100644 index 0000000..d3083ef --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f2b3be4b +build.xml.script.CRC32=095dc30e +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=f2b3be4b +nbproject/build-impl.xml.script.CRC32=8f1e5084 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.properties new file mode 100644 index 0000000..e706f39 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.properties @@ -0,0 +1,10 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +file.reference.ch13-src=C:\\Users\\Joel\\Dropbox\\Java 6ed\\java\\netbeans\\ex_starts\\ch09_ex3_ExceptionTester\\src +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.xml new file mode 100644 index 0000000..cd3e03d --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/private/private.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.properties b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.properties new file mode 100644 index 0000000..2d9e39d --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.properties @@ -0,0 +1,85 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch09_ex3_ExceptionTester +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch09_ex3_ExceptionTester.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch13-src=src +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch09_ex3_ExceptionTester +main.class=ExceptionTesterApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.xml b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.xml new file mode 100644 index 0000000..f525e4c --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch09_ex3_ExceptionTester + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java new file mode 100644 index 0000000..9689a01 --- /dev/null +++ b/murach/netbeans/ex_starts/ch09_ex3_ExceptionTester/src/ExceptionTesterApp.java @@ -0,0 +1,29 @@ +import java.io.*; + +public class ExceptionTesterApp { + + public static void main(String[] args) { + System.err.println("In main: calling method1."); + method1(); + System.err.println("In main: returned from method1."); + } + + public static void method1() { + System.err.println("\tIn method1: calling method2."); + method2(); + System.err.println("\tIn method1: returned from method2."); + } + + public static void method2() { + System.err.println("\t\tIn method2: calling method3."); + method3(); + System.err.println("\t\tIn method2: returned from method3."); + } + + public static void method3() { + System.err.println("\t\t\tIn method3: Entering."); + + //Add code to throw an exception here. + System.err.println("\t\t\tIn method3: Exiting."); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/build.xml b/murach/netbeans/ex_starts/ch10_ex1_Product/build.xml new file mode 100644 index 0000000..d10e1c7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex1_Product. + + + diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/manifest.mf b/murach/netbeans/ex_starts/ch10_ex1_Product/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/build-impl.xml new file mode 100644 index 0000000..ef8f2e6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/genfiles.properties new file mode 100644 index 0000000..42b4847 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=8f93a12b +build.xml.script.CRC32=5101a89f +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=8f93a12b +nbproject/build-impl.xml.script.CRC32=be0c5d9f +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.properties b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.properties new file mode 100644 index 0000000..b3a1eb4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex1_Product.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex1_Product +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex1_Product +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.xml b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.xml new file mode 100644 index 0000000..0910c35 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex1_Product + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/src/Book.java b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/src/Product.java b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Product.java new file mode 100644 index 0000000..bb7f8e7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductApp.java b/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductDB.java b/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductDB.java new file mode 100644 index 0000000..caeb3b3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} diff --git a/murach/netbeans/ex_starts/ch10_ex1_Product/src/Software.java b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex1_Product/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/build.xml b/murach/netbeans/ex_starts/ch10_ex2_Product/build.xml new file mode 100644 index 0000000..d06e917 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex2_Product. + + + diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/manifest.mf b/murach/netbeans/ex_starts/ch10_ex2_Product/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/build-impl.xml new file mode 100644 index 0000000..a1f8900 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/genfiles.properties new file mode 100644 index 0000000..1afc08e --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1a44d68f +build.xml.script.CRC32=391201a8 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=1a44d68f +nbproject/build-impl.xml.script.CRC32=8bfd114e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.properties b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.properties new file mode 100644 index 0000000..1389c1c --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex2_Product.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex2_Product +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex2_Product +main.class=ProductApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.xml b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.xml new file mode 100644 index 0000000..5c98cba --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex2_Product + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/src/Book.java b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Book.java new file mode 100644 index 0000000..7f1fb93 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Book.java @@ -0,0 +1,23 @@ +public class Book extends Product { + + private String author; + + public Book() { + super(); + author = ""; + count++; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getAuthor() { + return author; + } + + @Override + public String toString() { + return super.toString() + " by " + author; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/src/Product.java b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Product.java new file mode 100644 index 0000000..95636e7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + protected static int count = 0; + + public Product() { + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + @Override + public String toString() { + return description; + } + + public static int getCount() { + return count; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductApp.java b/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductApp.java new file mode 100644 index 0000000..5966fc5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductApp.java @@ -0,0 +1,38 @@ +import java.util.Scanner; + +public class ProductApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Product Viewer"); + System.out.println(); + + // perform 1 or more selections + Scanner sc = new Scanner(System.in); + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + System.out.print("Enter product code: "); + String productCode = sc.nextLine(); // read the product code + + // get the Product object + Product p = ProductDB.getProduct(productCode); + + // display the output + System.out.println(); + if (p != null) { + System.out.println("Description: " + p.toString()); + System.out.println("Price: " + p.getPriceFormatted()); + } else { + System.out.println("No product matches this product code."); + } + + System.out.println(); + System.out.println("Product count: " + Product.getCount() + "\n"); + + // see if the user wants to continue + System.out.print("Continue? (y/n): "); + choice = sc.nextLine(); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductDB.java b/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductDB.java new file mode 100644 index 0000000..944af49 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/src/ProductDB.java @@ -0,0 +1,42 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product data + + Product p = null; + + if (productCode.equalsIgnoreCase("java") + || productCode.equalsIgnoreCase("jsp") + || productCode.equalsIgnoreCase("mysql")) { + Book b = new Book(); + if (productCode.equalsIgnoreCase("java")) { + b.setCode(productCode); + b.setDescription("Murach's Java Programming"); + b.setPrice(57.50); + b.setAuthor("Joel Murach"); + } else if (productCode.equalsIgnoreCase("jsp")) { + b.setCode(productCode); + b.setDescription("Murach's Java Servlets and JSP"); + b.setPrice(57.50); + b.setAuthor("Mike Urban"); + } else if (productCode.equalsIgnoreCase("mysql")) { + b.setCode(productCode); + b.setDescription("Murach's MySQL"); + b.setPrice(54.50); + b.setAuthor("Joel Murach"); + } + p = b; // set Product object equal to the Book object + } else if (productCode.equalsIgnoreCase("netbeans")) { + Software s = new Software(); + s.setCode("netbeans"); + s.setDescription("NetBeans"); + s.setPrice(0.00); + s.setVersion("8.2"); + p = s; // set Product object equal to the Software object + } + return p; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex2_Product/src/Software.java b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Software.java new file mode 100644 index 0000000..d56eceb --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex2_Product/src/Software.java @@ -0,0 +1,23 @@ +public class Software extends Product { + + private String version; + + public Software() { + super(); + version = ""; + count++; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getVersion() { + return version; + } + + @Override + public String toString() { + return super.toString() + " " + version; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/build.xml b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/build.xml new file mode 100644 index 0000000..5f1636e --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch10_ex3_EqualsTest. + + + diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/manifest.mf b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/build-impl.xml new file mode 100644 index 0000000..af1d29c --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/genfiles.properties new file mode 100644 index 0000000..84fed30 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=5a27f8be +build.xml.script.CRC32=f67b53c2 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=5a27f8be +nbproject/build-impl.xml.script.CRC32=bf32cd1d +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.properties b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.properties new file mode 100644 index 0000000..1726757 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch10_ex3_EqualsTest +application.vendor=maryd +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch10_ex3_EqualsTest.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch10_ex3_EqualsTest +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs=\ --enable-preview +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch10_ex3_EqualsTest +main.class=EqualsTestApp +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=\ --enable-preview +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.xml b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.xml new file mode 100644 index 0000000..07f5ece --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch10_ex3_EqualsTest + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java new file mode 100644 index 0000000..94af252 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/EqualsTestApp.java @@ -0,0 +1,41 @@ +public class EqualsTestApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Equals Tester\n"); + + //Both variables refer to different objects that store the same data + Product product1 = new Product("java", "Murach's Java Programming", 57.5); + Product product2 = new Product("java", "Murach's Java Programming", 57.5); + // test equals() method + if (product1.equals(product2)) { + System.out.println("The Product class is comparing data."); + } else { + System.out.println("The Product class is comparing references."); + } + // test hashCode() method + if (product1.hashCode() == product2.hashCode()) { + System.out.println("The Product object hash codes match."); + } else { + System.out.println("The Product object hash codes are different."); + } + System.out.println(); + + //Both variables refer to different objects that store the same data + LineItem li1 = new LineItem(product1, 1); + LineItem li2 = new LineItem(product2, 1); + // test equals() method + if (li1.equals(li2)) { + System.out.println("The LineItem class is comparing data."); + } else { + System.out.println("The LineItem class is comparing references."); + } + // test hashCode() method + if (li1.hashCode() == li2.hashCode()) { + System.out.println("The LineItem object hash codes match."); + } else { + System.out.println("The LineItem object hash codes are different."); + } + System.out.println(); + } + +} diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java new file mode 100644 index 0000000..1811f13 --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/LineItem.java @@ -0,0 +1,43 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + + public LineItem() { + product = new Product(); + quantity = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public double getTotal() { + double total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/Product.java b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/Product.java new file mode 100644 index 0000000..81ad31a --- /dev/null +++ b/murach/netbeans/ex_starts/ch10_ex3_EqualsTest/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/build.xml b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/build.xml new file mode 100644 index 0000000..84bbdaa --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex1_DisplayableTest. + + + diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/manifest.mf b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/build-impl.xml new file mode 100644 index 0000000..86da0b8 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/genfiles.properties new file mode 100644 index 0000000..21b8044 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=10302b6d +build.xml.script.CRC32=53b83a9f +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=10302b6d +nbproject/build-impl.xml.script.CRC32=f1b99b85 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.properties b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.properties new file mode 100644 index 0000000..848d075 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex1_DisplayableTest.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex1_DisplayableTest +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex1_DisplayableTest +main.class=DisplayableTestApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.xml b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.xml new file mode 100644 index 0000000..56be289 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex1_DisplayableTest + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java new file mode 100644 index 0000000..67b1dae --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Displayable.java @@ -0,0 +1,3 @@ +public interface Displayable { + String getDisplayText(); +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java new file mode 100644 index 0000000..62ebc63 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/DisplayableTestApp.java @@ -0,0 +1,19 @@ +public class DisplayableTestApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Displayable Test application\n"); + + Employee e = new Employee(2, "Smith", "John"); + // TODO: add code that passes this object to the display method below + + Product p = new Product("java", "Murach's Java Programming", 57.50); + // TODO: add code that passes this object to the display method below + + System.out.println(); + } + + private static void display(Displayable d) { + System.out.println(d.getDisplayText()); + } + +} diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java new file mode 100644 index 0000000..fba5b3b --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Employee.java @@ -0,0 +1,12 @@ +public class Employee { + + private int department; + private String firstName; + private String lastName; + + public Employee(int department, String lastName, String firstName) { + this.department = department; + this.lastName = lastName; + this.firstName = firstName; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Product.java b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Product.java new file mode 100644 index 0000000..d3b95a2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex1_DisplayableTest/src/Product.java @@ -0,0 +1,49 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/build.xml b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/build.xml new file mode 100644 index 0000000..1b16e85 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex2_Enumeration. + + + diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/manifest.mf b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/build-impl.xml new file mode 100644 index 0000000..477322b --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/genfiles.properties new file mode 100644 index 0000000..3834d08 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=6966ef5d +build.xml.script.CRC32=e9a7fcd0 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=6966ef5d +nbproject/build-impl.xml.script.CRC32=7c154229 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.properties b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.properties new file mode 100644 index 0000000..0e2737e --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex2_Enumeration.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex2_Enumeration +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex2_Enumeration +main.class=CustomerTypeApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.xml b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.xml new file mode 100644 index 0000000..49f9ded --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex2_Enumeration + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java new file mode 100644 index 0000000..5e78251 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex2_Enumeration/src/CustomerTypeApp.java @@ -0,0 +1,12 @@ +public class CustomerTypeApp { + + public static void main(String[] args) { + // display a welcome message + System.out.println("Welcome to the Customer Type Test application\n"); + + // get and display the discount percent for a customer type + // display the value of the toString method of a customer type + } + + // a method that accepts a CustomerType enumeration +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/build.xml b/murach/netbeans/ex_starts/ch11_ex3_LineItem/build.xml new file mode 100644 index 0000000..e978adc --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch11_ex3_LineItem. + + + diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/manifest.mf b/murach/netbeans/ex_starts/ch11_ex3_LineItem/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/build-impl.xml new file mode 100644 index 0000000..fa308fc --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/genfiles.properties new file mode 100644 index 0000000..a749a8e --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=294d3731 +build.xml.script.CRC32=db7c2e65 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=294d3731 +nbproject/build-impl.xml.script.CRC32=f0025c22 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.properties b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.properties new file mode 100644 index 0000000..e2862fc --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch11_ex3_LineItem.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch11_ex3_LineItem +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch11_ex3_LineItem +main.class=murach.ui.LineItemApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.xml b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.xml new file mode 100644 index 0000000..f13ef1a --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch11_ex3_LineItem + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java new file mode 100644 index 0000000..70a2309 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/LineItem.java @@ -0,0 +1,51 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The LineItem class represents a line item and is used by the + * Product class. + */ +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + product = null; + quantity = 0; + total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public double getTotal() { + total = quantity * product.getPrice(); + return total; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(this.getTotal()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java new file mode 100644 index 0000000..9cd4082 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/business/Product.java @@ -0,0 +1,84 @@ +package murach.business; + +import java.text.NumberFormat; + +/** + * The Product class represents a product and is used by the + * LineItem class. + * @author Joel Murach + * @version 1.0.0 +*/ +public class Product { + + private String code; + private String description; + private double price; + + /** + * Creates a Product with default values. + */ + public Product() { + code = ""; + description = ""; + price = 0; + } + + /** + * Sets the product's code. + * @param code a String for the product's code + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Gets the product's code. + * @return a String for the product's code + */ + public String getCode() { + return code; + } + + /** + * Sets the product's description. + * @param description a String for the product's description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Gets the product's description. + * @return a String for the product's description + */ + public String getDescription() { + return description; + } + + /** + * Sets the product's price. + * @param price a double value for the product's price + */ + public void setPrice(double price) { + this.price = price; + } + + /** + * Gets a double value for the product's price. + * @return a double value that represents the product's price + */ + public double getPrice() { + return price; + } + + /** + * Gets a String for the product's price with + * standard currency formatting + * @return a String for the product's price with + * standard currency formatting applied ($1,000.00). + */ + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java new file mode 100644 index 0000000..f4a982a --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/data/ProductDB.java @@ -0,0 +1,32 @@ +package murach.data; + +import murach.business.*; + +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java new file mode 100644 index 0000000..5ba353f --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/Console.java @@ -0,0 +1,59 @@ +package murach.ui; + +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java new file mode 100644 index 0000000..c953983 --- /dev/null +++ b/murach/netbeans/ex_starts/ch11_ex3_LineItem/src/murach/ui/LineItemApp.java @@ -0,0 +1,43 @@ +package murach.ui; + +import murach.business.*; +import murach.data.ProductDB; + +public class LineItemApp { + + public static void main(String args[]) { + // display a welcome message + System.out.println("Welcome to the Line Item Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + // get the input from the user + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: ", 0, 1000); + + // use the ProductDB class to get the Product object + Product product = ProductDB.getProduct(productCode); + + // create the LineItem object + LineItem lineItem = new LineItem(); + lineItem.setProduct(product); + lineItem.setQuantity(quantity); + + // display the output + System.out.println(); + System.out.println("LINE ITEM"); + System.out.println("Code: " + product.getCode()); + System.out.println("Description: " + product.getDescription()); + System.out.println("Price: " + product.getPriceFormatted()); + System.out.println("Quantity: " + lineItem.getQuantity()); + System.out.println("Total: " + + lineItem.getTotalFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/nbactions.xml b/murach/netbeans/ex_starts/ch12_ex1_MPG/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/pom.xml b/murach/netbeans/ex_starts/ch12_ex1_MPG/pom.xml new file mode 100644 index 0000000..70bf474 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex1_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java b/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..91df041 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,35 @@ +package com.murach.mpg; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + + @Override + public void start(Stage stage) { + Button btn = new Button(); + btn.setText("Say 'Hello World'"); + btn.setOnAction(event -> buttonClicked()); + + StackPane root = new StackPane(); + root.getChildren().add(btn); + + Scene scene = new Scene(root, 300, 250); + + stage.setTitle("Hello World!"); + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + System.out.println("Hello World!"); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java b/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..a576a66 Binary files /dev/null and b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/module-info.class b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/module-info.class new file mode 100644 index 0000000..54de3f1 Binary files /dev/null and b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..68f13e4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\murach\mpg\MpgApp.class +module-info.class diff --git a/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..079d301 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex1_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex1_MPG\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex1_MPG\src\main\java\module-info.java diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/nbactions.xml b/murach/netbeans/ex_starts/ch12_ex2_MPG/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/pom.xml b/murach/netbeans/ex_starts/ch12_ex2_MPG/pom.xml new file mode 100644 index 0000000..9305e12 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + com.murach + ch12_ex2_MPG + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.mpg.MpgApp + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java b/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java new file mode 100644 index 0000000..d21fbf6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/com/murach/mpg/MpgApp.java @@ -0,0 +1,66 @@ +package com.murach.mpg; + +import java.text.NumberFormat; +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; + +public class MpgApp extends Application { + private TextField milesField; + private TextField gallonsField; + private TextField mpgField; + + @Override + public void start(Stage stage) { + stage.setTitle("MPG Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_LEFT); + grid.setHgap(10); + grid.setVgap(10); + grid.setPadding(new Insets(25, 25, 25, 25)); + + Scene scene = new Scene(grid, 275, 175); + + grid.add(new Label("Miles:"), 0, 0); + milesField = new TextField(); + grid.add(milesField, 1, 0); + + grid.add(new Label("Gallons:"), 0, 1); + gallonsField = new TextField(); + grid.add(gallonsField, 1, 1); + + grid.add(new Label("MPG:"), 0, 2); + mpgField = new TextField(); + mpgField.setEditable(false); + grid.add(mpgField, 1, 2); + + Button btn = new Button(); + btn.setText("Calculate"); + btn.setOnAction(event -> buttonClicked()); + grid.add(btn, 1, 3); + + stage.setScene(scene); + stage.show(); + } + + private void buttonClicked() { + double miles = Double.parseDouble(milesField.getText()); + double gallons = Double.parseDouble(gallonsField.getText()); + double mpg = miles / gallons; + + NumberFormat num = NumberFormat.getNumberInstance(); + mpgField.setText( num.format(mpg) ); + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java b/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java new file mode 100644 index 0000000..b7c997b --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.mpg { + requires javafx.controls; + exports com.murach.mpg; +} diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class new file mode 100644 index 0000000..e04d628 Binary files /dev/null and b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/com/murach/mpg/MpgApp.class differ diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/module-info.class b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/module-info.class new file mode 100644 index 0000000..54de3f1 Binary files /dev/null and b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..68f13e4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,2 @@ +com\murach\mpg\MpgApp.class +module-info.class diff --git a/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..2361166 --- /dev/null +++ b/murach/netbeans/ex_starts/ch12_ex2_MPG/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,2 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex2_MPG\src\main\java\com\murach\mpg\MpgApp.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch12_ex2_MPG\src\main\java\module-info.java diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/nbactions.xml b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/pom.xml b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/pom.xml new file mode 100644 index 0000000..251e920 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + com.murach + ch13_ex1_FutureValue + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + com.murach.future_value.FutureValueApplication + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + ch13_ex1_FutureValue + diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java new file mode 100644 index 0000000..50797f6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/FutureValueApplication.java @@ -0,0 +1,120 @@ +package com.murach.future_value; + +import java.text.NumberFormat; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.scene.Scene; +import javafx.scene.control.Alert; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.stage.Stage; + +public class FutureValueApplication extends Application { + private TextField investmentField; + private TextField interestRateField; + private TextField yearsField; + private TextField futureValueField; + + public static void main(String[] args) { + launch(args); + } + + @Override + public void start(Stage primaryStage) { + primaryStage.setTitle("Future Value Calculator"); + + GridPane grid = new GridPane(); + grid.setAlignment(Pos.TOP_CENTER); + grid.setPadding(new Insets(25, 25, 25, 25)); + grid.setHgap(10); + grid.setVgap(10); + + Scene scene = new Scene(grid); + + grid.add(new Label("Monthly Investment:"), 0, 0); + investmentField = new TextField(); + grid.add(investmentField, 1, 0); + + grid.add(new Label("Yearly Interest Rate:"), 0, 1); + interestRateField = new TextField(); + grid.add(interestRateField, 1, 1); + + grid.add(new Label("Years:"), 0, 2); + yearsField = new TextField(); + grid.add(yearsField, 1, 2); + + grid.add(new Label("Future Value:"), 0, 3); + futureValueField = new TextField(); + futureValueField.setEditable(false); + grid.add(futureValueField, 1, 3); + + Button calculateButton = new Button("Calculate"); + calculateButton.setOnAction(event -> calculateButtonClicked()); + + Button exitButton = new Button("Exit"); + exitButton.setOnAction(event -> exitButtonClicked()); + + HBox buttonBox = new HBox(10); + buttonBox.getChildren().add(calculateButton); + buttonBox.getChildren().add(exitButton); + buttonBox.setAlignment(Pos.BOTTOM_RIGHT); + grid.add(buttonBox, 0, 4, 2, 1); + + primaryStage.setScene(scene); + primaryStage.show(); + } + + private void calculateButtonClicked() { + Validation v = new Validation(); + String errorMsg = ""; + errorMsg += v.isDouble(investmentField.getText(), + "Monthly Investment"); + errorMsg += v.isDouble(interestRateField.getText(), + "Yearly Interest Rate"); + errorMsg += v.isInteger(yearsField.getText(), + "Years"); + + if (errorMsg.isEmpty()) { + double investment = Double.parseDouble( + investmentField.getText()); + double rate = Double.parseDouble( + interestRateField.getText()); + int years = Integer.parseInt( + yearsField.getText()); + + double futureValue = calculateFutureValue( + investment, rate, years); + + NumberFormat currency = NumberFormat.getCurrencyInstance(); + futureValueField.setText(currency.format(futureValue)); + } else { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setHeaderText("Invalid Data"); + alert.setContentText(errorMsg); + alert.showAndWait(); + } + } + + public double calculateFutureValue(double investment, double rate, int years) { + double futureValue = 0.0; + + // convert yearly values to monthly values + double monthlyInterestRate = rate / 12 / 100; + int months = years * 12; + + for (int i = 1; i <= months; i++) { + futureValue = (futureValue + investment) + * (1 + monthlyInterestRate); + } + return futureValue; + } + + private void exitButtonClicked() { + System.exit(0); // 0 indicates a normal exit + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java new file mode 100644 index 0000000..4a03e70 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/com/murach/future_value/Validation.java @@ -0,0 +1,42 @@ +package com.murach.future_value; + +public class Validation { + + private final String lineEnd; + + public Validation() { + this.lineEnd = "\n"; + } + + public Validation(String lineEnd) { + this.lineEnd = lineEnd; + } + + public String isPresent(String value, String name) { + String msg = ""; + if (value.isEmpty()) { + msg = name + " is required." + lineEnd; + } + return msg; + } + + public String isDouble(String value, String name) { + String msg = ""; + try { + Double.parseDouble(value); + } catch (NumberFormatException e) { + msg = name + " must be a valid number." + lineEnd; + } + return msg; + } + + public String isInteger(String value, String name) { + String msg = ""; + try { + Integer.parseInt(value); + } catch (NumberFormatException e) { + msg = name + " must be an integer." + lineEnd; + } + return msg; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java new file mode 100644 index 0000000..bc26e83 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.murach.future_value { + requires javafx.controls; + exports com.murach.future_value; // This is necessary, but why? +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class new file mode 100644 index 0000000..9149b2e Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/FutureValueApplication.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class new file mode 100644 index 0000000..04d728d Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/com/murach/future_value/Validation.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class new file mode 100644 index 0000000..d656ad2 Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..85a5e9f --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,3 @@ +com\murach\future_value\Validation.class +module-info.class +com\murach\future_value\FutureValueApplication.class diff --git a/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..0a18a46 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex1_FutureValue/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\com\murach\future_value\Validation.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\com\murach\future_value\FutureValueApplication.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex1_FutureValue\src\main\java\module-info.java diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml new file mode 100644 index 0000000..a0cb38e --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/nbactions.xml @@ -0,0 +1,40 @@ + + + + run + + jar + + + clean + javafx:run + + + + debug + + clean + javafx:run@ide-debug + + + true + + + + profile + + clean + javafx:run@ide-profile + + + + CUSTOM-jlink + jlink + + clean + + compile + javafx:jlink + + + diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/pom.xml b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/pom.xml new file mode 100644 index 0000000..7fbe53a --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + Murach + ch13_ex2_PizzaCalculator + 1.0-SNAPSHOT + + UTF-8 + 11 + 11 + + + + org.openjfx + javafx-controls + 13 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + murach.pizza_calculator.App + + + + + + default-cli + + + + + debug + + + + + + + + + ide-debug + + + + + + + + + ide-profile + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java new file mode 100644 index 0000000..63a5e0f --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module murach.ch13_ex2_pizzacalculator { + requires javafx.controls; + exports murach.pizza_calculator; +} diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/App.java b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/App.java new file mode 100644 index 0000000..7d92ba0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/App.java @@ -0,0 +1,56 @@ +package murach.pizza_calculator; + +import javafx.application.Application; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.layout.HBox; +import javafx.geometry.Insets; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.scene.control.ToggleGroup; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.control.Button; +import javafx.stage.Stage; + + +/** + * JavaFX App + */ +public class App extends Application { + + // class globals + + @Override + public void start(Stage stage) { + stage.setTitle("Pizza Price Calculcator"); + GridPane grid = new GridPane(); + VBox appContainer = new VBox(10); + + // size + + // toppings + + // price output + + // calculate button + + grid.add(appContainer, 0, 5); + grid.setPadding(new Insets(10, 10, 0, 10)); + Scene scene = new Scene(grid, 225, 250); + stage.setScene(scene); + stage.show(); + } + + public void calculatePrice(Stage stage) { + double price = 0.0; + // calulation code here + } + + public static void main(String[] args) { + launch(); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/SystemInfo.java b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/SystemInfo.java new file mode 100644 index 0000000..e164e4f --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/src/main/java/murach/pizza_calculator/SystemInfo.java @@ -0,0 +1,13 @@ +package murach.pizza_calculator; + +public class SystemInfo { + + public static String javaVersion() { + return System.getProperty("java.version"); + } + + public static String javafxVersion() { + return System.getProperty("javafx.version"); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class new file mode 100644 index 0000000..53d8067 Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/module-info.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/App.class b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/App.class new file mode 100644 index 0000000..5793e11 Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/App.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/SystemInfo.class b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/SystemInfo.class new file mode 100644 index 0000000..0c970b5 Binary files /dev/null and b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/classes/murach/pizza_calculator/SystemInfo.class differ diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..e4b4a94 --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +module-info.class diff --git a/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..21aa38a --- /dev/null +++ b/murach/netbeans/ex_starts/ch13_ex2_PizzaCalculator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex2_PizzaCalculator\src\main\java\murach\pizza_calculator\App.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex2_PizzaCalculator\src\main\java\murach\pizza_calculator\SystemInfo.java +C:\Users\Joel\Dropbox\Java 6ed\java\netbeans\ex_starts\ch13_ex2_PizzaCalculator\src\main\java\module-info.java diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/build.xml b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/build.xml new file mode 100644 index 0000000..eb289f9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_ex1_CreateAccount. + + + diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/manifest.mf b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/build-impl.xml new file mode 100644 index 0000000..4511c3d --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/genfiles.properties new file mode 100644 index 0000000..54a9f18 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=97e9cb0d +build.xml.script.CRC32=b0fa8f20 +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=97e9cb0d +nbproject/build-impl.xml.script.CRC32=bf8c7408 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.properties b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.properties new file mode 100644 index 0000000..ecebc1e --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_ex1_CreateAccount.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_ex1_CreateAccount +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_ex1_CreateAccount +main.class=CreateAccountApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.xml b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.xml new file mode 100644 index 0000000..f3f5b1f --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_ex1_CreateAccount + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java new file mode 100644 index 0000000..c81cce6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex1_CreateAccount/src/CreateAccountApp.java @@ -0,0 +1,66 @@ +import java.util.Scanner; + +public class CreateAccountApp { + + private static final Scanner sc = new Scanner(System.in); + + public static void main(String[] args) { + String fullName = getFullName(); + System.out.println(); + + String password = getPassword(); + System.out.println(); + + String msg = getSuccessMessage(fullName); + System.out.println(msg); + } + + private static String getFullName() { + while(true) { + System.out.print("Enter full name: "); + String name = sc.nextLine().trim(); + if(name.contains(" ")) { + return name; + } else { + System.out.println("You must enter your full name.\n"); + } + } + } + + private static String getPassword() { + while(true) { + System.out.print("Enter password: "); + String password = sc.nextLine().trim(); + + boolean isMinLength = false; + boolean hasDigit = false; + boolean hasUppercase = false; + + if (password.length() >= 8) { + isMinLength = true; + } + + for (char c: password.toCharArray()) { + if (Character.isDigit(c)) { + hasDigit = true; + } else if (Character.isUpperCase(c)) { + hasUppercase = true; + } + } + + if (isMinLength && hasDigit && hasUppercase) { + return password; + } else { + System.out.println("Password must be 8 characters or more\n" + + "with at least one digit and one uppercase letter.\n"); + } + } + } + + private static String getSuccessMessage(String fullName) { + int index = fullName.indexOf(" "); + String firstName = fullName.substring(0,1).toUpperCase() + + fullName.substring(1, index).toLowerCase(); + return "Hi " + firstName + ", thanks for creating an account!\n"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/build.xml b/murach/netbeans/ex_starts/ch14_ex2_Hangman/build.xml new file mode 100644 index 0000000..3dc5395 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch14_ex2_Hangman. + + + diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/manifest.mf b/murach/netbeans/ex_starts/ch14_ex2_Hangman/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/build-impl.xml new file mode 100644 index 0000000..1d95dcf --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/genfiles.properties new file mode 100644 index 0000000..065a532 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=165b1243 +build.xml.script.CRC32=a0d06bcf +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=165b1243 +nbproject/build-impl.xml.script.CRC32=a2abbc0e +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.properties b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.properties new file mode 100644 index 0000000..0be8f8a --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch14_ex2_Hangman.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch14_ex2_Hangman +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch14_ex2_Hangman +main.class=HangmanApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=windows-1252 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.xml b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.xml new file mode 100644 index 0000000..6749dac --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch14_ex2_Hangman + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/Hangman.java b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/Hangman.java new file mode 100644 index 0000000..12f01f7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/Hangman.java @@ -0,0 +1,91 @@ +import java.util.Scanner; + +public class Hangman { + private final WordList wordList = new WordList(); + private final String word; + private final int wordLength; + private int remainingLetters; + private String displayedWord; + private int numGuesses = 0; + private int numWrong = 0; + private String guessedLetters = ""; + private final Scanner sc = new Scanner(System.in); + + public Hangman() { + word = wordList.getRandomWord().toUpperCase(); + wordLength = word.length(); + remainingLetters = wordLength; + displayedWord = "_".repeat(wordLength); + } + + public char getLetter() { + while (true) { + System.out.print("Enter a letter: "); + String s = sc.nextLine().toUpperCase(); + + if (s.length() == 1) { + char c = s.charAt(0); + if (Character.isLetter(c)) { + if (guessedLetters.indexOf(c) == -1) { + numGuesses++; + guessedLetters += c; + return c; + } else { + System.out.println("You already tried that letter."); + continue; + } + } + } + // if you're here, user didn't enter a single letter + System.out.println("Please enter 1 and only 1 letter."); + } + } + + public void drawLine() { + System.out.println("*".repeat(64)); + } + + public void drawScreen() { + drawLine(); + String display = String.format( + "Word: %s Guesses: %d Wrong: %d Tried: %s", + wordList.addSpaces(displayedWord), + numGuesses, numWrong, + wordList.addSpaces(guessedLetters)); + System.out.println(display); + } + + public void playGame() { + drawScreen(); + + while (numWrong < 10 && remainingLetters > 0) { + char guess = getLetter(); + + int index = word.indexOf(guess); + if (index == -1) { + numWrong++; + } else { + displayedWord = ""; + remainingLetters = word.length(); + + for(char c: word.toCharArray()){ + if (guessedLetters.indexOf(c) == -1) { + displayedWord += "_"; + } else { + displayedWord += c; + remainingLetters--; //decrement remaining letters + } + } + } + drawScreen(); + } + drawLine(); + if (remainingLetters == 0) { + System.out.println(String.format( + "Congratulations! You got it in %d guesses.", numGuesses)); + } else { + System.out.println(String.format( + "Sorry, you lost. The word was %s.", word)); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java new file mode 100644 index 0000000..0ce2efe --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/HangmanApp.java @@ -0,0 +1,18 @@ +import java.util.Scanner; + +public class HangmanApp { + + public static void main(String[] args) { + System.out.println("Play the H A N G M A N game"); + + Scanner sc = new Scanner(System.in); + String again = "y"; + while(again.equalsIgnoreCase("y")) { + var hangman = new Hangman(); + hangman.playGame(); + System.out.println(); + System.out.print("Play again? (y/n): "); + again = sc.nextLine(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/WordList.java b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/WordList.java new file mode 100644 index 0000000..b495a0c --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/src/WordList.java @@ -0,0 +1,39 @@ +import java.io.*; +import java.util.ArrayList; + +public class WordList { + private final String FILENAME = "words.txt"; + private ArrayList words; + + public WordList() { + words = new ArrayList<>(); + try(var in = new BufferedReader( + new FileReader(FILENAME))){ + String word = in.readLine(); + while(word != null) { + words.add(word); + word = in.readLine(); + } + } + catch(FileNotFoundException e) { + System.out.println(FILENAME + " not found."); + } + catch(IOException e) { + System.out.println(e); + } + } + + public String getRandomWord() { + int length = words.size(); + if (length == 0) { + return ""; + } else { + int index = (int) (Math.random() * length); + return words.get(index); + } + } + + public String addSpaces(String word) { + return String.join(" ", word.split("")); + } +} diff --git a/murach/netbeans/ex_starts/ch14_ex2_Hangman/words.txt b/murach/netbeans/ex_starts/ch14_ex2_Hangman/words.txt new file mode 100644 index 0000000..e97d1c0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch14_ex2_Hangman/words.txt @@ -0,0 +1,50 @@ +aardvark +action +activity +aftermath +agreement +air +beds +border +box +branch +cemetery +cheese +day +death +deer +design +edge +finger +fish +fruit +gold +haircut +home +ice +leather +line +look +mom +mountain +need +observation +ocean +oven +peace +pigs +playground +plough +quilt +sidewalk +smell +spade +spy +swing +throne +truck +twig +vessel +wave +wind +zipper \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/build.xml b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/build.xml new file mode 100644 index 0000000..695bcb0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex1_FutureValue. + + + diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/manifest.mf b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/build-impl.xml new file mode 100644 index 0000000..617bad5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/genfiles.properties new file mode 100644 index 0000000..6941c47 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=fcffe190 +build.xml.script.CRC32=4c3b724a +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=fcffe190 +nbproject/build-impl.xml.script.CRC32=4d3c7cb7 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.properties new file mode 100644 index 0000000..a7074dd --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.properties @@ -0,0 +1,4 @@ +compile.on.save=true +do.jlink=false +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.properties b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.properties new file mode 100644 index 0000000..674ae50 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.properties @@ -0,0 +1,90 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch12_ex1_FutureValue_sol +application.vendor=Anne +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch12_ex1_FutureValue_sol.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch15_ex1_FutureValue +main.class=FutureValueApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.xml b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.xml new file mode 100644 index 0000000..091ee52 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex1_FutureValue + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/Console.java b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/Console.java new file mode 100644 index 0000000..593c021 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValue.java b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValue.java new file mode 100644 index 0000000..5be8908 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValue.java @@ -0,0 +1,45 @@ +import java.text.NumberFormat; + +public class FutureValue { + private double monthlyInvestment; + private double interestRate; + private int years; + + public FutureValue(double monthlyInvestment, double interestRate, int years) { + this.monthlyInvestment = monthlyInvestment; + this.interestRate = interestRate; + this.years = years; + } + + public double getFutureValue() { + int months = years * 12; + double monthlyInterestRate = interestRate / 12 / 100; + double futureValue = 0; + for (int i = 1; i <= months; i++) { + futureValue = + (futureValue + monthlyInvestment) * + (1 + monthlyInterestRate); + } + return futureValue; + } + + public String getMonthlyInvestmentFormatted() { + return NumberFormat.getCurrencyInstance() + .format(monthlyInvestment); + } + + public String getInterestRateFormatted() { + var percent = NumberFormat.getPercentInstance(); + percent.setMinimumFractionDigits(1); + return percent.format(interestRate/100); + } + + public int getYears() { + return this.years; + } + + public String getFutureValueFormatted() { + return NumberFormat.getCurrencyInstance() + .format(getFutureValue()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java new file mode 100644 index 0000000..9d13ab3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex1_FutureValue/src/FutureValueApp.java @@ -0,0 +1,39 @@ +public class FutureValueApp { + + public static void main(String[] args) { + + // display a welcome message + System.out.println("Welcome to the Future Value Calculator"); + System.out.println(); + + // perform 1 or more calculations + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + + // get the input from the user + System.out.println("DATA ENTRY"); + double monthlyInvestment = Console.getDouble( + "Enter monthly investment: ", 0, 1000); + double interestRate = Console.getDouble( + "Enter yearly interest rate: ", 0, 30); + int years = Console.getInt( + "Enter number of years: ", 0, 100); + System.out.println(); + + // create FutureValue object + FutureValue fv = new FutureValue( + monthlyInvestment, interestRate, years); + + // print the results + System.out.println("FORMATTED RESULTS\n" + + "Monthly investment: " + fv.getMonthlyInvestmentFormatted() + "\n" + + "Yearly interest rate: " + fv.getInterestRateFormatted() + "\n" + + "Number of years: " + fv.getYears() + "\n" + + "Future value: " + fv.getFutureValueFormatted() + "\n"); + + // see if the user wants to continue + choice = Console.getString("Continue? (y/n): "); + System.out.println(); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/build.xml b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/build.xml new file mode 100644 index 0000000..a3b7b3b --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex2_GenericStack. + + + diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/manifest.mf b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/build-impl.xml new file mode 100644 index 0000000..6165bc5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/genfiles.properties new file mode 100644 index 0000000..1b7d518 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=29b41933 +build.xml.script.CRC32=9b47eb01 +build.xml.stylesheet.CRC32=f85dc8f2@1.95.0.48 +# 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=29b41933 +nbproject/build-impl.xml.script.CRC32=19d99cb8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.properties b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.properties new file mode 100644 index 0000000..37a78b6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.properties @@ -0,0 +1,91 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_ex2_GenericStack +application.vendor=Scott +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_ex2_GenericStack.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch12_ex3_GenericStack_sol +main.class=GenericStackApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.xml b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.xml new file mode 100644 index 0000000..a42bcaf --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex2_GenericStack + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java new file mode 100644 index 0000000..959bec2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex2_GenericStack/src/GenericStackApp.java @@ -0,0 +1,7 @@ +public class GenericStackApp { + + public static void main(String[] args) { + + } + +} diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/build.xml b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/build.xml new file mode 100644 index 0000000..458a444 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch15_ex3_LoginCounter. + + + diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/manifest.mf b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/build-impl.xml new file mode 100644 index 0000000..7dd657d --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/genfiles.properties new file mode 100644 index 0000000..2572a11 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=77da5e52 +build.xml.script.CRC32=49d7bdcc +build.xml.stylesheet.CRC32=f85dc8f2@1.98.0.48 +# 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=77da5e52 +nbproject/build-impl.xml.script.CRC32=e01f3101 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.properties new file mode 100644 index 0000000..692a310 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.properties b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.properties new file mode 100644 index 0000000..7eb2388 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.properties @@ -0,0 +1,91 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch15_ex3_LoginCounter +application.vendor=Scott +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch15_ex3_LoginCounter.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=16 +javac.target=16 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch12_ex3_GenericStack_sol +main.class=LoginCounterApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.xml b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.xml new file mode 100644 index 0000000..44ec5cb --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch15_ex3_LoginCounter + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java new file mode 100644 index 0000000..5f41e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch15_ex3_LoginCounter/src/LoginCounterApp.java @@ -0,0 +1,10 @@ +import java.util.Map; +import java.util.TreeMap; +import java.util.Scanner; + +public class LoginCounterApp { + public static void main(String[] args) { + System.out.println("The Login Counter Application"); + + } +} diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/build.xml b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/build.xml new file mode 100644 index 0000000..87c8dc4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch16_ex1_BookCatalog. + + + diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/manifest.mf b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/build-impl.xml new file mode 100644 index 0000000..877c036 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/genfiles.properties new file mode 100644 index 0000000..b9d88bd --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=773fca82 +build.xml.script.CRC32=0b4959fd +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=773fca82 +nbproject/build-impl.xml.script.CRC32=f7865f07 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.properties new file mode 100644 index 0000000..5a75ffe --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.properties @@ -0,0 +1 @@ +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.properties b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.properties new file mode 100644 index 0000000..fb39641 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.properties @@ -0,0 +1,85 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch16_ex1_BookCatalog.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.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +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=BookManagerApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.xml b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.xml new file mode 100644 index 0000000..600bee0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch16_ex1_BookCatalog + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/Book.java b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java new file mode 100644 index 0000000..423a048 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManager.java @@ -0,0 +1,40 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooksByTitle(String title) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getTitle().equals(title)) { + books.add(b); + } + } + return books; + } + + public List getBooksByCategory(String category) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getCategory().equals(category)) { + books.add(b); + } + } + return books; + } + + public List getBooksByFormat(String format) { + List books = new ArrayList<>(); + for (Book b : bookList) { + if (b.getFormat().equals(format)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java new file mode 100644 index 0000000..a83c322 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex1_BookCatalog/src/BookManagerApp.java @@ -0,0 +1,27 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooksByTitle("Java Programming"); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooksByCategory(Book.JAVA); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooksByFormat(Book.PAPERBACK); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/build.xml b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/build.xml new file mode 100644 index 0000000..ca92169 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch16_ex2_BookCatalog. + + + diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/manifest.mf b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/build-impl.xml new file mode 100644 index 0000000..a24b847 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/genfiles.properties new file mode 100644 index 0000000..6e78711 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=aa940e16 +build.xml.script.CRC32=c0fb4564 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=aa940e16 +nbproject/build-impl.xml.script.CRC32=ad8bb9c2 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/private/private.properties new file mode 100644 index 0000000..5a75ffe --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/private/private.properties @@ -0,0 +1 @@ +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.properties b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.properties new file mode 100644 index 0000000..e50a115 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.properties @@ -0,0 +1,85 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch16_ex2_BookCatalog.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.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +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=BookManagerApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.xml b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.xml new file mode 100644 index 0000000..49e583e --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch16_ex2_BookCatalog + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/Book.java b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/Book.java new file mode 100644 index 0000000..4a0b146 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/Book.java @@ -0,0 +1,51 @@ +public class Book { + public static final String JAVA = "Java"; + public static final String DOTNET = ".NET"; + public static final String WEB = "Web"; + public static final String DATABASE = "Database"; + public static final String MOBILE = "Mobile"; + + public static final String PAPERBACK = "Paperback"; + public static final String ELECTRONIC = "Electronic"; + + private String title; + private String category; + private String format; + + public Book(String title, String category, String format) { + this.title = title; + this.category = category; + this.format = format; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format; + } + + @Override + public String toString() { + return "[" + getTitle() + ", " + + getCategory() + ", " + + getFormat() + "]"; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java new file mode 100644 index 0000000..eb28516 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookCatalog.java @@ -0,0 +1,31 @@ +import java.util.ArrayList; +import java.util.List; + +public class BookCatalog { + private List bookCatalog; + + public BookCatalog() { + bookCatalog = new ArrayList<>(); + bookCatalog.add(new Book("PHP and MySQL", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.PAPERBACK)); + bookCatalog.add(new Book("MySQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Dreamweaver", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Servlets and JSP", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("C#", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("Visual Basic", Book.DOTNET, Book.ELECTRONIC)); + bookCatalog.add(new Book("SQL Server", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("Oracle SQL and PL/SQL", Book.DATABASE, Book.ELECTRONIC)); + bookCatalog.add(new Book("HTML5 and CSS3", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and jQuery", Book.WEB, Book.ELECTRONIC)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.PAPERBACK)); + bookCatalog.add(new Book("Java Programming", Book.JAVA, Book.ELECTRONIC)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.PAPERBACK)); + bookCatalog.add(new Book("Android Programming", Book.MOBILE, Book.ELECTRONIC)); + bookCatalog.add(new Book("JavaScript and DOM Scripting", Book.WEB, Book.ELECTRONIC)); + } + + public List getCatalog() { + return bookCatalog; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java new file mode 100644 index 0000000..d403bdc --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManager.java @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +public class BookManager { + private List bookList; + + public BookManager() { + bookList = new BookCatalog().getCatalog(); + } + + public List getBooks(Predicate condition) { + List books = new ArrayList<>(); + for (Book b: bookList) { + if (condition.test(b)) { + books.add(b); + } + } + return books; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java new file mode 100644 index 0000000..0aacec2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch16_ex2_BookCatalog/src/BookManagerApp.java @@ -0,0 +1,29 @@ +import java.util.List; + +public class BookManagerApp { + + public static void main(String[] args) { + BookManager manager = new BookManager(); + + List booksByTitle = manager.getBooks( + b -> b.getTitle().equals("Java Programming")); + System.out.println("\nBOOKS BY TITLE:"); + printList(booksByTitle); + + List booksByCategory = manager.getBooks( + b -> b.getCategory().equals(Book.JAVA)); + System.out.println("\nBOOKS BY CATEGORY:"); + printList(booksByCategory); + + List booksByFormat = manager.getBooks( + b -> b.getFormat().equals(Book.PAPERBACK)); + System.out.println("\nBOOKS BY FORMAT:"); + printList(booksByFormat); + } + + public static void printList(List bookList) { + for (Book b : bookList) { + System.out.println(b); + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/build.xml b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/build.xml new file mode 100644 index 0000000..2f1af87 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex1_Fibonacci. + + + diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/manifest.mf b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/build-impl.xml new file mode 100644 index 0000000..1701ba9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/genfiles.properties new file mode 100644 index 0000000..c616a47 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a2ca75d3 +build.xml.script.CRC32=a00281aa +build.xml.stylesheet.CRC32=f85dc8f2@1.95.0.48 +# 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=a2ca75d3 +nbproject/build-impl.xml.script.CRC32=32fcc436 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.properties b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.properties new file mode 100644 index 0000000..765ce91 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex1_Fibonacci.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex1_Fibonacci +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex1_Fibonacci +main.class=FibonacciApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.xml b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.xml new file mode 100644 index 0000000..e4b492e --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex1_Fibonacci + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/src/FibonacciApp.java b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/src/FibonacciApp.java new file mode 100644 index 0000000..ea977bd --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex1_Fibonacci/src/FibonacciApp.java @@ -0,0 +1,36 @@ +public class FibonacciApp { + + public static void main(String[] args) { + int iterResult = iterFibo(16); + int recResult = recFibo(16); + + System.out.println(iterResult); + System.out.println(recResult); + } + + public static int iterFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } + int n1 = 0, n2 = 1, fib = 0; + for (int i = 2; i < n+1; i++) { + fib = n1 + n2; + n1 = n2; + n2 = fib; + } + return fib; + } + + public static int recFibo(int n) { + if (n == 0) { // base case 1 + return 0; + } else if (n == 1) { // base case 2 + return 1; + } else { + return recFibo(n - 1) + recFibo(n - 2); + } + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/build.xml b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/build.xml new file mode 100644 index 0000000..36721a8 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex2_StringReversal. + + + diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/manifest.mf b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/build-impl.xml new file mode 100644 index 0000000..47500a1 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/genfiles.properties new file mode 100644 index 0000000..a659fb6 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=79cfeb84 +build.xml.script.CRC32=6cc5e56d +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=79cfeb84 +nbproject/build-impl.xml.script.CRC32=dbd2fac8 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.properties b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.properties new file mode 100644 index 0000000..3ec3966 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex2_StringReversal.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex2_StringReversal +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex2_StringReversal +main.class=StringReversalApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.xml b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.xml new file mode 100644 index 0000000..7b67083 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex2_StringReversal + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java new file mode 100644 index 0000000..dbc8d6b --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex2_StringReversal/src/StringReversalApp.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class StringReversalApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.print("Enter string to reverse: "); + String input = sc.nextLine(); + + System.out.println("Iterative string reversal..."); + String result = iterReverse(input); + System.out.println(result); + + System.out.println("Recursive string reversal..."); + result = recReverse(input); + System.out.println(result); + System.out.println(); + } + + // iterative + public static String iterReverse(String str) { + System.out.println("Iterative solution here..."); + return null; + } + + // recursive + public static String recReverse(String str) { + System.out.println("Recursive solution here..."); + return null; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/build.xml b/murach/netbeans/ex_starts/ch17_ex3_GCD/build.xml new file mode 100644 index 0000000..2a5f651 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch17_ex3_GCD. + + + diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/manifest.mf b/murach/netbeans/ex_starts/ch17_ex3_GCD/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/build-impl.xml new file mode 100644 index 0000000..b2adc3d --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/genfiles.properties new file mode 100644 index 0000000..5293088 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=cddfa71d +build.xml.script.CRC32=f473dc51 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=cddfa71d +nbproject/build-impl.xml.script.CRC32=2b6674b7 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.properties new file mode 100644 index 0000000..261ac9d --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.properties b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.properties new file mode 100644 index 0000000..0a468ab --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.properties @@ -0,0 +1,95 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# 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}/ch17_ex3_GCD.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/ch17_ex3_GCD +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=ch17_ex3_GCD +main.class=GCDApp +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.xml b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.xml new file mode 100644 index 0000000..b3727ae --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + ch17_ex3_GCD + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch17_ex3_GCD/src/GCDApp.java b/murach/netbeans/ex_starts/ch17_ex3_GCD/src/GCDApp.java new file mode 100644 index 0000000..650d67a --- /dev/null +++ b/murach/netbeans/ex_starts/ch17_ex3_GCD/src/GCDApp.java @@ -0,0 +1,35 @@ +import java.util.Scanner; + +public class GCDApp { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + System.out.print("Enter the first number: "); + int firstNumber = Integer.parseInt(sc.nextLine()); + + System.out.print("Enter the second number: "); + int secondNumber = Integer.parseInt(sc.nextLine()); + + System.out.println("Iterative GCD..."); + int result = iterGCD(firstNumber, secondNumber); + System.out.println(result); + + System.out.println("Recursive GCD..."); + result = recGCD(firstNumber, secondNumber); + System.out.println(result); + System.out.println(); + } + + // iterative + public static int iterGCD(int a, int b) { + System.out.println("Iterative solution here..."); + return 0; + } + + // recursive + public static int recGCD(int a, int b) { + System.out.println("Recursive solution here..."); + return 0; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/build.xml b/murach/netbeans/ex_starts/ch18_ex1_Invoice/build.xml new file mode 100644 index 0000000..26483a2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch18_ex1_Invoice. + + + diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/manifest.mf b/murach/netbeans/ex_starts/ch18_ex1_Invoice/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/build-impl.xml new file mode 100644 index 0000000..75496dc --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/genfiles.properties new file mode 100644 index 0000000..aeb53a0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=22d6a8eb +build.xml.script.CRC32=c9b3c0b5 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=22d6a8eb +nbproject/build-impl.xml.script.CRC32=e40d8a7a +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.properties new file mode 100644 index 0000000..ee45d48 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.properties @@ -0,0 +1,10 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +file.reference.Ch11_Invoice1-src=C:\\murach\\java\\netbeans\\ex_starts\\ch14_ex1_Invoice\\src +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.properties b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.properties new file mode 100644 index 0000000..84e4169 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.properties @@ -0,0 +1,96 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch18_ex1_Invoice +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch18_ex1_Invoice.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.Ch11_Invoice1-src=src +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch18_ex1_Invoice +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=InvoiceApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.xml b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.xml new file mode 100644 index 0000000..06af9a7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch18_ex1_Invoice + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Console.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Console.java new file mode 100644 index 0000000..76a0331 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Console.java @@ -0,0 +1,48 @@ +import java.util.Scanner; + +public class Console { + + private static Scanner sc = new Scanner(System.in); + + public static void displayLine() { + System.out.println(); + } + + public static void displayLine(String s) { + System.out.println(s); + } + + public static String getString(String prompt) { + System.out.print(prompt); + String s = sc.nextLine(); + return s; + } + + public static int getInt(String prompt) { + int i = 0; + while (true) { + System.out.print(prompt); + try { + i = Integer.parseInt(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid integer. Try again."); + } + } + return i; + } + + public static double getDouble(String prompt) { + double d = 0; + while (true) { + System.out.print(prompt); + try { + d = Double.parseDouble(sc.nextLine()); + break; + } catch (NumberFormatException e) { + System.out.println("Error! Invalid decimal. Try again."); + } + } + return d; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Invoice.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Invoice.java new file mode 100644 index 0000000..3e1a288 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Invoice.java @@ -0,0 +1,54 @@ +import java.text.NumberFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; +import java.util.ArrayList; + +public class Invoice { + + // the instance variables + private ArrayList lineItems; + private LocalDateTime invoiceDate; + + // the constructor + public Invoice() { + lineItems = new ArrayList<>(); + invoiceDate = LocalDateTime.now(); + } + + public void addItem(LineItem lineItem) { + lineItems.add(lineItem); + } + + public ArrayList getLineItems() { + return lineItems; + } + + public double getTotal() { + double invoiceTotal = 0; + for (LineItem lineItem : lineItems) { + invoiceTotal += lineItem.getTotal(); + } + return invoiceTotal; + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(getTotal()); + } + + public void setDate(LocalDateTime invoiceDate) { + this.invoiceDate = invoiceDate; + } + + public LocalDateTime getDate() { + return invoiceDate; + } + + public String getDateFormatted() { + DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate( + FormatStyle.SHORT); + return dtf.format(invoiceDate); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/InvoiceApp.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/InvoiceApp.java new file mode 100644 index 0000000..b8db34e --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/InvoiceApp.java @@ -0,0 +1,45 @@ +public class InvoiceApp { + + public static Invoice invoice = new Invoice(); + + public static void main(String args[]) { + System.out.println("Welcome to the Invoice application\n"); + getLineItems(); + displayInvoice(); + } + + public static void getLineItems() { + String choice = "y"; + while (choice.equalsIgnoreCase("y")) { + String productCode = Console.getString("Enter product code: "); + int quantity = Console.getInt("Enter quantity: "); + + Product product = ProductDB.getProduct(productCode); + invoice.addItem(new LineItem(product, quantity)); + + choice = Console.getString("Another line item? (y/n): "); + System.out.println(); + } + } + + public static void displayInvoice() { + System.out.println("Invoice date: " + + invoice.getDateFormatted() + "\n"); + + String spec = "%-35s%7s%7s%12s%n"; + System.out.printf(spec, "Description", "Price", "Qty", "Total"); + System.out.printf(spec, "-----------", "-----", "---", "-----"); + + var lineItems = invoice.getLineItems(); + + for (LineItem lineItem : lineItems) { + Product product = lineItem.getProduct(); + System.out.printf("%-35s", product.getDescription()); + System.out.printf("%7s", product.getPriceFormatted()); + System.out.printf("%7d", lineItem.getQuantity()); + System.out.printf("%12s%n", lineItem.getTotalFormatted()); + } + System.out.printf("%nINVOICE TOTAL:%47s%n%n", + invoice.getTotalFormatted()); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/LineItem.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/LineItem.java new file mode 100644 index 0000000..29d7cf2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/LineItem.java @@ -0,0 +1,58 @@ +import java.text.NumberFormat; + +public class LineItem { + + private Product product; + private int quantity; + private double total; + + public LineItem() { + this.product = new Product(); + this.quantity = 0; + this.total = 0; + } + + public LineItem(Product product, int quantity) { + this.product = product; + this.quantity = quantity; + this.calculateTotal(); + } + + public void setProduct(Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public int getQuantity() { + return quantity; + } + + public String getQuantityFormatted() { + NumberFormat number = NumberFormat.getNumberInstance(); + return number.format(quantity); + } + + public void setTotal(double total) { + this.total = total; + } + + public double getTotal() { + return total; + } + + public void calculateTotal() { + total = quantity * product.getPrice(); + } + + public String getTotalFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(total); + } +} diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Product.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Product.java new file mode 100644 index 0000000..14e5142 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/Product.java @@ -0,0 +1,50 @@ +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + code = ""; + description = ""; + price = 0; + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/ProductDB.java b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/ProductDB.java new file mode 100644 index 0000000..40487c0 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex1_Invoice/src/ProductDB.java @@ -0,0 +1,28 @@ +public class ProductDB { + + public static Product getProduct(String productCode) { + // In a more realistic application, this code would + // get the data for the product from a file or database + // For now, this code just uses if/else statements + // to return the correct product + + // create the Product object + Product product = new Product(); + + // fill the Product object with data + product.setCode(productCode); + if (productCode.equalsIgnoreCase("java")) { + product.setDescription("Murach's Java Programming"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("jsp")) { + product.setDescription("Murach's Java Servlets and JSP"); + product.setPrice(57.50); + } else if (productCode.equalsIgnoreCase("mysql")) { + product.setDescription("Murach's MySQL"); + product.setPrice(54.50); + } else { + product.setDescription("Unknown"); + } + return product; + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/build.xml b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/build.xml new file mode 100644 index 0000000..d84a5bd --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch18_ex2_AgeCalculator. + + + diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/manifest.mf b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/build-impl.xml new file mode 100644 index 0000000..259b198 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/build-impl.xml @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/genfiles.properties new file mode 100644 index 0000000..ddce952 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=e54453a1 +build.xml.script.CRC32=bc94d00b +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=3bcf1555 +nbproject/build-impl.xml.script.CRC32=d1426e70 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.properties new file mode 100644 index 0000000..02d664c --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.properties @@ -0,0 +1,8 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +file.reference.ch12_AgeCalculator-src=C:\\murach\\java\\netbeans\\ex_starts\\ch14_ex2_AgeCalculator\\src +javac.debug=true +javadoc.preview=true +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.properties b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.properties new file mode 100644 index 0000000..cbf07d7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.properties @@ -0,0 +1,81 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch18_ex2_AgeCalculator +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch18_ex2_AgeCalculator.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.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=AgeCalculatorApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.xml b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.xml new file mode 100644 index 0000000..9b677c9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch18_ex2_AgeCalculator + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java new file mode 100644 index 0000000..64798f5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch18_ex2_AgeCalculator/src/AgeCalculatorApp.java @@ -0,0 +1,28 @@ +import java.util.Scanner; + +public class AgeCalculatorApp { + + public static void main(String[] args) { + System.out.println("Welcome to the Age Calculator\n"); + + // Get the current date + + // Get input from the the user + Scanner sc = new Scanner(System.in); + System.out.print("Enter your date of birth (YYYY-MM-DD): "); + String dateOfBirthString = sc.nextLine(); + System.out.println(); + + // Get and validate user's date of birth + + // If user's date of birth is valid + // Format and print user's date of birth + System.out.println("Your date of birth is "); + + // Format and print the current date + System.out.println("The current date is "); + + // Calculate and print the user's age + System.out.println("Your age is "); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step05.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step05.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step05.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step06.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step06.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step06.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step07.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step07.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step07.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step08.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step08.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step08.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step09.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step09.sql new file mode 100644 index 0000000..ec85e84 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step09.sql @@ -0,0 +1 @@ +Save SQL statement here. \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step10.sql b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step10.sql new file mode 100644 index 0000000..c9c44c4 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex1_SQLStatements/Step10.sql @@ -0,0 +1 @@ +Save SQL statement here \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/build.xml b/murach/netbeans/ex_starts/ch19_ex2_DBTester/build.xml new file mode 100644 index 0000000..aedd68a --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch19_ex2_DBTester. + + + diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/manifest.mf b/murach/netbeans/ex_starts/ch19_ex2_DBTester/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/build-impl.xml new file mode 100644 index 0000000..9c0bb0c --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/build-impl.xml @@ -0,0 +1,1396 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/genfiles.properties new file mode 100644 index 0000000..ccc5b7e --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1500b24a +build.xml.script.CRC32=64080728 +build.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=1527db2a +nbproject/build-impl.xml.script.CRC32=8c25191b +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.properties new file mode 100644 index 0000000..319121d --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.properties @@ -0,0 +1,10 @@ +application.args= +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +file.reference.ch22_DBTester-src=C:\\murach\\java\\netbeans\\ex_starts\\ch21_ex1_DBTester\\src +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.xml new file mode 100644 index 0000000..6807a2b --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.properties b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.properties new file mode 100644 index 0000000..90f8ab8 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.properties @@ -0,0 +1,86 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +application.args= +application.title=ch19_ex2_DBTester +application.vendor=Joel Murach +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 +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch19_ex2_DBTester.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.sqlite-jdbc.jar=../../../db/sqlite-jdbc.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.sqlite-jdbc.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=11 +javac.target=11 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch19_ex2_DBTester +main.class=DBTesterApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.xml b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.xml new file mode 100644 index 0000000..3564b94 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.java.j2seproject + + + ch19_ex2_DBTester + 1.6.5 + + + + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/products.sqlite b/murach/netbeans/ex_starts/ch19_ex2_DBTester/products.sqlite new file mode 100644 index 0000000..dd08323 Binary files /dev/null and b/murach/netbeans/ex_starts/ch19_ex2_DBTester/products.sqlite differ diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java new file mode 100644 index 0000000..4f0c0ec --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/DBTesterApp.java @@ -0,0 +1,103 @@ +import java.sql.*; + +public class DBTesterApp { + + private static Connection connection; + + public static void main(String args[]) { + // open connection + try { + String dbUrl = "jdbc:sqlite:products.sqlite"; + connection = DriverManager.getConnection(dbUrl); + } catch (SQLException e) { + System.err.println(e); + return; + } + + // select data from database + printProducts(); + printFirstProduct(); + printProductByCode("jsp"); + + // modify data in the database + Product p = new Product("test", "Test Product", 49.50); + insertProduct(p); + printProducts(); + deleteProduct(p); + printProducts(); + + // close connection + try { + connection.close(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printProducts() { + try (Statement statement = connection.createStatement(); + ResultSet rs = statement.executeQuery("SELECT * FROM Products")) { + Product p; + + System.out.println("Product list:"); + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + p = new Product(code, description, price); + + printProduct(p); + } + System.out.println(); + } catch (SQLException e) { + System.out.println(e); + } + } + + public static void printFirstProduct() { + Product p = new Product(); + + // add code that prints the record for the first product in the Products table + System.out.println("First product:"); + printProduct(p); + System.out.println(); + } + + public static void printProductByCode(String productCode) { + Product p = new Product(); + + // add code that prints the product with the specified code + System.out.println("Product by code: " + productCode); + printProduct(p); + System.out.println(); + } + + public static void insertProduct(Product p) { + System.out.println("Insert test: "); + + // add code that inserts the specified product into the database + // if a product with the specifed code already exists, display an error message + printProduct(p); + System.out.println(); + } + + private static void deleteProduct(Product p) { + System.out.println("Delete test: "); + + // add code that deletes the specified product from the database + // if a product with the specified code doesn't exist, display an error message + printProduct(p); + System.out.println(); + } + + // use this method to print a Product object on a single line + private static void printProduct(Product p) { + String productString + = StringUtil.padWithSpaces(p.getCode(), 12) + + StringUtil.padWithSpaces(p.getDescription(), 38) + + p.getFormattedPrice(); + + System.out.println(productString); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/Product.java b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/Product.java new file mode 100644 index 0000000..22119c2 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/Product.java @@ -0,0 +1,67 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getFormattedPrice() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } + + public boolean equals(Object object) { + if (object instanceof Product) { + Product product2 = (Product) object; + if (code.equals(product2.getCode()) + && description.equals(product2.getDescription()) + && price == product2.getPrice()) { + return true; + } + } + return false; + } + + public String toString() { + return "Code: " + code + "\n" + + "Description: " + description + "\n" + + "Price: " + this.getFormattedPrice() + "\n"; + } +} diff --git a/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/StringUtil.java b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/StringUtil.java new file mode 100644 index 0000000..518cb2e --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex2_DBTester/src/StringUtil.java @@ -0,0 +1,16 @@ + + +public class StringUtil { + + public static String padWithSpaces(String s, int length) { + if (s.length() < length) { + StringBuilder sb = new StringBuilder(s); + while (sb.length() < length) { + sb.append(" "); + } + return sb.toString(); + } else { + return s.substring(0, length); + } + } +} diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/build.xml b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/build.xml new file mode 100644 index 0000000..2b11d58 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch21_ProductManager. + + + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/manifest.mf b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbbuild.xml b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbbuild.xml new file mode 100644 index 0000000..347d2b7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbbuild.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project ch19_ex3_ProductManager. + + + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/build-impl.xml b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/build-impl.xml new file mode 100644 index 0000000..3a7dc3b --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/build-impl.xml @@ -0,0 +1,1757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/genfiles.properties b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/genfiles.properties new file mode 100644 index 0000000..b5bf0e3 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +nbbuild.xml.data.CRC32=10448e8c +nbbuild.xml.script.CRC32=8f636fe9 +nbbuild.xml.stylesheet.CRC32=f85dc8f2@1.100.0.48 +# 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=10448e8c +nbproject/build-impl.xml.script.CRC32=e5c6b2d4 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.100.0.48 diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/config.properties b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.properties b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.properties new file mode 100644 index 0000000..e8964ee --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.properties @@ -0,0 +1,8 @@ +compile.on.save=false +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false +user.properties.file=C:\\Users\\Joel\\AppData\\Roaming\\NetBeans\\12.5\\build.properties diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.xml b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.xml new file mode 100644 index 0000000..4750962 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/private/private.xml @@ -0,0 +1,4 @@ + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.properties b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.properties new file mode 100644 index 0000000..4ff8038 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.properties @@ -0,0 +1,93 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=ch19_ex3_ProductManager +application.vendor=Joel Murach +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 +buildfile=nbbuild.xml +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/ch19_ex3_ProductManager.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.ch21_ProductMaint-DBTester=DBTester +file.reference.ch21_ProductMaint-ProductMaintenance=ProductMaintenance +file.reference.sqlite-jdbc.jar=../../../db/sqlite-jdbc.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.sqlite-jdbc.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=false +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jlink.launcher=false +jlink.launcher.name=ch19_ex3_ProductManager +main.class=ProductManagerApp +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 +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.src.dir=src diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.xml b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.xml new file mode 100644 index 0000000..77c6ece --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/nbproject/project.xml @@ -0,0 +1,13 @@ + + + org.netbeans.modules.java.j2seproject + + + ch19_ex3_ProductManager + + + + + + + diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/products.sqlite b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/products.sqlite new file mode 100644 index 0000000..4e159f8 Binary files /dev/null and b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/products.sqlite differ diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Console.java b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Console.java new file mode 100644 index 0000000..57ae22f --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Console.java @@ -0,0 +1,57 @@ +import java.util.Scanner; + +public class Console { + + private static final Scanner sc = new Scanner(System.in); + + public static String getString(String prompt) { + System.out.print(prompt); + return sc.nextLine(); + } + + public static int getInt(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Integer.parseInt(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static int getInt(String prompt, int min, int max) { + while (true) { + int value = getInt(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } + + public static double getDouble(String prompt) { + while (true) { + System.out.print(prompt); + try { + return Double.parseDouble(sc.nextLine()); + } catch(NumberFormatException e) { + System.out.println("Error! Invalid integer value."); + } + } + } + + public static double getDouble(String prompt, double min, double max) { + while (true) { + double value = getDouble(prompt); + if (value > min && value < max) { + return value; + } else { + System.out.println("Error! Number must be greater than " + + min + " and less than " + max + "."); + } + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Product.java b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Product.java new file mode 100644 index 0000000..9bb48e9 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/Product.java @@ -0,0 +1,49 @@ + + +import java.text.NumberFormat; + +public class Product { + + private String code; + private String description; + private double price; + + public Product() { + this("", "", 0); + } + + public Product(String code, String description, double price) { + this.code = code; + this.description = description; + this.price = price; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCode() { + return code; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getPrice() { + return price; + } + + public String getPriceFormatted() { + NumberFormat currency = NumberFormat.getCurrencyInstance(); + return currency.format(price); + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java new file mode 100644 index 0000000..f906acf --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductDB.java @@ -0,0 +1,109 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; + +public class ProductDB { + + private static Connection getConnection() throws SQLException { + String dbUrl = "jdbc:sqlite:products.sqlite"; + Connection connection = DriverManager.getConnection(dbUrl); + return connection; + } + + public static ArrayList getAll() { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products ORDER BY ProductCode ASC"; + var products = new ArrayList(); + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql); + ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + String code = rs.getString("ProductCode"); + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + + Product p = new Product(code, description, price); + products.add(p); + } + return products; + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static Product get(String code) { + String sql = "SELECT ProductCode, Description, Price " + + "FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, code); + ResultSet rs = ps.executeQuery(); + if (rs.next()) { + String description = rs.getString("Description"); + double price = rs.getDouble("Price"); + Product p = new Product(code, description, price); + rs.close(); + return p; + } else { + rs.close(); + return null; + } + } catch (SQLException e) { + System.err.println(e); + return null; + } + } + + public static boolean add(Product p) { + String sql = "INSERT INTO Products (ProductCode, Description, Price) " + + "VALUES (?, ?, ?)"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.setString(2, p.getDescription()); + ps.setDouble(3, p.getPrice()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean delete(Product p) { + String sql = "DELETE FROM Products " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } + + public static boolean update(Product p) { + String sql = "UPDATE Products SET " + + " Description = ?, " + + " Price = ? " + + "WHERE ProductCode = ?"; + try (Connection connection = getConnection(); + PreparedStatement ps = connection.prepareStatement(sql)) { + ps.setString(1, p.getDescription()); + ps.setDouble(2, p.getPrice()); + ps.setString(3, p.getCode()); + ps.executeUpdate(); + return true; + } catch (SQLException e) { + System.err.println(e); + return false; + } + } +} \ No newline at end of file diff --git a/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java new file mode 100644 index 0000000..db8cef7 --- /dev/null +++ b/murach/netbeans/ex_starts/ch19_ex3_ProductManager/src/ProductManagerApp.java @@ -0,0 +1,69 @@ +import java.util.ArrayList; + +public class ProductManagerApp { + + public static void main(String args[]) { + System.out.println("Welcome to the Product Manager\n"); + displayMenu(); + + String action = ""; + while (!action.equalsIgnoreCase("exit")) { + action = Console.getString("Enter a command: "); + System.out.println(); + + switch (action) { + case "list" -> displayAll(); + case "add" -> addProduct(); + case "del", "delete" -> deleteProduct(); + case "help", "menu" -> displayMenu(); + case "exit" -> System.out.println("Bye.\n"); + default -> System.out.println("Error! Command not valid.\n"); + } + } + } + + public static void displayMenu() { + System.out.println("COMMAND MENU"); + System.out.println("list - List all products"); + System.out.println("add - Add a product"); + System.out.println("del - Delete a product"); + System.out.println("help - Show this menu"); + System.out.println("exit - Exit this application\n"); + } + + public static void displayAll() { + System.out.println("PRODUCT LIST"); + + ArrayList products = ProductDB.getAll(); + String format = "%-8s%-40s%10s%n"; + for (Product p : products) { + System.out.printf(format, + p.getCode(), p.getDescription(), p.getPriceFormatted()); + } + System.out.println(); + } + + public static void addProduct() { + String code = Console.getString("Enter product code: "); + String description = Console.getString("Enter product description: "); + double price = Console.getDouble("Enter price: "); + + Product product = new Product(code, description, price); + ProductDB.add(product); + + System.out.println(description + " has been added.\n"); + } + + public static void deleteProduct() { + String code = Console.getString("Enter product code: "); + + Product product = ProductDB.get(code); + if (product == null) { + System.out.println("No product matches that code.\n"); + return; + } + + ProductDB.delete(product); + System.out.println(product.getDescription() + " has been added.\n"); + } +} \ No newline at end of file