日考18
commit
b6cd18322a
|
@ -0,0 +1,43 @@
|
||||||
|
<?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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>day18</artifactId>
|
||||||
|
<groupId>com.bwie</groupId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>bwie-test</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Druid数据库连接池 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>1.2.8</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Mybatis 依赖配置 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.bwie;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class TestApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
int a=10;
|
||||||
|
int b=20;
|
||||||
|
|
||||||
|
//1.使用BigDecimal进行加法计算,并打印在控制台上。
|
||||||
|
BigDecimal bigDecimal3 = BigDecimal.valueOf(a + b);
|
||||||
|
//2.使用BigDecimal进行减法计算,并打印在控制台上。
|
||||||
|
BigDecimal bigDecimal2 = BigDecimal.valueOf(a - b);
|
||||||
|
//3.使用BigDecimal进行乘法计算,并打印在控制台上。
|
||||||
|
BigDecimal bigDecimal1 = BigDecimal.valueOf(a * b);
|
||||||
|
//4.使用BigDecimal进行除法计算,并打印在控制台上。
|
||||||
|
BigDecimal bigDecimal = BigDecimal.valueOf(a / b);
|
||||||
|
|
||||||
|
System.out.println(bigDecimal);
|
||||||
|
System.out.println(bigDecimal1);
|
||||||
|
System.out.println(bigDecimal2);
|
||||||
|
System.out.println(bigDecimal3);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.bwie.test;
|
||||||
|
|
||||||
|
import com.alibaba.druid.support.json.JSONUtils;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class Test {
|
||||||
|
|
||||||
|
int a=10;
|
||||||
|
int b=20;
|
||||||
|
|
||||||
|
//1.使用BigDecimal进行加法计算,并打印在控制台上。
|
||||||
|
int c=a+b;
|
||||||
|
|
||||||
|
//2.使用BigDecimal进行减法计算,并打印在控制台上。
|
||||||
|
int d=a-b;
|
||||||
|
//3.使用BigDecimal进行乘法计算,并打印在控制台上。
|
||||||
|
int e=a*b;
|
||||||
|
//4.使用BigDecimal进行除法计算,并打印在控制台上。
|
||||||
|
int f=a/b;
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,3 @@
|
||||||
|
artifactId=bwie-test
|
||||||
|
groupId=com.bwie
|
||||||
|
version=1.0-SNAPSHOT
|
|
@ -0,0 +1,2 @@
|
||||||
|
com\bwie\TestApplication.class
|
||||||
|
com\bwie\test\Test.class
|
|
@ -0,0 +1,2 @@
|
||||||
|
D:\Users\Dell\Desktop\专高六资料\day18\bwie-test\src\main\java\com\bwie\TestApplication.java
|
||||||
|
D:\Users\Dell\Desktop\专高六资料\day18\bwie-test\src\main\java\com\bwie\test\Test.java
|
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4" />
|
|
@ -0,0 +1,59 @@
|
||||||
|
<?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>com.bwie</groupId>
|
||||||
|
<artifactId>day18</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<modules>
|
||||||
|
<module>bwie-test</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<!-- 规定SpringBoot版本 -->
|
||||||
|
<!-- 父级pom文件 主要用于规定项目依赖的各个版本,用于进行项目版本约束 -->
|
||||||
|
<parent>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<version>2.6.2</version>
|
||||||
|
<relativePath/>
|
||||||
|
</parent>
|
||||||
|
<!-- 依赖声明 -->
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud 微服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>2021.0.0</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- SpringCloud Alibaba 微服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>2021.1</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Alibaba Nacos 配置 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
<version>2.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 系统公共 依赖 版本号定义-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.bwie</groupId>
|
||||||
|
<artifactId>bwie-common</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
</project>
|
Loading…
Reference in New Issue