BillyNI-OUO

@xiajei

Joined on Nov 24, 2020

  • 1 2 iteration Step Multiplier Multiplicand Product
     Like  Bookmark
  • Part1 a. ackermann : 0x010140 result : gp - 2028 = 0x0127B8 - 2028 = 0x011fcc b. 因為使用c.lw來讀入資料,寫入的資料大小為1個word,使用bfos來做sign extend,使資料變回2個word(64bits). c.
     Like  Bookmark
  • Problem 1 ER Model Relational Model create table Professor ( pid integer primary key, pname varchar(30) not null, rank integer ); create table Project (
     Like  Bookmark
  • [TOC] Description Write a Python program that takes a name from the input and prints a sentense "XXX is my best friend." to the output, where "XXX" is the name from the input. Assume the program is written in a file named "friend.py" and run from the command line. The following block shows how the terminal shall look like: (the text in pink is typed by the user; others are printed by the program) $ python3 friend.py Mary Mary is my best friend.
     Like  Bookmark
  • [TOC] Description Define a Matrix class to represent numbers as a two-dimensional array. The constructor for the matrix is a list of lists of numbers. A 3x3 matrix would be constructed as M = Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) The Matrix class would support several methods, and the usage is as follows:
     Like 1 Bookmark
  • :::info 各 SC/Quiz 未來有可能會慢慢補齊。 Quiz Solution 的部分 Problem 是 OJ 連結 後面題號是解答連結 ::: [TOC] Self-Check Week 1
     Like 1 Bookmark
  • Definitions and Short Answers - week 1 (9/9 lectures) What is batch processing ? What are its advantages? Disadvantages? 批次處理程式。 Advantage: 多使用者共用一台機器、可以指定執行時間。 Disadvantage: CPU 經常閒置(因I/O較慢)、一次一件工作、程式之間沒有交流。 What is multiprogramming ? What disadvantage of batch processing does it address? 一次處理多件工作。程式A 處理 I/O 時,用 CPU 去跑別的程式B,解決了batch processing 的 CPU 閒置問題。
     Like  Bookmark
  • 1. Definitions and Short Answers - functions Given the command shown on the lecture slide $ uniq mary.txt What is the prompt : $ the program name : uniq
     Like 2 Bookmark
  • 1. Definitions and Short Answers - functions What is a command-line interface? A command line interface (CLI) is a text-based user interface (UI) used to view and manage computer files. What is a prompt? 系統的提示符
     Like  Bookmark
  • 1. Definitions and Short Answers - functions When you call the function ord('A') it returns 65. What does it mean? return the ASCII value of 'A' What is the value of chr(70)? (based on the knowledge of the previous question) return 'F'
     Like  Bookmark
  • [TOC] Description input名字output他參加的課跟成績 如果沒這個人就output他沒參加這些課 Solution #!/usr/bin/env python3 python = {'Alex': 83, 'Harry': 77, 'Davy': 93, 'Lisa': 65, 'Sunday': 89} algorithm = {'Lisa': 91, 'Andrew': 88, 'Kevin': 76}
     Like  Bookmark
  • [TOC] Description 輸入4個年份要你一次判斷是平年還是閏年 Solution #!/usr/bin/env python3 def check_year(year): return bool(not year%400) or (bool(not year%4) and bool(year%100))
     Like  Bookmark
  • [TOC] Description 要你先input一串文字,之後再input你要刪掉的字 最後output出來處理過後的字串 Solution #!/usr/bin/env python3 Origin = input() Delete = input().split(',')
     Like  Bookmark
  • Definitions and Short Answers - functions Given a function definiton def Double(n): return n + n and given a call to the function x = Double(20)
     Like  Bookmark
  • Answer the following questions to check your understanding of your material. Expect the same kind of questions to show up on your tests. This self check is for Python Standard Library part 1. 1. Definitions and Short Answers - functions If a function is built-in, do you have to import it first, or can you just call it without importing? You can call it without importing If a function is in the standard library, do you have to import it first, or can you just call it without importing?
     Like 2 Bookmark
  • 1. Definitions and Short Answers - functions Given the following if-statement x = int(input('enter one number: ')) y = int(input('another number: ')) if y == 0: print('sorry, cannot divide by 0!') else: print(f'{x} / {y} = {x/y}')
     Like  Bookmark
  • Definitions and Short Answers - functions Given a for loop: for i in L: print(i) Can L be the following? If so, what does the loop print? If not, why not? [X] ['a', 'b', 'c']
     Like 1 Bookmark
  • Definitions and Short Answers - functions In Python, ArithmeticError is a base class of FloatingPointError, OverflowError, and ZeroDivisionError. So, a. Does ArithmeticError inherit from FloatingPointError ? Or does FloatingPointError inherit from ArithmeticError? FloatingPointError inherit from ArithmeticError b. Does FloatingPointError inherit from OverflowError ? Or ZeroDivisionError? Or is there any inheritance relationship between them?
     Like 2 Bookmark
  • Definitions and Short Answers - functions What is the data type of (1, 2, 3)? tuple If s = 'ABCDE', what is the value ofs[0] s[1] s[-1] s[1:4]
     Like  Bookmark
  • Answer the following questions to check your understanding of your material. Expect the same kind of questions to show up on your tests. 1. Definitions and Short Answers - functions In Python, suppose you have the code return [13, 25, 'hello', 'z'] Which of the following are objects?
     Like 3 Bookmark