Computer Science 340
Programming Languages
Fall 2019, Siena College
This problem set consists of several relatively short programming tasks and other questions. You may work alone or with a partner on this assignment.
Getting Set Up
You will receive an email with the link to follow to set up your GitHub repository for this problem set (ps5-yourgitname). If you are working on this problem set with a partner, one member of the group should follow the link to set up the repository on GitHub. Your problem set partner will receive a subsequent email with a link to follow that will grant them the rights to clone the repository and commit and push changes to the origin on GitHub.
By 4:00 PM, Tuesday, October 22, 2019, all repositories must be created and if working in a group, the partner who did not create the repository must have write access to the repository. Your name(s) must be in the repository by this deadline as well.
Langauges on noreaster
This assignment will ask you to write programs in four languages: C, C++, C#, and Java. Please make sure all programs run on noreaster. In case you never knew or have forgotten, here is how to compile and run a program in each of these languages (using examples from the late penalty calculators in the shared area).
To compile:
gcc -o late late.c -lm
Note that -lm is needed only if linking with math library functions.
To run:
./late
To compile:
g++ -o late late.cc
To run:
./late
To compile:
mcs Late.cs
To run:
mono Late.exe
To compile:
javac Late.java
To run:
java Late
Questions and Programs
All programs required are to be treated as "Practice Programs" in terms of collaboration and grading. You are welcome to discuss them with your classmates, and I will grade only on correctness, not documentation, style, etc. Of course, you should still make sure your name is in every file you submit! Unless otherwise specified, all programs should be included in your submission and you should make sure they run on noreaster. Written responses may be in a PDF file included in your repository or in the repository's README.md file.
Address | Contents |
00CCCC00 | |
00CCCC01 | |
00CCCC02 | |
00CCCC03 | |
Sign Bit | Exponent | Mantissa |
We saw in the example of Pascal subranges that with the fpc compiler on noreaster, an assignment of a variable to a constant outside of the subrange generates a warning at compile time, but that values outside the range are still allowed.
Minute := Minute * 3;
Submission
Commit and push!
Grading
This assignment will be graded out of 55 points.
Feature | Value | Score |
Question 1: computing addresses | 4 | |
Question 2: Programming Exercise 5 programs | 9 | |
Question 2: Programming Exercise 5 explanation | 3 | |
Question 3: Programming Exercise 6 programs | 3 | |
Question 3: Programming Exercise 6 results | 2 | |
Question 4: Ch. 5 Programming Exercise 7 program | 6 | |
Question 4: Ch. 5 Programming Exercise 7 explanation | 2 | |
Question 5: 2's complement | 2 | |
Question 6: Ch. 6 Programming Exercise 7 program | 5 | |
Question 6: Ch. 6 Programming Exercise 7 results and explanation | 3 | |
Question 7: IEEE 754 | 2 | |
Question 8: BCD | 2 | |
Question 9: Strings | 3 | |
Question 10: Pascal ranges | 4 | |
Question 11: 2D Array | 2 | |
Question 12: Python Lists | 3 | |
Total | 55 | |