# java系列作业代写lab6

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

243

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语言基础题目代写

c程序代做

1.6 – The Preprocessor

All exercises in this Level must be coded exclusively in C syntax (no

<iostream>, cout, cin, classes, etc.)

Exercise 1

Write a C-program that contains two print macro calls. The first prints the variable a, the

second prints the variables a and b. Printing happens by the use of the PRINT1 and

PRINT2 macros that accept arguments. These macros must be defined in an include-file.

The variables a and b gets their value in the function main().

Name the program “Macro.c” and the include-file “Defs.h”. Don’t forget to implement

the mechanism to avoid multiple inclusion of the header file.

Exercise 2

Create the two macros MAX2(x,y) and MAX3(x,y,z). These macros must return the

maximum value of the given arguments. Let the macro MAX3 make use of the macro

MAX2. Add these macros to the file “Defs.h”.

1.7 – Pointers and Arrays

Exercise 1

Try to create a function Swap(). This function must exchange the value of two variables.

For example: if i=123 and j=456, then i=456

# 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

# cs112 project5

python 程序代写

 Programming Project 5

This semester you will be writing a program that models elements of recognizing and creating characters. Optical character recognition is an important area of research that allows photographs or printed documents to be digitized; by doing so, these documents are made available for machine-based searching. On the flip side,http://en.wikipedia.org/wiki/CAPTCHA is a system for differentiating between humans and computers: the goal here is to generate a non-machine readable image that a human could identify. CAPTCHA helps reduce the amount of spam on the Internet.

We will implement a highly limited type of image matching, processing, and creation this semester. Rather than write this project at once, we will break the proj

# cs112 project4

python作业代写

 Programming Project 4

This semester you will be writing a program that models elements of recognizing and creating characters. Optical character recognition is an important area of research that allows photographs or printed documents to be digitized; by doing so, these documents are made available for machine-based searching. On the flip side,http://en.wikipedia.org/wiki/CAPTCHA is a system for differentiating between humans and computers: the goal here is to generate a non-machine readable image that a human could identify. CAPTCHA helps reduce the amount of spam on the Internet.

We will implement a highly limited type of image matching, processing, and creation this semester. Rather than write this project at once, we will break the proje

# java作业代写

### Minimal Submitted Files

You are required, but not limited, to turn in the following source files:

Assignment8.java(More code need to be added)
ZipInfo.java(given by the instructor, it needs to be modified for this assignment)
ZipcodeComparator.java
CityStateComparator.java
Sorts.java
PostOffice.java

### Requirements to get full credits in Documentation

1. The assignment number, your name, StudentID, Lecture number/time, and a class description need to be included at the top of each file/class.
2. A description of each method is also needed.
3. Some additional comments inside of methods(especially for the “main” method) to explain code that are hard to follow should be written.

You can look at the Java programs in the text book to see how com

# 几道初级c语言作业代写

Read carefully: Plagiarized assignment will get a ZERO. You cannot change the variable names of other

student’s solution and submit it as yours. The program structure of other students must not match yours.

You are not allowed to collaborate with other students in solving this assignment. Every student has to

come up with his/her own solution. If you have any questions, you must talk to the lab instructor. Any

cheating (e.g. copying from internet) is a serious violation of the University student code and will be dealt

with very seriously.

Instructions for submission: Add the following to your .c file: (1) your full name (2) Algorithm

(3) Comments are must and they should be brief.

Problem 1 (10 points):

Write a program with a while loop to print 1 to N in square brackets. N is an integer input from

the user.

(i) Write the same program using a for-loop

(ii) Write the same program that will display only the even numbers and odd numbers

Example of Output (Expected output as well):

from 1 to N.

Pro