All students for all passing grades must do the following programs on the computer.
Instructions for Conventional Grading Students.
Do Problems A and R. You will get a separate numerical grade on each of these problems, each of which will be averaged in your homework set.
Bonus:
If you hand this assignment in ON TIME, you get
four activity bonus.
This problem is being given out at the beginning of the semester
and as such, is relatively easier. Thus it is not eligible for the
one letter grade bonus.
C REQUIREMENTS
Complete the above Problem ONE and four other activities
B REQUIREMENTS
Complete the above Problem ONE and six other activities
A REQUIREMENTS
Complete the above Problem ONE and nine other activities
ITEM a.
Write a program that will read in three numbers from the
terminal.
You should provide a meaningful prompt for each number read in.
Then you should print out the sum. You should proceed the number for the sum with a meaningful label.
This is a modification of the example in Unit 1.4.
ITEM b.
program ass1b;
var a:integer;
b:integer;
c:integer;
d:integer;
begin
a:=1;
b:=2;
c:=3;
d := a+b+c;
write(' d is ',d);
writeln;
d := a+b+c+7;
write ('second d is ',d);
writeln;
end.
ITEM c.
program ass1c;
var a:integer;
b:integer;
c:integer;
d:integer;
begin
a:=1;
b:=2;
c:=3;
d := a*b*c;
write(' d is ',d);
writeln;
d := a*b*c*7;
write ('second d is ',d);
writeln;
end.
ITEM d.
program ass1d;
var a:integer;
b:integer;
c:integer;
d:integer;
begin
a:=1;
b:=2;
c:=3;
d := a+b+c;
d := a+b+c+7;
write(' d is ',d);
writeln;
write ('second d is ',d);
writeln;
end.
ITEM e.
program ass1e;
var a:integer;
b:integer;
c:integer;
d:integer;
begin
a:=1;
b:=2;
c:=3;
d := a*b*c;
d := a*b*c*7;
write(' d is ',d);
writeln;
write ('second d is ',d);
writeln;
end.
ITEM f.
program ass1f;
var a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
begin
a:=5;
b:=a*a;
a:=a+1;
c:=a*a;
a:=a+1;
d:=a*a;
a:=a+1;
e:=a*a;
writeln(' a is ',a);
writeln(' b is ',b);
writeln(' c is ',c);
writeln(' d is ',d);
writeln(' e is ',e);
writeln;
end.
ITEM g.
program ass1g;
var a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
begin
a:=5;
a:=a+1;
a:=a+1;
a:=a+1;
b:=a*a;
c:=a*a;
d:=a*a;
e:=a*a;
writeln(' a is ',a);
writeln(' b is ',b);
writeln(' c is ',c);
writeln(' d is ',d);
writeln(' e is ',e);
writeln;
end.
ITEM h.
program ass1h;
var a:integer;
b:integer;
c:integer;
d:integer;
e:integer;
begin
a:=1;
b:=2;
c:=3;
d:=4;
e:=(a+b)*(c+d);
writeln( 'first value is ',e);
e:=a+b*c+d;
writeln( 'second value is ',e);
e:=a+(b*c)+d;
writeln( ' third value is ',e);
end.
ITEM i.
program ass1i;
var a:integer;
b:integer;
c:real;
d:real;
e:integer;
f:real;
begin
a:=5;
b:=3;
c:=5;
d:=3;
e :=a div b;
writeln ('e is ',e);
f := a div b;
writeln ('first f is ',f);
f := c/d;
writeln ('second f is ',f);
end.
ITEM j.
program ass1j;
var a:integer;
b:integer;
c:real;
d:real;
e:real;
f:real;
g:real;
h:real;
begin
a:=5;
b:=3;
e:=100;
f:=1000;
g:=5;
h:=3;
c := e + (a div b) + f;
d := e + (g / h ) + f;
writeln(' c is ',c);
writeln(' d is ',d);
end.
ITEM k.
What does the following PASCAL program do? You should show the boxes and what happens to the numbers inside them, in addition to showing what will be printed.
Assume that the input is '2 3 7'.
I want to make sure you didn't just type the program in, run it and not think about it. You are welcome to type the program into the computer and run it, but I want you to think about it as well. That's why I will have to insist that you "show work."
ITEM l.
What does the following PASCAL program do? You should show the boxes and what happens to the numbers inside them, in addition to showing what will be printed.
I want to make sure you didn't just type the program in, run it and not think about it. You are welcome to type the program into the computer and run it, but I want you to think about it as well. That's why I will have to insist that you "show work."
Assume that the inputs is '1 4 6 7'.
ITEM m.
Which of the following programs are syntactically correct? The
errors you should look for are called "compile-time errors." They
got this name because the compiler will catch these errors.
Explain why or why not each program is correct.
Note that none of these programs will do anything meaningful if run, I am just concerned as to which ones will be successfully compiled by the compiler.
A written explanation is required; simple yes or no or other laconic replies will not get graded.
Do not worry about spotting "run-time errors" (errors not spotted by the compiler). The purpose of this assignment is to verify you know the language syntax.
Note: More than one of these programs may be correct.
Part I.
Part II.
Part III.
Part IV.
ITEM n.
What does the following PASCAL program do? You should show the boxes and what happens to the numbers inside them, in addition to showing what will be printed.
I want to make sure you didn't just type the program in, run it and not think about it. You are welcome to type the program into the computer and run it, but I want you to think about it as well. That's why I will have to insist that you "show work."
Assume that the input is '9 8 7 5'.
program hw23a;
var a,b,c,d,e:integer;
begin
read(a);
read(b);
read(c);
read(d);
d:=d+a+b;
c:=c+1;
e:=(c+(a+b+d)+d)-(d-5-a);
write(c);writeln;
write(d);writeln;
write(e);writeln;
end.
ITEM o.
What does the following PASCAL program do? You should show the boxes and what happens to the numbers inside them, in addition to showing what will be printed.
I want to make sure you didn't just type the program in, run it and not think about it. You are welcome to type the program into the computer and run it, but I want you to think about it as well. That's why I will have to insist that you "show work."
Assume that the input is '1 4 6 7'.
The following are writing assignments. They count towards meeting the writing assignments as well as the requirements of this assignment set.
program hw23a;
var a,b,c,d,e:integer;
begin
read(a);
read(b);
read(c);
read(d);
d:=d+a+b;
c:=c+1;
e:=(c+2*(a+3*(b-1-a)+d)+d)-(d-5-a);
b:=(e-2*(b-2*(e-3*(d+e+a+5-2*(a+3*b)))))-(a-3*(b-4*e+5));
write(b);writeln;
write(c);writeln;
write(d);writeln;
write(e);writeln;
end.
ITEM p.
What does the following PASCAL program do? You should show the boxes and what happens to the numbers inside them, in addition to showing what will be printed.
I want to make sure you didn't just type the program in, run it and not think about it. You are welcome to type the program into the computer and run it, but I want you to think about it as well. That's why I will have to insist that you "show work."
Assume that the input is '9 7 6 4'.
program hw23a;
var a,b,c,d,e:integer;
begin
read(a);
read(b);
read(c);
read(d);
d:=d+a+b;
c:=c+1;
e:=(c+2*(a+3*(b-1-a)+d)+d) mod (d-5-a);
b:=(e-2*(b-2*(e-3 mod (d+e+a div 5-2*(a+3*b)))))-(a-3*(b-4*e+5));
write(b);writeln;
write(c);writeln;
write(d);writeln;
write(e);writeln;
end.
ITEM q.
The taxman is coming!
As you know, tax forms are due April 15th of this year.
Write an article with several pages on computer applications current, future (and if you desire, past) at the Internal Revenue Service. This article should be suitable for publication in a location for intelligent readers who are not necessarily computer-experts, e.g. Business Week, Wall Street Journal, or Scientific American.
You should write it to be published at about March 15th or so as an interesting piece--write it to attract and maintain interest.
Hopefully, a few might be submitted some place including our own Western Courier, the Macomb Journal or even one of the other places. We can also send it out on the USENET GROUP, misc.taxes or comp.risks.
Also, hand in a separate copy of the list of sources and references you used--you should have at least three resources.
It needs to be properly word processed in a suitable format. Of course, it should be free of errors of content, grammar, spelling and formatting.
ITEM r.
Memo format looks something like this:
To: name of person receiving memo
title, department, etc.
From: your name
your title, department, affiliation, etc.
Re: subject
Date: today's date
Body of text containing actual contents of memo.
There are NO signature lines, etc. at the end. If you wish to sign your memo, you can sign or initial it near where you write your name in the "From:" format.
Remember that your memo needs to be properly word processed in a suitable format. Of course, it should be free of errors of content, grammar, spelling and formatting.
ITEM s.
For those of you who know (USENET news), or are willing to learn it.
Read comp.lang.pascal. Answer one question or reply to one posting. Your response should either a) cite some reference material or b) include some sample code that you have tested on the computer to illustrate your point.
Hand in whatever you replied too, your response, any responses that were given to you and your rebuttal (if any is appropriate).
You may do this up to three times to count as appropriate. If you write an answer to a question that has something to do with another unit, you may count the assignment as part of that unit. E.G., if you answer a question on do loops, you may count that response in Assignment Set 4 and Assignment Set 5. (You may not count an assignment as more than one assignment).
ITEM t.
Write a scholarly paper on the subject of "visualization" for math scientists and engineers.
You should have at least three references.
ITEM u.
You are to write a ten-page report on any computer science topic. It should cite eight different submissions to any archived USENET news group. You must pick submissions that are detailed, to the point, and have high information content. It also must cite two conventional references.
Your report must be highly focused on a narrow topic. In other words, write on the STONED computer virus, not computer viruses in general.
It is anticipated that this might overlap with an assignment from some other professor. If so, you must get permission from that other instructor to use the same work for both classes. You also must ensure that whatever you submit to me obeys the above instructions, as well as meeting the requirements of your other instructor.
I may independently ask for revisions with your other instructor.
ITEM v.
Extensively rewrite or if you prefer, redo any unit that I have handed out, including example programs, that you feel you can improve upon. If I like what you did and it fits into the rest of my class notes, I will use it next semester instead of my notes (with full acknowledgements).
You may do this up to three times for credit. If you do this to a unit after Unit 1.4 , you may count the assignment as part of that unit. E.G., if you answer a question on do loops, you may count that response in Assignment Set 4 and Assignment Set 5. (You may not count an assignment as more than one activity in different assignment sets.).
ITEM w.
Write up any homework that you did for a given assignment set in a different language. E. G., you may do your problem A in BASIC.
Write a discussion of the differences between the program in a different language. Note that you must hand in one Turbo Pascal program for each assignment set.
You may do this in any other assignment set for a different language. E.G., you may do one of the assignment set 2 in something other than Turbo Pascal for credit for one assignment from that language.
You may be asked to demonstrate your translated program.