原创 Java面向對象靜態方法及域值控制&日周時分進制方法"以時鐘對象實驗爲例"

Suppose you are given a class named ClockTime with the following contents: 假設你有一個包含下列內容名爲“時鐘時間”的組: Write an instan

原创 Java數組參數應用&數組間數值覆蓋"以數組間數值覆蓋實驗爲例"

Q11. Write a method named copyRange that takes as parameters two arrays a1 and a2, two starting indexes i1 and i2,

原创 Java字符串參數介數組應用&忽略空格字符串相等判斷"以字符串相同實驗爲例"

Q16. Write a method named areAnagrams that accepts two Strings as parameters and returns whether those strings co

原创 Python時間函數驅動&函數抽象化分離應用"以呈現日曆實驗爲例"

打開CSDN看見一個這麼可愛的廣告,進去看了看 這廣告也太可愛= =,激動碼字的心情一下子更,激動了哈哈哈哈 裏面是怎樣的你們自己去看叭,我點開看看,感覺還不夠浪漫~ 今天小白自己完成了一項工程,打印一個日曆。 效果圖: 老師

原创 Python字符串格式函數&循環語法應用"以數字金字塔實驗爲例"

小白第一次嘗試用Python作圖,遇到了小困難。 困難不是在想如何控制空格長度,打印有順序有規律的字符。 而是在涉及到兩位數的時候,整體移位。 遇到的問題是這樣的: 看着那個最後一行真的很氣有沒有!!! 以前學Java沒有能解決

原创 Java數組參數應用&輸出數組遞增數列"以輸出最長數組遞增數列實驗爲例"

Q14. Write a method called longestSortedSequence that accepts an array of integers as a parameter and that returns

原创 Java面向對象靜態方法及域值控制&域值四則運算"以計算器實驗爲例"(初級)

*Create a class named Calculator. A calculator has a method to add digits to a running total. The user can also pre

原创 Java數組參數應用&合併數組"以合併數組實驗爲例"

import java.util.*; import java.util.Scanner; public class Q13 { public static void main(String[] args) { // TOD

原创 Java數組參數應用&數組相等判斷"以樣本數組相等判斷爲例"

Q12. Write a method named equals that accepts two arrays of integers as parameters and returns true if they contain

原创 Java隨機數應用&交互輸入比較"以乘法訓練實驗爲例"

Q21.This program helps you practice multiplication by asking you random multiplication questions with numbers rangi

原创 Python字符串格式函數應用&參數函數應用"以打印素數實驗爲例"

今日小白再次嘗試數字打印。 這次是打印前50個素數。 如何確定一個數不是素數呢? 這要從素數的定義出發: 素數是指除了1與本身外,無乘因子的數。 所以我們可以用i(從2到該數)與該數進行餘數除法%。 如果餘數除法結果爲0,說明i是

原创 Java數組參數應用&數組偶數識別"以數組偶數比實驗爲例"

Q10. Write a method named percentEven that accepts an array of integers as a parameter and returns the percentage

原创 Java參數應用&for循環作圖“以漩渦圖形實驗爲例”

Q21. 寫一條利用for循環程序畫出下面的圖形。窗口大小爲:170 x 170 px “spiral” 從 (0,10),向右 160,向下 150,向左 150, 向上140… import java.awt.*; //調取

原创 Java數組參數應用&數組間差"以最小數組間差實驗爲例"

Q9. Write a method named minGap that accepts an integer array as a parameter and returns the minimum ‘gap’ between

原创 Java字符串參數應用&計詞數避免超出數組範圍“以計字符串詞數實驗爲例”

Q17. Write a method named wordCount that accepts a String as its parameter and returns the number of words in that