CS Assignment

python questions

1.What is the value of the following expression:

sеt (rаngе (0, 20, 3)) & sеt (rangе (0, 20, 2))

{0, 6, 12, 18}

{0, 2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18}

{3, 9, 15}

{2, 3, 4, 8, 9, 10, 14, 15, 16}

. 2.

Which operators are applicable to sets? (Check all that apply.)








. 3.

Which expression correctly changes the tail (the last element) of the middle item in the following


foo=(12, [“a”, “n”, “d”, “y”], set (“andy”))

foo[1][-1] = “a”

foo[0][0] = “a”

Tuples are immutable and cannot be changed.

The tuple foo has items of different data types and is illegal.

. 4.

Which data type cannot be used as a key in a dictionary?





. 5.

Which data structures could be used instead of the following dictionary without any loss of

information and functionality, including possible modifications both of element names and their


elements = {“H” : 1, “He” : 4, “Li” : 7, “Be” : 9}

names = [“H”, “He”, “Li”, “Be”]

weights =

mfb21 solution



代码很少,主要功能就是输入一个URL,返回该网页的Status Code
CompilationTesterTask1.java就是直接给的样板测试文件 没做修改‍
住:    httpResultCode.get ( “www.mit.edu/” ); //在代码中改变URL可以得到不同测试结果
Javac *.java (先编译)
Java Task1(执行main函数:看输出结果)
You can use this code to check if your code compiles properly by compiling it t

python csv assignment

  • Write a command-line program that reads a comma-separated (CSV) file and reports some basic statistics of the data in the file.

    The program must have the comment at the top of the program file: “I certify this submission as my own original work completed in accordance with the Suffolk University Academic Integrity Policy. ZZZ”, where ZZZ is the full name of the student.

    The program shall ask the user to enter the name of a CSV file. If the file does not exist, the program shall print the error message: “File XXX does not exist.” where XXX is the file name, as entered by the user, and exit. Use the attached file grades.csv for testing.

    The program shall read the file contents. Assume that the file has a perfect rectangular structure: each uncommented row has the same number of columns, and each column has the same number of rows. A row that begins with a pound sign # is commented and shall be i

syr cis341 缓存区溢出漏洞利用实现


syr cis341 solution

Project 2: Buffer Overflow

1. Objective

Buffer overflows have been the most common form of security vulnerability in the

last ten years. Moreover, buffer overflow vulnerabilities dominate in the area of

remote network penetration vulnerabilities, where an anonymous Internet user seeks

to gain partial or total control of a host. These kinds of attacks enable anyone to take

total control of a host and thus represent one of the most serious security threats. [1]

Definition of buffer overflow from Wikipedia [2]: A buffer overflow, or buffer

overrun, is an anomaly where a program, while writing data to a buffer, overruns the

buffer’s boundary and overwrites adjacent memory. This is a special case of violation

of memory safety.

The goal of this lab is to get intimately familiar with the layout and use of data section,

code section and, particularly, call stacks, as well as MIPS machine language,

assembly and disassembly, debugging, and reverse engineering. As a side ben


Section Readings: 2.3

Problem 1. (Sum of Integers) Implement the static methods sumIter() and sumRec() in

SumOfInts that take an integer argument n and return the sum S(n) = 1 + 2 + 3 + · · · + n,

computed iteratively (using a loop) and recursively. The recurrence relation for the latter

implementation is

$ java SumOfInts 100

5050 5050

Problem 2. (Exponentiation) Implement the static method power() in Power that takes

two integer arguments a and b and returns the value of a

the recurrence relation

$ java Power 3 5


Problem 3. (Bit Counts) Implement the static methods zeros() and ones() in Bits that

takes a bit string (ie, a string of zeros and ones) s as argument and returns the number

of zeros and ones in s, each computed recursively. Hint: First devise an appropriate

recurrence relation for the problem.

$ java Bits 1010010010011110001011111

zeros = 11 , ones = 14 , total = 25

Problem 4. (String Reversal) Implement the static method reverse() in Reverse that

takes a string s as argument

c语言程序代写: Min/Max stack

CS 136 Assignment 10

Due Monday, April 6 at 11:59 AM sharp (noon).

Please read the preamble in Assignment 1.

Only the C language features introduced in this course are allowed.

In your code, you do NOT have to check that the value returned from malloc (or realloc) is invalid (NULL).

You may assume that all C strings are null terminated: you do not have to assert this.

If a requires statement specifies that a structure is “valid”, you may assume this, and you do not have to assert it.

Assignment 10 Problem 1. [15 Marks for correctness and efficiency.]

Write a C module mmstack.c that implements a Min/Max Stack ADT (MMStack) as described in mmstack.h.

We have provided a simple <

c语言程序代写: list, tree, binary search tree

Assignment 9 Problem 0. [2+2=4 Marks correctness]

Problem 0 is a “warm-up” question. You are allowed to collaborate with your fellow classmates and discuss the solution on piazza.

a) Complete the C program mylist.c to print the following: 10 9 8 7 6 5 4 3 2 1

b) Complete the C program mytree.c to print the following: 20 35 78

Note: No helper functions are allowed (for both parts a & b). You are supposed to build the list (in part a) or the BST tree (in part b) node by node. You are NOT allowed to change any implementation provided in mylist.c nor in mytree.c

Assignment 9 Problem 1. [36 Marks Correctness. File: list.c]

Goal: to practice implementing linked list in C

Write the C implementation list.c for the interface

c++ rot13 xor cipher

You have been hired by XYZ Stealth Incorporated to design their next generation of data encryption software, and in particular, your task is to create a C++ class that supports the ability to perform 2 common data encryption techniques:

The class will support the following capabilities:

  • initialize the class with a block of data – a) string b) an arbitrary array of data (supplied via void *) and a length
  • a method to load data from disk (filename supplied)
  • a method to select encryption technique
  • a method to set the key for the XOR Cipher
  • a method to perform encryption
  • a method to save manipulated data to disk (filename supplied)
  • a method to decrypt (study the 2 wiki descriptions carefully, a