Skip to content

Task 19 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
target/
*.iml
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/1_Basics_of_software_code_development.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Task1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
target/
*.iml
15 changes: 15 additions & 0 deletions Task1/Task1.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
24 changes: 24 additions & 0 deletions Task1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>Basic</groupId>
<artifactId>Task#1</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>7</source>
<target>7</target>
</configuration>
</plugin>
</plugins>
</build>


</project>
23 changes: 23 additions & 0 deletions Task1/src/main/java/Task_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;

import java.util.Scanner;

public class Task_1 {

//1. Найдите значение функции: z = ((a – 3 )*b/2) + c.
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);
double a, b, c;
System.out.println("Enter value of a");
a = scanner.nextDouble();
System.out.println("Enter value of b");
b = scanner.nextDouble();
System.out.println("Enter value of c");
c = scanner.nextDouble();
double z = ((a - 3) * b / 2) + c;
System.out.println("The Result is = " + z);
scanner.close();
}
}
62 changes: 62 additions & 0 deletions Task1/src/main/java/by/learn/CheckLiterals.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package by.learn;

public class CheckLiterals {

public static void main(String[] args) {

// УРОК Arithmetics и привдение типов
int x = 8;
int y = 5;
int z = x / y; //1 если выходит дробная то обрезается до дробной
z = x % y; //3 остаток от деления тоже целочисленный

// С константами не нужно привдение типов
final byte a = 1;
final byte b = 2;
byte c = (a+b);

// Без констант нужно явное приведение типов
byte a1 = 1;
byte b1 =2;
byte c1 =(byte) (a1+b1);
//******************************************************************
// Унарные операторы или арифметические/ Постфиксный и префиксный инкремент
//*******************************************************************
int x1 = 1;
x1++; //2 Постфиксный инкремент
++x1; // Префиксный инкремент
x = x + 1; //3

// Деление на 0

double b2 = 0.; // Да так можно, просто точку после 0
double a2 = 1/b2; //
System.out.println(a2); // Infinity

// Не число
double z1 = Math.sqrt(-1); // извлечем квадратный корень из -1
System.out.println(z1); // NaN


















}
}




Loading