xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 530KB
    文件類型: .7z
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-25
  • 語言: Java
  • 標簽: JavaFx??

資源簡介

做Java課程設計時做的一個項目,基本功能如下: 1、能輸入算術表達式,表達式用的是數學符號表示,不是計算機專業符合,如乘是符合“X”,而不是“*”; 2、能保存和瀏覽計算記錄,并能選擇某條記錄重新計算; 3、能修改輸入的表達式; 4、按等號計算; 5、能計算+、-,X,/, 乘方、開方,對數等多種計算; 順便附帶課程設計報告,注意用的開發包為Java1.8_101。由于調用的用于計算的數學函數的關系,只能在Java1.8_101及其以下版本的jfk下運行。jdk1.8的2版本會出現調用函數錯誤的情況,更別說不兼容的javajdk9及其以上版本了。

資源截圖

代碼片段和文件信息

package?sample;

import?java.math.BigDecimal;
import?java.math.RoundingMode;
import?javax.script.scriptEngine;
import?javax.script.scriptEngineManager;
import?javax.script.scriptException;

/**
?*?Analysis?class
?*
?*?@author?康勤
?*?@data?2019/07/08
?*/
public?class?Analysis{

????private?String?analysisObj;
// private?String?operatorChar[]?=?{“+““-““ד“÷““^““√““log““%“};
????/**
?????*?運算符
?????*?private?char[]?operator=?{‘+‘‘-‘‘*‘‘/‘‘^‘‘v‘‘l‘};
?????*?@下標0?+?加
?????*?@下標1?-?減
?????*?@下標2?*?乘
?????*?@下標3?/?除
?????*?@下標4?^?冪
?????*?@下標5?v?開方
?????*?@下標6?l?對數
?????*?@下標7?%?百分比
?????*/

????public?Analysis(String?analysisObj)
????{
????????this.analysisObj?=?analysisObj;

????}

????private?boolean?isComplete(int[]?count)
????{
????????return?count[0]+count[1]+count[2]+count[3]!=4;
????}

????private?void?AnalysisString()?throws?FormulaAnalysis
????{
????????int[]?count?=?new?int[]?{0000};
????????while(isComplete(count))
????????{
????????????int?index?=?analysisObj.lastIndexOf(“%“);
????????????if(index!=-1)
????????????????//有%
????????????{
????????????????int?preIndex?=?getPreNumIndex(index);
????????????????if(preIndex==-1)
????????????????????throw?new?FormulaAnalysis(“Math?error“);
????????????????BigDecimal?per_num?=?new?BigDecimal(analysisObj.substring(preIndex?index));
????????????????analysisObj=analysisObj.replace(analysisObj.substring(preIndex?index+1)clearDecimal(percent(per_num).toString()));
????????????}
????????????else
????????????{
????????????????count[0]=1;
????????????????System.out.println(“not?found?%“);
????????????}


????????????index?=?analysisObj.lastIndexOf(“√“);
????????????if(index!=-1)
????????????????//有√--root
????????????{
????????????????int?nextIndex?=?getNextNumIndex(indexfalse);
????????????????if(nextIndex==-1)
????????????????????throw?new?FormulaAnalysis(“Math?error“);

????????????????if(nextIndex==analysisObj.length()-1)
????????????????????nextIndex++;
????????????????BigDecimal?root_num?=?new?BigDecimal(analysisObj.substring(index+1?nextIndex));
????????????????analysisObj=analysisObj.replace(analysisObj.substring(index?nextIndex)?clearDecimal(square(root_num).toString()));
????????????}
????????????else
????????????{
????????????????count[2]=1;
????????????????System.out.println(“not?found?root“);
????????????}

????????????index?=?analysisObj.lastIndexOf(“^“);
????????????if(index!=-1)
????????????????//有冪
????????????{
????????????????int?nextIndex?=?getNextNumIndex(indexfalse);
????????????????int?pretIndex?=?getPreNumIndex(index);
????????????????if(nextIndex==-1){
????????????????????throw?new?FormulaAnalysis(“Math?error“);
????????????????}
????????????????if(nextIndex==analysisObj.length()-1){
????????????????????nextIndex++;
????????????????}
????????????????BigDecimal?pow_num1?=?new?BigDecimal(analysisObj.substring(pretIndex?index));
????????????????BigDecimal?pow_num2?=?n

評論

共有 條評論