- 博客(24)
- 资源 (1)
- 收藏
- 关注

原创 PythonER随机网格&数据可视化实现"以SEIR传播动力学模型实验为例"
SEIR传播动力学模型什么是SEIR传播动力学模型?经典SEIR模型将人群分为S (Susceptible,易感者),I (Infected,感染者),E (Exposed,潜伏者)和R (Recovered,康复人群)。本文根据SEIR传播动力学模型,利用Python实现生成ER随机网格、并在网格间随机结边、模拟SEIR型传染病传播该实验可分为两个步骤进行:一、生成一个ER...
2020-05-06 10:02:11
4721
7
原创 Python时间函数驱动&函数抽象化分离应用"以呈现日历实验为例"
打开优快云看见一个这么可爱的广告,进去看了看这广告也太可爱= =,激动码字的心情一下子更,激动了哈哈哈哈里面是怎样的你们自己去看叭,我点开看看,感觉还不够浪漫~今天小白自己完成了一项工程,打印一个日历。老师说的好,很多年轻的程序员不经过计划,直接开始码字。这次我系统的思考了如何完成这项工程。分为两步获得年份月份打印出日历是不是看上去很easy呢?然而并不是,继续分析。...
2020-03-20 16:03:07
601
原创 Python字符串格式函数应用&参数函数应用"以打印素数实验为例"
今日小白再次尝试数字打印。这次是打印前50个素数。如何确定一个数不是素数呢?这要从素数的定义出发:素数是指除了1与本身外,无乘因子的数。所以我们可以用i(从2到该数)与该数进行余数除法%。如果余数除法结果为0,说明i是该数的余数。也说明它不是素数。为了应用参数函数,我们进行一个简单的分析———————————————————————————————我们首先需要建立一个判断是否为...
2020-03-15 21:15:03
304
原创 Python字符串格式函数&循环语法应用"以数字金字塔实验为例"
小白第一次尝试用Python作图,遇到了小困难。困难不是在想如何控制空格长度,打印有顺序有规律的字符。而是在涉及到两位数的时候,整体移位。遇到的问题是这样的:a = eval(input("Enter the number of lines: "))+1for i in range(1,a): #分行 for b in range(3*a,0,-1): ...
2020-03-15 20:19:46
1063
原创 Python·Turtle画笔应用:"Hello word"——Java小白转征Python
这是写的第一条Python程序Python一定是最简单流利的语言要好好学习!附加一张很可爱的皮卡丘import turtleturtle.color("red")turtle.showturtle()turtle.circle(40)turtle.penup()turtle.forward(80)turtle.pendown()turtle.circle(40)turtl...
2020-03-01 21:17:28
301
原创 Java面向对象静态方法&数组列表参数应用"以购物订单实验为例"(进阶)
Lab: Write classes to model a shopping list.Make an Item class that represents a grocery item’s name and price, such as tissues for $3.Also implement an ItemOrder class that represents a shopper’s d...
2019-12-04 10:00:00
718
原创 Java面向对象静态方法及域值控制&域值四则运算"以计算器实验为例"(初级)
*Create a class named Calculator.A calculator has a method to add digits to a running total.The user can also press operator keys such as + or * and then enter digits of a secondnumber.When the us...
2019-11-14 11:34:00
408
原创 Java面向对象静态方法及域值控制&日周时分进制方法"以时钟对象实验为例"
Suppose you are given a class named ClockTime with the following contents:假设你有一个包含下列内容名为“时钟时间”的组:Write an instance method advance that will be placed inside the ClockTime class. The method accepts ...
2019-11-12 09:51:17
293
原创 Java随机数应用&交互输入比较"以乘法训练实验为例"
Q21.This program helps you practice multiplicationby asking you random multiplication questionswith numbers ranging from 1 to 30and counting how many you solve correctly.14 * 8 = 112Correct!5 * ...
2019-11-05 15:10:23
239
原创 Java参数应用&for循环作图“以漩涡图形实验为例”
Q21. 写一条利用for循环程序画出下面的图形。窗口大小为:170 x 170 px“spiral” 从 (0,10),向右 160,向下 150,向左 150, 向上140…import java.awt.*;//调取图形包public class Q28 {//这个实验看上去很复杂,其实是很入门的算法 public static void main(String[] args)...
2019-11-05 15:00:18
441
原创 Java字符串参数应用&计词数避免超出数组范围“以计字符串词数实验为例”
Q17. Write a method named wordCount that accepts a String asits parameter and returns the number of words in that string. Wordsare separated by spaces.wordCount(“the quick brown fox”) returns 4Q1...
2019-11-02 11:33:37
281
原创 Java字符串参数介数组应用&忽略空格字符串相等判断"以字符串相同实验为例"
Q16. Write a method named areAnagrams that accepts two Strings as parameters and returns whether those strings contain the same letters (in any order).areAnagrams(“bear”, “bare”) returns trueareA...
2019-11-02 10:26:53
820
原创 Java数组参数应用&输出数组递增数列"以输出最长数组递增数列实验为例"
Q14.Write a method called longestSortedSequence that accepts anarray of integers as a parameter and that returns the length ofthe longest sorted (nondecreasing) sequence of integers in the arrayQ1...
2019-11-02 09:31:52
735
原创 Java数组参数应用&合并数组"以合并数组实验为例"
import java.util.*;import java.util.Scanner;public class Q13 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner console = new Scanner (System.in); /*System....
2019-10-31 11:42:01
233
原创 Java数组参数应用&数组相等判断"以样本数组相等判断为例"
Q12. Write a method named equals that accepts two arraysof integers as parameters and returns true if they contain exactlythe same elements in the same order, and false otherwise. Note that thearra...
2019-10-31 11:22:14
228
1
原创 Java数组参数应用&数组间数值覆盖"以数组间数值覆盖实验为例"
Q11. Write a method named copyRange that takes as parameters two arrays a1 and a2, two starting indexes i1 and i2, and a length l,and copies the first l elements of a1 starting at index i1 into array...
2019-10-31 10:25:40
536
原创 Java数组参数应用&数组偶数识别"以数组偶数比实验为例"
Q10. Write a method named percentEven thataccepts an array of integers as a parameter and returnsthe percentage of even numbers in the array as a real number. For example, if avariable named nums...
2019-10-30 08:47:44
276
原创 Java数组参数应用&数组间差"以最小数组间差实验为例"
Q9. Write a method named minGap that acceptsan integer array as a parameter and returnsthe minimum ‘gap’ between adjacent values inthe array. The gap between two adjacent valuesin a arra...
2019-10-30 08:19:32
284
原创 Java逐数读取文件并处理打印"以温度读数实验为例"
import java.io.*; import java.util.Scanner;public class Q12 { public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub Scanner input = new ...
2019-10-27 09:51:50
345
原创 Java筛除字符方法&替换字符"以html源文件实验为例"
import java.io.*; import java.util.Scanner;public class Q11 { public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub Scanner input = new...
2019-10-27 09:36:02
288
原创 Java读取文档分类赋权值&末行缺失处理"以分类赋权实验为例"
import java.io.*; import java.util.Scanner;public class Q10 { public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub Scanner input = new...
2019-10-26 10:01:49
644
原创 Java读取文件并逐行打印众名&末行字符串保留方法"以寻找众名实验为例"
import java.io.*; import java.util.Scanner;public class Q9 { public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub Scanner input = new ...
2019-10-25 21:00:52
315
原创 Java避免末尾字符串换行&读取文件段行词拆分"以打印重复字符串实验为例"
import java.io.*; import java.util.Scanner;public class Q8 { public static void main(String[] args) throws FileNotFoundException {//避免寻找文件失效 // TODO Auto-generated method stub Scanner in...
2019-10-25 18:28:29
298
原创 Java百分比计算以及显示方法“以掷硬币实验为例”
import java.io.*; import java.util.Scanner;import java.text.DecimalFormat;import java.text.NumberFormat;public class Q7 { public static void main(String[] args) throws FileNotFoundException {...
2019-10-25 15:02:47
387
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人