./pgm < /dev/null
./pgm < pgm
!
).
$ ./unshred < unshred ! Non-integer read from input. $
$ ./unshred < /dev/null $
Output rectangles one per line with the format x1 y1
x
x2 y2.
THIS SI FINAL DISPLAY OF AN ARRAY {[ 1, 1 ], [ 3, 3 ]} Level is : 0 Position is : 0 {[ 2, 2 ], [ 4, 4 ]} Level is : 1 Position is : 0
(cerr)
.
Date: 27 Sep 2003 13:41:19 -0500 From: rclayton@monmouth.edu To: 509 Subject: Follow directions. Many people are losing many points on the first assignment because they're not following directions, particularly for output format. For example, the following is an answer produced by one of the assignments: Enter the ink intervals on edges of all shreds for unshredding the document: The edges of unshredded document: 1 2 1 2 The answer is correct, but it won't be getting full credit because, in addition to the correct answer, it output all that other stuff, which was not part of the output required by the assignment. Starting with your second assignment, I'm going to consider such output to be flat out wrong.
Date: 5 Oct 2003 18:22:38 -0400 From: rclayton@monmouth.edu To: s0-----@monmouth.edu Subject: Decorated output. I agree that you did not directly mention about prompting in the assignment page. But I did expliclty mention during the passing lecture not to prompt for input and decorate output. I did this because I though it would be helpful if someone wants to test the program. The only tester you should worry about is me; if you want to be helpful, you should do what I ask.
.cc
files.
#include "my-list.cc"
The road to wisdom?
Well it's plain and simple to express:
err and err and err again
but less and less and less.---- Piet Hein
Date: 14 Dec 2001 13:41:19 -0500 From: rclayton@monmouth.edu To: s0------@monmouth.edu Subject: Re: assignment 7 Since these are the final days of the semester, every deadline seems to come together at once. Could we have an extension for the final assignment for CS-509. Sorry, no deadline extensions.
Date: 29 Oct 2001 11:29:37 -0500 From: rclayton@monmouth.edu To: s0------@monmouth.edu Subject: Assignment deadline. I've had a report, a project, a mid-term test and your assignment due this week. Can I get an extension on the assignment? No, sorry - no extensions.
Date: 6 Mar 2003 16:36:14 -0500 From: rclayton@monmouth.edu To: s0------@monmouth.edu Subject: Deadline extension Is it possible to postpone the project due date by a couple of days? All the school labs are closed from Friday 5 pm to Monday morning, and some of us don't have computers at home. Because you've been working on this project for the past three and a half weeks, I'm disinclined to extend the deadline. What you've accomplished up to this point should be more than enough to do well in the project; the bells and whistles you could add in the remaining days, although they may be interesting, are probably not important in meeting the project's requirements.
Date: Wed, 10 Sep 2003 11:26:12 From: s0------@monmouth.edu To: rclayton@monmouth.edu Subject: using send-files I couldn't get send-files to work.
Date: Wed, 10 Sep 2003 11:32:36 From: s0------@monmouth.edu To: rclayton@monmouth.edu Subject: I can't get send-files to work I was trying to send the program from rockhopper while telnetting in. Does it have to be sent from an on campus machine? I followed the instructions on the assignment page: send-files -a 1 -s 305lab1a.cc It says it can't find "send-files".
void eat_white() { while (cin && isspace(cin.peek())) cin.ignore(); } void f() { while(cin && (cin.peek() != EOF)) { cin >> s; eat_white(); } }
$ program < /dev/null
$ program < program
// main function int main() { count = 0; // make counter to zero // Break the loop if temp_sum >= sum_of_vec while (temp_sum < sum_of_vec) {
// Find the largest sub-sum less than the total. while (temp_sum < sum_of_vec) {
// Represent expressions as binary trees.
// Insert the constant value n into the tree.
unsigned check(unsigned n) { ... }
Check what? For what? And then what?
// Function to check if the number is Prime unsigned IsPrime(unsigned Pnum) { ... }
O.k., check if (I guess) Pnum
is prime. Then what?
We're not playing 20 questions; we're communicating.
bool IsPrime(unsigned n) { // Return true iff n is prime. }
char *temp = new char[5]; strcpy(temp,"<FONT"); char *temp2 = new char[5];
bool readInst(List *L, char *&inst, int noInst) { char * line = new char[80]; inst = new char[80]; strcpy(inst, "\0"); line = L->getNext(); if ( line == NULL ) inst = NULL; return false; }
main()
is not freeing storage.
void main() { LList list; cout << "Please enter a sequence of sets of " << "algebraic eq. (ctrl+d) to end" << endl; int setCount = readInput(list); printResults(list, setCount); }
or
ceiling((42 - 20)/5)
= 5 points off.
bool alpha_test(vector < string > vect) if (vect[0] == "move") if (vect[1] == "r0" || vect[1] == "r1" || vect[1] == "r2" || vect[1] == "r3" || vect[1] == "r4" || vect[1] == "r5" || vect[1] == "r6" || vect[1] == "r7") { if (vect[2] == " r0" || vect[2] == "r1" || vect[2] == " r2" || vect[2] == "r3" || vect[2] == "r4"||vect[2] == "r5" || vect[2] == "r6" || vect[2] == "r7") { } if (vect[2] == "r0" || vect[2] == "r1" || vect[2] == "r2" || vect[2] == "r3" || vect[2] == "r4" || vect[2] == "r5" || vect[2] == "r6" || vect[2] == "r7" ) { } bool move_test(vector < string > vect ) if (vect[0]!="move") for (unsigned int k = 1; k < vect.size();k++) if (vect[k] == "r0" || vect[k] == "r1" || vect[k] == "r2" || vect[k] == "r3" || vect[k] == "r4" || vect[k] == "r5" || vect[k] == "r6" || vect[k] == "r7") { }
int ans = check(s.substr(i,j-i)); if (ans == 1) { /* whatever */ } else if (ans == 2) { /* whatever */ } else if (ans == 3) { /* whatever */ } else if (ans == 4) { /* whatever */ } else if (ans == 5) { /* whatever */ } else if (ans == 6) { /* whatever */ } else if (ans == 0) return false;
char ch[200] while cin.getline(ch, 200, '\n') ... f(200) ...
Have you changed all proper values?
Have you left alone all other values?
#define INVALID 0 #define NUMBER 1 #define VARIABLE 2 #define OPERATOR 3 #define LB 4 #define RB 5 #define EQUAL 6 if (StBlk[row][0].Type() != VARIABLE) /*...*/ if (StBlk[row][col].Type() == INVALID) /*...*/ if ((StBlk[row][col].Type() == NUMBER || StBlk[row][col].Type() == VARIABLE) && (StBlk[row][col+1].Type() == LB)) /*...*/ if (StBlk[row][col].Type() == EQUAL) /*...*/ if (StBlk[row][1] .Type() != EQUAL) /*...*/
const int INVALID = 0, NUMBER = 1, VARIABLE = 2, OPERATOR = 3, LB = 4, RB = 5, EQUAL = 6;
system()
.
system()
will be broken for testing.
A[-1]
is never correct.
A[4294967295]
.
This page last modified on 20 January 2004.