Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 25th, 2012, 10:03 AM
blaze blaze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 blaze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 59 m 42 sec
Reputation Power: 0
[Help]UserInput wuth Object

Hello i'm a new to this forum and i will ask for some help with this code
Code:
class Employee
{
	private String Eponymia;
	private String AFM;
	private int Meres_Ergasias;
	private double Hmeromisthio;
	private float Yperories;
	private float Syntelestis_Kratiseon;

	private double akatharistos;
	private double kratisis;
	private double katharos;
	
	//SET
	void setEponymia(String i)
	{
		Eponymia = i;
	}
	void setAFM(String i)
	{
		AFM = i;
	}
	void setMeres_Ergasias(int i)
	{
		Meres_Ergasias = i;
	}
	void setHmeromisthio(double i)
	{
		Hmeromisthio = i;
	}
	void setYperories(float i)
	{
		Yperories = i;
	}
	void setSyntelestis_Kratiseon(float i)
	{
		Syntelestis_Kratiseon = i;
	}
	
	//GET
	String getEponymia()
	{
		return Eponymia;
	}
	String getAFM()
	{
		return AFM;
	}
	int getMeres_Ergasias()
	{
		return Meres_Ergasias;
	}
	double getHmeromisthio()
	{
		return Hmeromisthio;
	}
	float getYperories()
	{
		return Yperories;
	}
	float getSyntelestis_Kratiseon()
	{
		return Syntelestis_Kratiseon;
	}
	
	//methods
	double Akatharistos_Misthos()
	{
		akatharistos = Meres_Ergasias * Hmeromisthio + 0.2 * Hmeromisthio * Yperories;
		return akatharistos;
	}
	
	double Poso_Kratiseon()
	{
		kratisis = Akatharistos_Misthos() * Syntelestis_Kratiseon;
		return kratisis;
	}
	
	double Katharos_Misthos()
	{
		katharos = Akatharistos_Misthos() - Poso_Kratiseon();
		return katharos;
	}
}
class TestEmployee
{
	public static void main(String args[])
	{
		Employee mybox1 = new Employee();
		
		double aka;
		double kath;
		double krat;
		
		mybox1.setEponymia("Nikos Nikas");
		mybox1.setAFM("123456789");
		mybox1.setMeres_Ergasias(25);
		mybox1.setHmeromisthio(80);
		mybox1.setYperories(3.5f);
		mybox1.setSyntelestis_Kratiseon(0.28f);
		
		aka = mybox1.Akatharistos_Misthos();
		kath = mybox1.Katharos_Misthos();
		krat = mybox1.Poso_Kratiseon();
		
		System.out.println("");
		System.out.println("                Karta Ypalilou               ");
		System.out.println("---------------------------------------------");
		System.out.println("Eponimia Eterias = " + mybox1.getEponymia());
		System.out.println("AFM = " + mybox1.getAFM());
		System.out.println("Eponimia = " + mybox1.getMeres_Ergasias());
		System.out.println("Hmeromisthio = " + mybox1.getHmeromisthio());
		System.out.println("Yperories = " + mybox1.getYperories());
		System.out.println("Syntelestis Kratiseon = " + mybox1.getSyntelestis_Kratiseon());
		System.out.println("---------------------------------------------");
		System.out.println("O akatharistos einai = " + aka);
		System.out.println("Oi kratisis einai = " + krat);
		System.out.println("O katharos einai = " + kath);
		System.out.println("---------------------------------------------");
	}
}


I want this code with UserInput(UserInput.getString()) and Object

Like that
Code:
class Employee
{
	private String Eponymia;
	private String AFM;
	private int Meres_Ergasias;
	private double Hmeromisthio;
	private float Yperories;
	private float Syntelestis_Kratiseon;

	private double akatharistos;
	private double kratisis;
	private double katharos;
	
	//SET
	void setEponymia(String i)
	{
		Eponymia = i;
	}
	void setAFM(String i)
	{
		AFM = i;
	}
	void setMeres_Ergasias(int i)
	{
		Meres_Ergasias = i;
	}
	void setHmeromisthio(double i)
	{
		Hmeromisthio = i;
	}
	void setYperories(float i)
	{
		Yperories = i;
	}
	void setSyntelestis_Kratiseon(float i)
	{
		Syntelestis_Kratiseon = i;
	}
	
	//GET
	String getEponymia()
	{
		return Eponymia;
	}
	String getAFM()
	{
		return AFM;
	}
	int getMeres_Ergasias()
	{
		return Meres_Ergasias;
	}
	double getHmeromisthio()
	{
		return Hmeromisthio;
	}
	float getYperories()
	{
		return Yperories;
	}
	float getSyntelestis_Kratiseon()
	{
		return Syntelestis_Kratiseon;
	}
	
	//methods
	double Akatharistos_Misthos()
	{
		akatharistos = Meres_Ergasias * Hmeromisthio + 0.2 * Hmeromisthio * Yperories;
		return akatharistos;
	}
	
	double Poso_Kratiseon()
	{
		kratisis = Akatharistos_Misthos() * Syntelestis_Kratiseon;
		return kratisis;
	}
	
	double Katharos_Misthos()
	{
		katharos = Akatharistos_Misthos() - Poso_Kratiseon();
		return katharos;
	}
}
class TestEmployee
{
	public static void main(String args[])
	{
		System.out.println("Eponymia: ");
		String Eponymia = UserInput.getString();
		
		System.out.println("AFM: ");
		String AFM = UserInput.getString();
		
		System.out.println("Meres Ergasias: ");
		int Meres_Ergasias = UserInput.getInteger();
		
		Employee mybox1 = new Employee();
		
		double aka;
		double kath;
		double krat;
		
		mybox1.setEponymia(Eponymia);
		mybox1.setAFM(AFM);
		mybox1.setMeres_Ergasias(Meres_Ergasias);
		mybox1.setHmeromisthio(80);
		mybox1.setYperories(3.5f);
		mybox1.setSyntelestis_Kratiseon(0.28f);
		
		aka = mybox1.Akatharistos_Misthos();
		kath = mybox1.Katharos_Misthos();
		krat = mybox1.Poso_Kratiseon();
		
		System.out.println("");
		System.out.println("                Karta Ypalilou");
		System.out.println("---------------------------------------------");
		System.out.println("Eponimia Eterias = " + mybox1.getEponymia());
		System.out.println("AFM = " + mybox1.getAFM());
		System.out.println("Eponimia = " + mybox1.getMeres_Ergasias());
		System.out.println("Hmeromisthio = " + mybox1.getHmeromisthio());
		System.out.println("Yperories = " + mybox1.getYperories());
		System.out.println("Syntelestis Kratiseon = " + mybox1.getSyntelestis_Kratiseon());
		System.out.println("---------------------------------------------");
		System.out.println("O akatharistos einai = " + aka);
		System.out.println("Oi kratisis einai = " + krat);
		System.out.println("O katharos einai = " + kath);
		System.out.println("---------------------------------------------");
	}
}


But i couldn't finish it :P

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > [Help]UserInput wuth Object


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap