程序源代码: import java.util.Scanner; public class ch { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("复利计算器:计算复利终值请按1,计算本金请按2:股票投资:计算时间请按3,计算报酬率请按4,计算资产总值请按5" ); int num=scanner.nextInt(); //选择…
练习一:打出1-100之间的所有偶数 def even_print(): for i in range(1,101): if i % 2 == 0: print (i) even_print() #列表解析式的方式: k = [n for n in range(1,101) if n%2 == 0] print (k) 练习二:设计一个函数,在桌面上创建10个文件,并以数字命名 def text_creation(): path = 'C:/Users/Administrator/Desktop…
import java.util.Scanner; public class Compound_int { public static void main(String[] args) { tip(); while (true) { menu(); int n = scanner.nextInt(); if (n >= 0 && n <= 7) { if (n == 0) break; switch (n) { case 1: benjin(); break; case 2:…
static void principal()// 计算本金 { int N, m; double i, F, P; System.out.printf("复利终值:"); F = scanner.nextDouble(); System.out.printf("年利率:"); i = scanner.nextDouble(); System.out.printf("存入年限:"); N = scanner.nextInt(); System.o…
package compounding; import java.util.Scanner; public class compounding1_1 { public static void main(String[] args) { // TODO 自动生成的方法存根 //tip(); while (true) { menu(); System.out.printf("请输入你要选择的功能(0~7):"); int n = scanner.nextInt(); &&…