Question: 1)Gain experience using the Eclipse IDE; including its environment for managing files. 2)Gain an understanding of Strings within Java. 3)Gain further experience with control structures.
1)Gain experience using the Eclipse IDE; including its environment for managing files.
2)Gain an understanding of Strings within Java.
3)Gain further experience with control structures.
4)Gain a further understanding of processing binary files.
5)Practice good programming techniques.
The output must be run for a page width of 60, left margin of 2 and right margin of 2, and for a page width of 50, left margin of 5 and right margin of 5.
The university registrar wants a new program to print course information for the catalog. In printing, the registrar wants to be able to specify the page widths and margins. For example if run with page width of 60, left margin of 2 and right margin of 2 the report would look like:
Course Catalog
---------------------------------------------------------------------------
COSC 110 Problem Solving and Structured Programming 3c-0l-3cr
An introduction to the development of algorithmic solutions to a variety of
problems and the development of computer programs to implement the
solutions. Explores standard programming structures used to introduce
fundamental algorithmic/programming concepts including variables,
assignments, conditionals, loops, functions, and arrays and their role in
problems solving. Emphasizes structured programming in the development of
algorithm solutions to common problems. Object-oriented paradigm is
introduced at a basic level.
---------------------------------------------------------------------------
COSC 493 Internship in Computer Science 0c-0l-12cr
Prerequisite: COSC 105, COSC 220, COSC 300, COSC 310, COSC 319, COSC 341,
COSC 380
Positions with participating companies provide students with paid
Experience in computer science under supervision of the companies and
faculty.
---------------------------------------------------------------------------
If instead the run with a page with of 50, right margin of 5 and left margin of 5 the report would look like:
Course Catalog
----------------------------------------------
COSC 110 Problem Solving and Structured
Programming 3c-0l-3cr
An introduction to the development of
algorithmic solutions to a variety of problems
and the development of computer programs to
implement the solutions. Explores standard
programming structures used to introduce
. . .
Input:
Catalog data file (catalog.dat) - binary with the following fields per course:
Major code UTF-8 String
Course number 2 byte twos compliment integer
Course title UTF-8 String
Class hours 1 byte twos complement integer
Lab hours 1 byte twos complement integer
Credits 1 byte twos complement integer
Number prerequisites 1 byte twos complement integer
Following repeats number of prerequisite times
Prereq major code UTF-8 String
Prereq course number 2 byte twos complement integer
Course description UTF-8 String
Output:
See introduction for sample report.
Notes:
The title string consist of a the course major code, course number, course title and end with a credit string where the credit string is the class hours followed by c- concatenated with the lab hours followed by l-, and then concatenated with course credits followed by cr. The course major code, course number and course title are separated by one space. If the title string does not fit on a line then it is to be word wrapped on spaces. The credit string is to be left justified on the last line of the printed title string and must have at least one space prior.
Prerequisite string is the concatenation of Prerequisites: and the list of prerequisite major code and course numbers. A comma is to separate each item in the list. A space is to separate major code and course number. If the prerequisite string cannot fit on a line then it is to be printed wrapped on commas (not the space between a major code and course number. If there are no prerequisites then the prerequisites line is to be omitted.
The description is to be printed word wrapped on spaces.
A blank line is to separate the title string, prerequisites (if any), and description.
A dash line is to separate courses. The dash line is to be page width, minus left margin, minus right margin in length.
All printed lines are to be indented a right margin number of spaces.
Implementation Requirements:
1)The catalog file, page width, left margin and right margin must be passed in from the command line.
2)Abide by the one to many design pattern between and course and its prerequisites. DO NOT PASS AN ARRAY when creating a course. Add prerequisites to a course one at a time.
3)Courses do not need to be stored into a data structure. It is fine to simply have the report program read a course and print it.
4)A course input stream class must be used to read the catalog file. Its readCourse method is to return a course which includes the prerequisites of the course.
5)ABIDE by good programming practices. Define javadoc, good formatting, etc.
Bonus (5 points)
Print the description fully justified. That is for all lines except the last printed line of the description distribute evenly within reason any spaces that would be at the end of the line (due to word wrap) between the words on the line. The last letter of the last word of a line should be in the column before the right margin.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
