import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Locale;
import java.util.Scanner;
public class CocomoApp {
public static void main(String[] args) {
System.out.println(NOTICE);
Scanner scanner = new Scanner(System.in);
String inputLine;
while (null != (inputLine = scanner.nextLine()) && isNotExit(inputLine)) {
//Select COCOMO Mode to use
int mode = getCocoMode(inputLine);
System.out.println("User selected: " + inputLine);
//BASE COCOMO MODE
if (mode == COCO_MODE_BASE) {
//get value of kdsi for develop
double devKdsi = getDevKdsi(scanner);
//let user choose what develop mode they use
mode = getDevMode(scanner, mode);
//get predict of modify kdsi
double modifyKdsi = getModifyKdsi(scanner);
//calculate
base(devKdsi, mode, modifyKdsi);
} else {
System.out.println("WOW HOO! NOT YET!");
}
System.out.println(NOTICE);
}
}
/**
* get predict of modify kdsi
*
* @param scanner
* @return
*/
private static double getModifyKdsi(Scanner scanner) {
double act = DEFAULT_MODIFY;
try {
System.out.println("Please type modify KDSI (Default " + DEFAULT_MODIFY + "): ");
act = Double.parseDouble(scanner.nextLine());
} catch (Exception e) {
System.out.println("Use default modify KDSI of" +
【COCOMO基本模型计算】
于 2023-02-21 18:34:35 首次发布