| HW #,due date | Assignment |
|---|---|
| HW#1 Due: Wednesday Jan 17, 2007 |
Submit the following to Angel Write a program that uses nested loops to display the following picture. The picture should be a 4 by 3 rectangle composed of X's as shown below.
XXXX
XXXX
XXXX
Write a program that uses nested loops to display the following picture. The picture should be a triangle composed of X's in the configuration shown below.
X
XX
XXX
Write a program that uses nested loops to display the following picture. The picture should be a triangle composed of X's in the configuration shown below.
X
XX
XXX
XXXX
Write a program that uses nested loops to display the following picture. The picture should be a triangle composed of X's in the configuration shown below.
XXXXX
XXXX
XXX
XX
X
Write a program that uses a loop to compute the sum of the numbers from 1 through 5 (ie. 1+2+3+4+5 which is 15). The program should "figure out" the answer - DO NOT have the program just display the number 15 without using a loop to figure it out. Write your program so that you can easily change the program to compute the sum of the numbers from 1 through 100 or from 1 through any number by just changing the number 5 in your code to the new number. Write a program that uses a loop to compute the sum of the the factorials of the numbers from 1 through 5 (ie. 1!+2!+3!+4!+5! ) as in the following mathematical notation:
(Click here for the definition of a factorial) The program should "figure out" the answer - DO NOT have the program just display the answer without using a loop to figure it out. Write your program so that you can easily change the program to compute the sum of the factorials from 1! through 7! or from 1! through the factorial of any number by just changing the number 5 in your code to the new number. Write a program that uses a loop to compute the sum of the values n! * (n-1)! where n varies from 1 through 5. (ie. 1!*0!+2!*1!+3!*2!+4!*3!+5!*4! ) as in the following mathematical notation:
(Click here for the definition of a factorial) The program should "figure out" the answer - DO NOT have the program just display the answer without using a loop to figure it out. This value can get VERY large as n gets large. You may only be able to run your program for very small values of n (e.g. 1,2,3,4). |
| HW#2 Due: Monday Jan 22, 2007 |
Study the code for the following program. Make sure that you understand the code. The zip file below contains the entire folder for the program. To run and modify the program, download the zip file, unzip it and double click on the .sln file to load it into VB Express 2005. To just view the code you can look at the Module1.vb file. You do not have to modify the program, but please come in Monday understaning it fully.
|
| HW#3a Due: Wednesday Jan 24, 2007 |
Submit the following to Angel Write a program that asks the user to enter a list of numbers (Integers). The user indicates that he is finished entering numbers when he enters the letter "q" (i.e. quit) instead of a number. When the user is finished, the program should display the following information:
|
| HW#3b Due: Monday Jan 29, 2007 |
Submit the following to Angel Description of problemA professor needs a program to help him grade tests. Write a program that asks the user to enter the grades for a test. For each test, the user should be prompted to enter the first name, last name and test score for each student. Your program should store the user's entries in 3 different parallel arrays - one for first name, one for last name and one for the test score. The user should indicate that he is finished entering grades for the class by typing the letter "q". When the user finishes typing in the data, the program will show the results listed below. The program will automatically determine a curve, if necessary, and will display some statistics about the test both before an after applying the curve. ImplementationYour program should contain and use the following functions. Each function should take the appropriate parameters and return a n appropriate result.:
ResultsThe program should display the following results
SAMPLE OUTPUTFirst Name: Joe Last Name: Smith Score: 30 First Name: John Last Name: Doe Score: 75 First Name: Jack Last Name: Smith Score: 90 First Name: Sam Last Name: Spade Score: 85 First Name: Robert Last Name: Rothenberger Score: 90 First Name: Bill Last Name: Cohen Score: 70 First Name: q *** RESULTS *** Highest Score: 90 Sudents who got the highest score: Jack Smith Robert Rothenberger Average (counting all grades): 73.3333 Students who scored below average: Joe Smith Bill Cohen Average (not counting the highest and lowest grade): 80 Curve: 5 *** SCORES *** Joe Smith 35 John Doe 80 Jack Smith 95 Sam Spade 90 Robert Rothenberger 95 Bill Cohen 75 |
| HW#4 Due: Monday Jan 29, 2007 |
Submit the following to Angel ABOUT PRIME NUMBERS A prime number is a number that is divisible by only 1 and itself. For example, the numbers 1, 2, 3, 5, 7, 11 are all examples of prime numbers. However, 4 and 6 are NOT prime since they are divisible by 2. The number 9 is also NOT prime since it is divisible by 3. To determine if a number, N, is prime it is not strictly necessary to check if N is divible by every number below it. Rather, mathematically, it can be proven (we won't show the proof here) that N is prime if and only if it cannot be divided evenly by any prime number (other than 1) which is less than N. For example:
THE ASSIGNMENT Write a program that figures out and displays the first 100 prime numbers (i.e. 1,2,3,5,7,11,13,15,19,......). Your program should calculate the primes one at a time starting from the lowest numbers. As each prime is calculated it should be stored in an array that contains all primes that your program has calculated so far. When your program tries to calculate what the next prime number is it should check to see whether or not the number it is examining is divisible by all of the primes that the program has calculated so far. Using an array to remember all primes calculated so far makes the program to calculate 100 primes much more efficient than if you would not use an array. |
| HW#5 Due: Wednesday Jan 31, 2007 |
Finish the following project for next class. Bring your code in to class. We will be building on this some more. You do not have to submit this project yet. However, you will be asked to submit it later after we have built it up some more. ASCII ART
The following "picture" was created using "regular" characters. This kind of picutre is sometimes referred to as ASCII art:
....................
....................
........HHH.........
........HHH.........
........HHH.........
.........|..........
.........|..........
...AAAABBBBBAAAA....
...AAAABBBBBAAAA....
...AA..BBBBB..AA....
...AA..BBBBB..AA....
...AA..BBBBB..AA....
.......LL.LL........
.......LL.LL........
.......LL.LL........
.......LL.LL........
.....FFFF.FFFF......
.....FFFF.FFFF......
....................
....................
THE ASSIGNMENT
Write a program that creates ASCII art. Your program should use a two dimensional array to store the characters that make up the picture. Your program should contain the following subs:
You should create and display a picture from the Main() sub by making appropriate calls to the subroutines mentioned above. |
| HW#6 Due: Mon Feb 5, 2007 |
Finish the following project for next class. Bring your code in to class. We will be building on this some more. You do not have to submit this project yet. However, you will be asked to submit it later after we have built it up some more. Slope and The Formula of a Line
Given two points on a line, (i.e. x1,y1 and x2,y2) the slope of the line, m, is defined as (y1-y2)/(x1-x2). EXAMPLE: If a line contains the two points 1,2 and 3,4 (i.e. x1=1, y1=2 and x2=3, y2=4) we can determine the slope of the line as : One form of the mathematical formula for a line is : EXAMPLE: Given a line which contains the point 0,0 and has a slope of 2. If you choose a specific x value for a point on this line you can figure out the y location for that point using the equation listed above. For example the y value for the point on the line with an x value of 1 is: THE ASSIGNMENT
The following is a continuation of the project that creates ASCII art. Add the following subroutines to your program
|
| HW#7 Due: Mon Feb 12, 2007 |
Bring your code in to class. We will be building on this some more. You do not have to submit this project yet. However, you will be asked to submit it later after we have built it up some more. NOTE: I added the menu choices to Draw a rectangle, draw an empty rectangle and Exit. You do not have to do all this for next class. As I mentioned, I am not asking for you to submit this yet. However, you will be expected to have these options later when I do ask you to submit the program. THE ASSIGNMENT
In this assignment you will continue to develop the ASCII art program. The program will be modified to be able to create and display several different pictures. Your program should maintain an array of pictures. The following code can be used to declare a one dimensional array that holds 100 two dimensional arrays:
To create a specific 2d arrays you can use code similar to the following. The following code creates a 2d array of 20 by 30 in the first slot of the array of pictures. It then creates a 2d array of 10 by 10 in the 2nd slot of the array of pictures.
Modify your program so that each sub that works with a picture will take as its first parameter a 2 dimensional array. For example to draw a line the program should have the following sub:
This first parameter allows the caller to specify in which picture the line should be drawn. For example the following code will draw a line made out of x's in the 2nd picture (i.e. index 1) but not in the first picture (index 0).
Your program should display the following menu to the user: Make a choice The following explains what the program should do when the user chooses each option
|
| HW#8 Due: Wed March 14, 2007 |
Implement the classes that are shown in the following class diagram. Click on one of the links below to see the diagram. All the links show the same diagram (in different formats). |
| HW#9 |
Exception Classes (click to see the assignment) |
| HW#10 |
Creating and using a .dll (click to see the assignment) |
| HW#11 |
VectorCanvas (click to see the assignment) |
| HW#12 |
Reading a file (click to see the assignment) |
| HW#13 |
Saving a VectorCanvas in a file (click to see the assignment) |