3/31/2020 CSIS 420 – Language Programming Problems
CSIS 420 – Language Programming Problems
The primary purpose of these programming assignments is to give you an opportunity to demonstrate the novel syntax and semantics of your language; for full credit, you need to solve these problems in a way that uses and demonstrates the features of your language.
1. 20% – n!
Write a factorial program (preferably recursive) that accepts a single integer n as input and outputs n!. Input can be passed to the program as a command-line parameter (preferred) or read from the keyboard. Note: if your language provides some sort of factorial function or operation, write your own here to demonstrate how to write (recursive) functions.
2. 30% – Structured Information Sorter
Write a program that keeps track of information about Persons. A Person has a character string attribute called name and an integer attribute called age. If your language permits, you should create an abstract data type for this kind of information. If your language does not have a mechanism for building abstract datatypes such as record, struct, class, etc., improvise.
Your program should read from this datafile of comma-delimited name/age pairs and populate your program with a collection (or array) of Persons. Your program should then sort the set by name, output the the name of each Person in sorted order, and output the average age of all the Persons.
Note: if you find working with my datafile to be too difficult you may either modify the structure (but not order) of the datafile or hard-code the data into your program (while preserving the initial order of the data) but you must justify your inability to perform I/O on the existing datafile in your report.
3. 50% Random Text Generator
Re-implement the Random Text Generator program that is assigned in approximately the 4th week of the course using your programming language.
You can (and should) use any features provided by your language to solve these problems (i.e., generally do not reinvent the wheel). However, you should not add any non-standard feature or library to your language to aid you.
Last modified: 12/30/2016 09:18:32, by David M. Hansen
dhansen.cs.georgefox.edu/~dhansen/Classes/Languages/Protected/programs.html#generator 1/1