Skip to content
Snippets Groups Projects
Commit c4aac865 authored by Rasmus Makinen's avatar Rasmus Makinen
Browse files

Teht 1 tehty

parent eeceeda2
No related branches found
No related tags found
No related merge requests found
# Default ignored files
/shelf/
/workspace.xml
<component name="libraryTable">
<library name="KotlinJavaRuntime">
<CLASSES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-stdlib-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-reflect-sources.jar!/" />
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-test-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Java/Java.iml" filepath="$PROJECT_DIR$/Java/Java.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/ooj-harj2.iml" filepath="$PROJECT_DIR$/.idea/ooj-harj2.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?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$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?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="jdk" jdkName="15" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>
\ No newline at end of file
public class Employee {
private String nimi;
private String email;
private int id;
private deskSpot paikka;
/**
*Employeen konstruktori luo desktop tyyppisen olion ja asettaa sen arvon paikka
* muuttujaan. asettaa myös arvot nimi, email ja luo idn funktiolla createId. appendaa
* uudenn olion employees listaan ja tarkistaa onko siinä yli 1000 alkiota
*
* @pre Object.isString(nimi)
* Object.isString(email)
* Integer.isInteger(id)
* paikka != null
* Integer.toString(Ykoord).length()==2
* @post employees.size() <=1000&&
*
*/
public Employee(String nimi, String email, int id,int Xkoord, int Ykoord ) {
}
/**
*kutsuu setXkoord ja setYkoord metodeja. Niiden avulla"vaihtaa" työpaikkaa
* @pre Ykoord != null&&
* Xkoord != null
* @post Integer.isInteger(Ykoord)&&
* Integer.isInteger(Xkoord)&&
* Integer.toString(Ykoord).length()==2
*
*
*/
Void setDeskSpot(int Ykoord, int Xkoord)
/**
*palauttaa työntekijän työpisteen koordinaatit X akselin kirjaimena ja Y akselin
* lukuna
* @pre työntekijä!=null
*
* @post Charachter.isLetter(Xkoord)&&
* Integer.isInteger(Ykoord)&&
* Integer.toString(Ykoord).length()==2
*
*/
int getDeskSpot(Työntekijä työntekijä)
/**
*luo 8 numeron mittaisen id:n
* @pre true
* @post id !=null &&
* FORALL (i:employees.työntekijät.id:i!=id)&&
* id.length()==8
*
*/
Int createId()
}
public class Employees {
/**
*
* @pre
* @post
*/
Void changeDeskSpot(Employee employee, Koordinaatit deskSpot )
Arraylist employees= (employee) //(max pituus 1000)
/**
* etsii employees listasta henkilön jolla on inputin id
* @pre Integer.isInteger(id)&&
*
* @post employee.id==id
*/
Employee etsiEmployee(String id)
/**
*etsii employees listasta inputin nimisen henkilön
* @pre Object.isString(nimi)
* @post employee.nimi==nimi
*/
Employee etsiEmployee(String nimi)
}
public class deskSpot {
int Xkoord;
int Ykoord;
public deskSpot(int xkoord, int ykoord) {
}
/**
* palauttaa X koordinaatin
* @pre true
* @post Integer.isInteger(Ykoord)&&
*
*/
public int getXkoord() {
}
/**
* muuttaa X koordinaatin
* @pre true
* @post Integer.isInteger(Xkoord)&&
*/
public void setXkoord(int xkoord) {
}
/**
* palauttaa Y koordinaatin
* @pre true
* @post Integer.isInteger(Ykoord) &&
* Integer.toString(Ykoord).length()==2
*/
public int getYkoord() {
}
/**
* muuttaa Y koordinaatin
* @pre true
* @post Integer.isInteger(Ykoord)&&
* Integer.toString(Ykoord).length()==2
*/
public void setYkoord(int ykoord) {
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment