Created
April 15, 2021 23:32
-
-
Save jakobniinja/83a68387b56a41aba3d2ec660a97500d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default ignored files | |
/shelf/ | |
/workspace.xml | |
# Datasource local storage ignored files | |
/../../../../../../../:\Users\Jakob\Downloads\spring-boot-rock-paper-scissors-swing-gui-master\MobilAb\.idea/dataSources/ | |
/dataSources.local.xml | |
# Editor-based HTTP Client requests | |
/httpRequests/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="Encoding"> | |
<file url="PROJECT" charset="UTF-8" /> | |
</component> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectKey"> | |
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" /> | |
</component> | |
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" default="true" project-jdk-name="15" project-jdk-type="JavaSDK"> | |
<output url="file://$PROJECT_DIR$/out" /> | |
</component> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ProjectModuleManager"> | |
<modules> | |
<module fileurl="file://$PROJECT_DIR$/MobilAb.iml" filepath="$PROJECT_DIR$/MobilAb.iml" /> | |
</modules> | |
</component> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<input-field default="com.company">IJ_BASE_PACKAGE</input-field> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="ChangeListManager"> | |
<list default="true" id="ee968b08-7feb-4721-80bc-d0d5c61b1d2d" name="Default Changelist" comment="" /> | |
<option name="SHOW_DIALOG" value="false" /> | |
<option name="HIGHLIGHT_CONFLICTS" value="true" /> | |
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | |
<option name="LAST_RESOLUTION" value="IGNORE" /> | |
</component> | |
<component name="FileTemplateManagerImpl"> | |
<option name="RECENT_TEMPLATES"> | |
<list> | |
<option value="Class" /> | |
</list> | |
</option> | |
</component> | |
<component name="GitSEFilterConfiguration"> | |
<file-type-list> | |
<filtered-out-file-type name="LOCAL_BRANCH" /> | |
<filtered-out-file-type name="REMOTE_BRANCH" /> | |
<filtered-out-file-type name="TAG" /> | |
<filtered-out-file-type name="COMMIT_BY_MESSAGE" /> | |
</file-type-list> | |
</component> | |
<component name="ProjectId" id="1rE3wrHG2Rc49QYGEe7GIwslkKt" /> | |
<component name="ProjectView"> | |
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5"> | |
<flattenPackages /> | |
<showMembers /> | |
<showModules /> | |
<showLibraryContents /> | |
<hideEmptyPackages /> | |
<abbreviatePackageNames /> | |
<autoscrollToSource /> | |
<autoscrollFromSource /> | |
<sortByType /> | |
</navigator> | |
<panes> | |
<pane id="Scope" /> | |
<pane id="PackagesPane" /> | |
<pane id="ProjectPane"> | |
<subPane> | |
<PATH> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="untitled104" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
</PATH_ELEMENT> | |
</PATH> | |
<PATH> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="untitled104" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
</PATH_ELEMENT> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="untitled104" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
</PATH_ELEMENT> | |
</PATH> | |
<PATH> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="untitled104" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
</PATH_ELEMENT> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="untitled104" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
</PATH_ELEMENT> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="src" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
</PATH_ELEMENT> | |
<PATH_ELEMENT> | |
<option name="myItemId" value="company" /> | |
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
</PATH_ELEMENT> | |
</PATH> | |
</subPane> | |
</pane> | |
</panes> | |
</component> | |
<component name="ProjectViewState"> | |
<option name="hideEmptyMiddlePackages" value="true" /> | |
<option name="showLibraryContents" value="true" /> | |
</component> | |
<component name="PropertiesComponent"> | |
<property name="WebServerToolWindowFactoryState" value="false" /> | |
<property name="aspect.path.notification.shown" value="true" /> | |
</component> | |
<component name="RunManager"> | |
<configuration name="Main" type="Application" factoryName="Application" temporary="true"> | |
<option name="MAIN_CLASS_NAME" value="SurfaBilligt" /> | |
<module name="MobilAb" /> | |
<RunnerSettings RunnerId="Run" /> | |
<ConfigurationWrapper RunnerId="Run" /> | |
<method v="2"> | |
<option name="Make" enabled="true" /> | |
</method> | |
</configuration> | |
<configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true"> | |
<option name="arquillianRunConfiguration"> | |
<value> | |
<option name="containerStateName" value="" /> | |
</value> | |
</option> | |
<option name="TEST_OBJECT" value="class" /> | |
<method v="2"> | |
<option name="Make" enabled="true" /> | |
</method> | |
</configuration> | |
<recent_temporary> | |
<list> | |
<item itemvalue="Application.Main" /> | |
</list> | |
</recent_temporary> | |
</component> | |
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> | |
<component name="TaskManager"> | |
<task active="true" id="Default" summary="Default task"> | |
<changelist id="ee968b08-7feb-4721-80bc-d0d5c61b1d2d" name="Default Changelist" comment="" /> | |
<created>1618527662452</created> | |
<option name="number" value="Default" /> | |
<option name="presentableId" value="Default" /> | |
<updated>1618527662452</updated> | |
<workItem from="1618527663577" duration="1563000" /> | |
</task> | |
<servers /> | |
</component> | |
<component name="TypeScriptGeneratedFilesManager"> | |
<option name="version" value="3" /> | |
</component> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 8 Hallon Student (fyra mån) | |
55 18 Vimla (två månader) | |
69 10 Penny Student (tre mån) | |
85 10 Mybeat (tre mån) | |
325 50 Comviq Standard (fast) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="JAVA_MODULE" version="4"> | |
<component name="NewModuleRootManager" inherit-compiler-output="true"> | |
<exclude-output /> | |
<content url="file://$MODULE_DIR$"> | |
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | |
</content> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
</module> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
public class SurfaBilligt { | |
public static void main(String[] args) throws FileNotFoundException { | |
var pris = new int[100]; | |
var Gb = new int[100]; | |
var namn = new String[100]; | |
Scanner fil = new Scanner(new File("abonnemang.txt")); | |
int n = 0; | |
while (fil.hasNextLine() && n <100){ | |
pris[n] = fil.nextInt(); | |
Gb[n] = fil.nextInt(); | |
namn[n] = fil.nextLine().trim(); | |
n++; | |
} | |
Scanner scan= new Scanner(System.in); | |
while(true){ | |
System.out.println("Antal Gb per månad: "); | |
if(!scan.hasNextInt()) | |
break; | |
int antalGb= scan.nextInt(); | |
int lägst = -1; | |
for(int i =0; i<n; i++ ) | |
if(Gb[i] >= antalGb && (lägst< 0 || pris[i] <pris[lägst] )) | |
lägst=i; | |
if(lägst>=0){ | |
System.out.println(namn[lägst] + " är billigast." + " pris: "+ pris[lägst] + "kr/mån"); | |
break; | |
} | |
else{ | |
System.out.println("inget abongemang passar, lägg till fler abonemang i abonemang.txt "); | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment