Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Progi / lesson 5 / 2a Java

.txt
Скачиваний:
27
Добавлен:
28.03.2015
Размер:
1.22 Кб
Скачать
/*
* 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 laba2;

/**
*
* @author st
*/

import java.util.Scanner;


import java.io.*; // подключение библиотеки ввода-вывода на java
import java.lang.Math.*;


public class Laba2 //****Class Кошелёк
{
public int first;
public double second;
static double chis;

public void Init(int f,double s)
{
first=f;
second=s;
}
static double Summa(Laba2 a)
{
double z;
z=a.first*a.second;

if(z>=30)
{
return (a.first+20)*a.second;
}
else
{
return a.first*a.second;
}

}

public int GetFirst()
{
return first;
}
public double GetSecond()
{
return second;
}

public static void main (String args[] )
{
Laba2 a= new Laba2();
Laba2 b=new Laba2();
double k,m;
a.Init(2,5);
b.Init(5,5);
a.chis=3;
k=Laba2.Summa(a);
System.out.printf("ответ %f\n",k);
}
}
Соседние файлы в папке lesson 5