Beruflich Dokumente
Kultur Dokumente
.0 CSS 162: Programming Methodology Due Thursday the 11th at Midnight Instructor Rob Nash, Spring 2013
Summary
In this assignment, you will build a program using techniques from previous CSS courses that counts unique fractions. No new constructs from our readings are expected, and as such, you can complete this program with just a handful of lines (10-20) of code in just one main function. You will need to use loops, ifs, comments, etc., (in other words, structured programming) to complete this assignment and achieve the outcomes listed below. Included below is a sample execution of your program as well as a list of outcomes your program is to implement; notice reducing fractions is optional in version one of the assignment.
Introduction
Your project is to read in a series of fractions from a text file, which will have each line formatted as follows: A/B. A sample text file is listed below, and the purpose of your program is to read in each fraction and count the number of occurrences for the current fraction. When all the input is consumed (or as the input is consumed), your program will print out its list of unique fraction and their corresponding count see the output below (and you may assume no blank lines or misleading characters; see the text file link on the website for one of the actual inputs Ill use when testing your submission).
Questions
Answer the following questions using multi-line comments in your code. (5%) Can you complete this without using arrays? What is the least number of variables you can use to solve this problem? Can you use just one array to solve this? What would the data type be of that array? Can you nest* one class (data type) within another, like we observe with nested loops? What is an example of this? (*compose) What are some solutions to the reduction problem other than Euclid's GCD algorithm?