Advertisement
tero8dd

olio1

Oct 25th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace palkanLaskenta
  8. {
  9. class PalkLaskLuokka
  10. {
  11. private double m_tuntipalkka, m_tunnit, m_verop;
  12. private double brutto, verot, netto, x;
  13.  
  14. public void asetin(double i, double j, double k)
  15. {
  16. m_tuntipalkka = i;
  17. m_tunnit = j;
  18. m_verop = k;
  19. }
  20. public void laskeBrutto()
  21. {
  22. brutto = m_tunnit * m_tuntipalkka;
  23. }
  24. public void laskeVerot()
  25. {
  26. x = m_verop / 100;
  27. verot = brutto * x;
  28. }
  29. public void laskeNetto()
  30. {
  31. netto = brutto - verot;
  32. }
  33. public double palautaBrutto()
  34. {
  35. return brutto;
  36. }
  37. public double palautaVerot()
  38. {
  39. return verot;
  40. }
  41. public double palautaNetto()
  42. {
  43. return netto;
  44. }
  45. }
  46. class Program
  47. {
  48. static void Main(string[] args)
  49. {
  50. PalkLaskLuokka pkl = new PalkLaskLuokka();
  51. double tuntiplk, tunnit, verop;
  52.  
  53. Console.WriteLine("Syötä tuntipalkkasi: ");
  54. tuntiplk = Double.Parse(Console.ReadLine());
  55. Console.WriteLine("Syötä tuntimääräsi: ");
  56. tunnit = Double.Parse(Console.ReadLine());
  57. Console.WriteLine("Syötä veroprosenttisi: ");
  58. verop = Double.Parse(Console.ReadLine());
  59.  
  60. pkl.asetin(tuntiplk, tunnit, verop);
  61. pkl.laskeBrutto();
  62. pkl.laskeVerot();
  63. pkl.laskeNetto();
  64. Console.WriteLine("Bruttopalkkasi = {0}e\nVerosi = {1}e\nNettopalkkasi = {2}e", pkl.palautaBrutto(), pkl.palautaVerot(), pkl.palautaNetto());
  65. Console.ReadLine();
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement