GVA SUPPORT

Відповідь на запитання № 1552388623
Text:
	ФІО = OAL

 Запитання:Шановні колеги, скажіть будь ласка ...
Щось

package lab6;

public class L6T2 {

/*С помощью тернарного оператора 
 * определить, четным или нечетным 
 * является заданное целое число.	
	
*/	
	public static void main(String args[]) {
		int i;
		i = 102;
		if (i % 2 == 0) 
		{
		System.out.println("Число Х = "+ i+ " четное");
		}
		else{ System.out.println("Число Х =" + i+ " не четное");}
		}
		}
----------------------------------------------
package lab6;

public class L6T2 {

/*С помощью тернарного оператора 
 * определить, четным или нечетным 
 * является заданное целое число.	
	
*/	
	public static void main(String args[]) {
		int x;
		int i = 10;
		x=(i % 2 == 0?1:0);
		if (x==1){
		System.out.println("Число Х = "+ i + " четное");}
		else{System.out.println("Число Х =" + i+ " не четное");
	}
	}
}
---------------------------
	package lab6;

public class L6T3 {
/*
 С помощью тернарного оператора 
 найти наибольшее из трех заданных чисел.
 */

	public static void main(String[] args) {
		int a, b, c,x;
		a = 20;
		b =60;
		c = 100;
		x=(a > b && a>c ?1:0);
		if (x==1)
		{System.out.println("Max from a, b, c is a: "+ a );}
		else{x=b > c?1:0;
		if (x==1) {
			System.out.println("Max from a, b, c is b: "+ b );
	}	
		else
			{System.out.println("Max from a, b, c is c: "+ c );
			}
		}	
	}
}
	
------------------------------------------------------
package lab6;

public class L6T3 {
/*
 С помощью тернарного оператора 
 найти наибольшее из трех заданных чисел.
 */

	public static void main(String[] args) {
		int a, b, c,max, min;
		a = 20;
		b =100;
		c = 10;
//char A,B,C, MAX;
		
		
		max = (a > b) ? (a > c ? a : c ): (b > c ? b : c);
		{System.out.println("Max from A, B, C is : "+ max );}
----------------------------------------------------
package lab6;

public class L6T4 {
/*
 * С помощью оператора if...else определить, попадает ли точка с координатами (x, y) в заштрихованую область
на рисунке
 */
	
	public static void main(String[] args) {
	double x, y, a;	
	x = 8;
	y = 5 ;                                        ;
	//y= - x+1;
	a = Math.sqrt(1-x*x);
	System.out.println("a = "+a);
	if (y >= (-x+1)&& y<=a  ){
		System.out.println("Точка А("+x+","+y+") входит в область");} else {
			System.out.println("Точка А("+x+","+ y+") не входит в область");
		}
	}
}
	

		
		
		
		min = a < b ? (a < c ? a : c) : (b < c ? b : c);			
			}
			
	}

	
	
	





====================================


 ANSWER ====================================

Ваша вpackage Lab7;

public class L7T1 {
/*Создать класс, а в нем метод с параметром – 
 * целым числом. Этот метод возводит число-параметр 
 * в квадрат, если оно положительное и вызывает 
 * исключение, если параметр меньше или равен нулю.
 *  Указанное исключение необходимо создать
 *   самостоятельно и вызывать его в методе с 
 *   помощью throw и throws. Исключение должно 
 *   обрабатываться в методе main и выдавать 
 *   сообщение Это мое исключение!. При обработке 
 *   исключения в блоке finally выводить сообщение 
 *   Исключения отработаны!
 * 
 */
	
		
	static public int  exep(int par)
	{
		
		tif (par > 0){
				par = par*par;
				System.out.println("par= "+ par );
			}
		}
		else
		{
			
			System.out.println("Значение должно быть положительным");}
		}
		return par;
	}
	
	public static void main(String[] args) {
	int a;
		a=exep(-4);	
System.out.println("a= "+ a);
	}

}
ідповідь...


 END of ANSWER ====================================



 ANSWER ====================================

Ваша віpackage Lab7Threads;

public class Lab7Threads1 {

	public static void main(String[] args) {
		Thread t = Thread.currentThread();
		t.setName("The main thread");
		System.out. println("current thread: " + t);
		
		MyThread m1 = new MyThread(1000);
		MyThread m2 = new MyThread(1000);
		Thread t1 = new Thread(m1, "Thread 1");
		Thread t2 = new Thread(m2, "Thread 2");
		t1.start();
		t2.start();
		try {
			
				Thread.sleep(1000 * 10); 
		} 
		catch (InterruptedException e) {
			System.out.println("child interrupted");
		}
		m1.time += 250;
		m2.time -= 250;
		
	}

}

class MyThread implements Runnable {
	int time;
	MyThread(int time) {
		this.time = time;
	}
	public void run(){
		try {
			for (int i = 20; i > 0; i--) {
				System.out.println("" + i + " " + Thread.currentThread());
				Thread.sleep(time);
			} 
		} 
		catch (InterruptedException e) {
			System.out.println("child interrupted");
		}
		System.out.println("exiting child thread");
	}	
}
дповідь...


 END of ANSWER ====================================



 ANSWER ====================================

package Lab7Threads2;

class ThreadDemo implements Runnable {
	int time;
	String name;
	ThreadDemo(int time, String name) {
		this.time = time;
		this.name = name;
		
		Thread ct = Thread.currentThread();
		System.out.println("currentThread: " + ct);
		Thread t = new Thread(this, name);
		System.out.println("Thread created: " + t);
		t.start();
	}
public void run() {
	try {
		for (int i = 20; i > 0; i--) {
		System.out.println(name  + " " + i);
		Thread.sleep(time);
		} 
	}
	catch (InterruptedException e) {
		System.out.println("child interrupted");
	}
	System.out.println("exiting " + name );
}

public static void main(String args[]) {
	ThreadDemo t1  = new ThreadDemo(1000, "Thread 1");
	ThreadDemo t2  = new ThreadDemo(1000, "Thread 2");
	
	try {
		Thread.sleep(10 * 1000); 
	}
	catch (InterruptedException e) {
		System.out.println("main interrupted");
	}
	t1.time += 250;
	t2.time -= 250;
	
	System.out.println("exiting main thread");
	}
}
-------------------------------
package temp;

public class Z2A {

	public static void main(String[] args) {
		MyT Ct1 = new MyT();
		
		Thread t1 = new Thread(Ct1, "First Thread");
		
		t1.start();
		
		try {
			Thread.sleep(3000);
		}
		catch( InterruptedException e){
			System.out.println("interrupted");
		}
		System.out.println("First thread + slow, sleep +250, Second thread fast, sleep - 250");
		Ct1.time += 250;
		
		System.out.println("Main Thread exited");
	}

}

class MyT implements Runnable {
	int time = 1000;
	public void run() {
		Thread t = Thread.currentThread();
		try {
				for(int n = 10; n > 0; n--) {
				Thread.sleep(time);
				System.out.println("Thread	" + t.getName() + " " + n);
				}
			}
		catch (InterruptedException e) {
			System.out.println("interrupted");
		}
		System.out.println("Thread " + t.getName() + "exited");
	}
}



 END of ANSWER ====================================



 ANSWER ====================================

package L9;
/*Создать вектор, ввести в него пять целых чисел,
вывести содержимое вектора на экран. 
Добавить в вектор два числа между вторым и третьим, 
удалить предпоследнее число и 
снова вывести содержимое стека на экран в цикле.
 * 
 */
import java.util.Vector;
public class L9T1 {
int capacity = 5;
	public static void main(String[] args) {
		
		Vector<Integer> v = new Vector<>();
        v.add(20);
        v.add(30);
        v.add(40);
        v.add(-7);
        v.add(100);

        // ... Get element 0.
       // System.out.println(v.get(0));

        // ... Loop over all indexes, calling get.
        for (int i = 0; i < v.size(); i++) {
            int value = v.get(i);
            System.out.print(value+", ");
        }
	v.add(2, 55);
	v.add(5, 999);
		 System.out.println();
	 System.out.println("С добавленными в вектор два значения 55 и 999: ");
	// ... Loop over all indexes, calling get.
    for (int i = 0; i < v.size(); i++) {
        int value = v.get(i);
                       System.out.print(value+", "); 
	}
	v.remove(5);
	System.out.println();
	System.out.println("С удалением из вектора предпоследнего значения: ");
	for (int i = 0; i < v.size(); i++) {
    int value = v.get(i);
   
            System.out.print(value+", ");}
	}
 
}



 END of ANSWER ====================================



 ANSWER ====================================

package L11;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.applet.*;

public class Graphic extends Frame {
public Graphic(){
super("Графика");
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e){
System.exit(0);
}});
setSize(400,600);
setVisible(true);
}
public void paint(Graphics g) {

	g.drawLine (20, 30, 380, 30);
	g.drawLine (20, 40, 380, 40);
	g.setColor(Color.RED);
	 g.drawRect(20, 50, 360, 30);
	 g.fillRect(20, 50,360, 30);
     g.setColor(Color.black);
	g.drawRoundRect(20, 90, 360, 30, 5, 10);
	g. drawOval(20, 130, 150, 50);
	g. drawOval(180, 130, 50, 50);
	g.drawArc(250, 130, 90, 60, 0, 180);
	Font f=new Font("Arial", Font.ITALIC | Font.BOLD, 30); 
	g.setFont(f); 
	FontMetrics fm = g.getFontMetrics();
	g.setColor(Color.blue);
	g.drawString("SBP", 250, 180+fm.getHeight());
	g.setColor(Color.black);
	g.drawLine (20, 250, 70, 250);
	g.drawLine (70, 250, 70, 280);
	g.drawLine (70, 280, 180, 280);
	
}


public static void main(String[] args) {
new Graphic();
}
}



 END of ANSWER ====================================



 ANSWER ====================================

package L11;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.applet.*;

public class Graphic extends Frame {
public Graphic(){
super("Графика");
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e){
System.exit(0);
}});
setSize(400,600);
setVisible(true);
}
public void paint(Graphics g) {

	g.drawLine (20, 30, 380, 30);
	g.drawLine (20, 40, 380, 40);
	g.setColor(Color.RED);
	 g.drawRect(20, 50, 360, 30);
	 g.fillRect(20, 50,360, 30);
     g.setColor(Color.black);
	g.drawRoundRect(20, 90, 360, 30, 5, 10);
	g. drawOval(20, 130, 150, 50);
	g. drawOval(180, 130, 50, 50);
	g.drawArc(250, 130, 90, 60, 0, 180);
	Font f=new Font("Arial", Font.ITALIC | Font.BOLD, 30); 
	g.setFont(f); 
	FontMetrics fm = g.getFontMetrics();
	g.setColor(Color.blue);
	g.drawString("SBP", 250, 180+fm.getHeight());
	g.setColor(Color.black);
	g.drawLine (20, 250, 70, 250);
	g.drawLine (70, 250, 70, 280);
	g.drawLine (70, 280, 280, 280);
	g.drawLine (280, 300, 280, 320);
	g.drawLine (280, 320, 20, 250);
}


public static void main(String[] args) {
new Graphic();
}
}



 END of ANSWER ====================================



 ANSWER ====================================

Putin - sql lessons - https://www.youtube.com/c/ExcelStore excel training excel courses excel lessons sql training sql courses sql lessons


 END of ANSWER ====================================



 ANSWER ====================================

Ннаша компания доставит любую автозапчасть взжатый срок прямо к вам в дом купить автозапчасти бу : <a href=https://autocomponent63.ru/>производим автозапчасти</a>. 
Помимо желания предоставить колосольный ассортиментный выбор автомобильных аксессуаров, мы также постоянно работаем над возможностью легких и быстрых покупок у нас магазине. Из-за разнообразности размеров и видов авто каждой модели, сотрудники нашей фирмы завели поэтапную схему заявки. Таковым методом, мыможем исключить покупок и упущений несвоевременных автозапчастей. 
Выберите у нас запасные части и возьмите скидку в цене на дальнейший свой заказ!


 END of ANSWER ====================================



 ANSWER ====================================

 Springtime cleaning is not only  routine to remove  dirt  and also  filth.  However we  need to have to  perform an  review of  winter months  garments. From  excessive  factors to  eliminate, you  require to  tidy  as well as  figure out the  storage space.  Discard the  junk and give  on your own  an additional promise not to  conserve  needless  scrap.  Well-maintained the walls and ceilings,  clean the windows, let the  spring season  right into  your house, drive off the  inactivity. 
 
Cleaning in  New York City -  is actually the  regulation of  focused  companies for  spring season cleaning of  facilities and  nearby  locations,  and also  keeping cleanliness. The  blend of  top quality work  as well as  budget-friendly prices is a characteristic  attribute that distinguishes our cleaning company in the NJ cleaning services market. 
Our motto: " The very best  top quality -  small cost!" and you  could be  certain of that! In our  firm,  extremely  cost effective prices for all  sorts of cleaning services. 
We  promise you the  stipulation of  specialist  cleaning company at a  higher  degree.  Professionals  knowledgeably master the  approaches of  cleansing  along with the use of modern  sophisticated  tools  and also  focused chemicals. With all this, the  costs for our  companies are  a lot lower than the  primary cleaning  firms. 
 
 Purchasing such a  solution as "Spring Cleaning" in our  business, you  acquire the  opportunity of  high-grade cleaning of the adjacent  area of  your house.  Our company  supply cleaning where others  can easily  certainly not  adapt. We will  relate to you  even when you are at the  some others end of the world  as well as do the  cleansing at the  highest degree. Just give us a call. 
 
Housekeeping hotel Bococa  - <a href=https://springcleaning.pro>spring cleaning</a>


 END of ANSWER ====================================



 ANSWER ====================================

Наша компания занимается расскруткой продвижение сайта буржунет совершенно не дорого. В случае, если у вас существует свой бизнес, тогда рано или поздно вы лично осознаете, что без оптимизация и продвижение сайтов сшау вас нет возможности работать дальше. Сейчас фирма, которая подумывают о собственном будущем развитии, должна иметь веб-сайт для seo продвижение сайтов google.  продвижение англоязычного сайта в google- способ, используя который возможно приобретать новых покупателей, и дополнительно получить проценты, с тем чтобы рассказать об наличии вашей собственной производственной компании, её продуктах, функциях. Специализированная международная фирма сделать для вашей фирмы инструмент, с помощью которого вы сможете залучать правильных партнеров, получать прибыль и расти.Продающийся сайт- лицо фирмы, в связи с этим имеет значение, кому вы доверяете создание  своего веб страницы. Мы - команда профи, которые имеют    обширный  практический опыт    конструирования электронную коммерцию с нуля, направления, разработанного  типа. Сотрудники нашей фирмы неизменно действуем по результатом. Международная компания сумеет предоставить всем нашим заказчикам профессиональное сопровождение по доступной антикризисной расценке.Вы можете сделать заказ онлайн-визитку, рекламный сайт. Не сомневайтесь, что ваш портал будет разработан высококлассно, с разными самыми новыми технологиями.
 
 
<a href=https://apistudio.ru>продвижение сайта в топ сша</a>


 END of ANSWER ====================================



 ANSWER ====================================

General  specialist  New York 
 
The  part of General construction manhattan is to  transmit to the  consumer the  whole entire  establishment  in its entirety,  as well as not  such as  individually performed work. Of  certain  relevance  is actually the  duty of the  overall  professional  in the course of the  large  building and construction of  flats of  household  style,  commercial  complicateds,  industrial  locations. 
 
<b><a href=https://grandeurhillsgroup.com/>residential and commercial renovations</a>;</b> 
<u>Industrial  properties.</u> 
 
Today, the list of construction  companies  features  different  company  interior decoration. An  real estate investor  and also a  consumer  may spend a  considerable amount of time-solving on all  company  concerns. A more  logical solution is to entrust this  function to General  development NY.


 END of ANSWER ====================================



 ANSWER ====================================

&#1605;&#1575;&#1603;&#1583; &#1601;&#1608;&#1585;&#1603;&#1587;. https://sa.forex-is.com


 END of ANSWER ====================================



 ANSWER ====================================

Grafik forex online gratis dengan indikator. https://id.forex-is.com


 END of ANSWER ====================================



 ANSWER ====================================

<b>Nuru Massage: <a href=http://nuru-massage-ny.com>manhattan happy ending</a></b> 
 
We greet you!  Our firm those who make your   daily life easier.   Society  that  functional more than  15  years. 
 
Distinctive unusuality our  Swedish salon is not an enforced setting. We  advertise  social profiles to  create. 
 Provide for you try  some  method  massage techniques alreadytoday.   Our employees  looking forward to you in our salon.


 END of ANSWER ====================================



 ANSWER ====================================

<b><a href=https://eco-corporation.ru>Септик для дачи</a></b> 
 
Наша международная компания занимается не только лишь проектированием и сборкой, профессионалы дополнительно делают последующее сопровождение автономной канализации.
Дабы не ошибиться с выбором, рекомендуется учитывать характеристики самого дачи (либо коттеджа), габариты участка земли.
Автономная канализация - наиболее востребованная часть технических коммуникаций
Высококачественное сопровождение
Септики - это несложная сборка с специфической конструкцией перелива, фильтрации и сложной электроникой



 END of ANSWER ====================================

	
Ваша відповідь