Sale!

CS2303 PROGRAMMING ASSIGNMENT #6 NEWSIES! solved

$35.00 $21.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

(0) Tech News
In our version of the “Tech News” staff, there is an Editor in Chief, a
Deputy Editor, and 6 Assistant Editors, one for each of the six departments in the publication:
News, Editorials&Opinion, Features, Sports, Entertainment, and Humor.
There are also numerous writers of two ranks: Cub Reporters who have
been on the job for just a term or two, and Reporters who have at least
two full terms of experience behind them.
We will have enumerated types for these notions, namely “article” and
“position”, available for use. They are defined already in the starter code.
(1) Extend the Student class to include the fields that pertain to reporters:
position title (Editor-in-Chief, Deputy Editor, Asst. Ed., Reporter, Cub)
article primary (Writer’s principal department of contribution)
article secondary (Writer’s back-up responsibility–can be None: ‘6’)
article tertiary (Writer’s emergency responsibility–None for Cubs)
int term goal (Number of articles to contribute for class credit)
int term kount (Number of articles contributed this term to date)
int terms (Length of service in # of terms, min 1, includes current term)
string non de plume (Writer’s pen name for bylines)
assignment current priority (Writer’s main assignment–can be NULL/none)
assignment current extra (Writer’s extra assignment–can be NULL/none)
assignment current emergency (Writer’s overload assignment–most NULL/none)
1
(2) Create Data Structure (Vector, List, Stack, Queue, etc.)
Read in the file “NewsiesStaff.txt” provided, and create a data structure
of Newsies.
Note: the file is formatted with an integer sentinel to signal the number of
Newsies to be read in.
The format of each Newsie line is: firstname, lastname, GPA, IDnum, title,
primary, secondary, tertiary, term goal, term kount, terms, non de plume.
The supplied code is set up to read it as is, but you need to know which
field is which. The variable names correspond, intuitively, to what you
would expect.
Similarly, read in the “AssignmentEditorTxt.txt” file and build a data
structure of assignment structs. Don’t forget to set the assigned bool data
field to ‘false’. Now that I think of it, you might want to supply it with an
assigned Newsie field. Might make things a little easier.
You’ll want to be able to walk up and down1 both these data structures
from end to end, so I recommend vectors.
(3) Assignment Desk
Glossographer Gompei is the assignment editor, the Old Goat. Gompei’s
job is to make sure that all the assignments get distributed to the writers
for this week’s edition.
This is the meat of the current assignment. (The computer science assignment.) Gompei’s task is to make sure each prospective newspaper story is
assigned to a writer. There are only two constraints:
First: No article can be assigned to a writer who does not work the corresponding desk. That is, Skye Svenson writes Entertainment, Sports, and
Humor so must not be assigned a News story.
Second: No writer can take on more than three (3) stories at a time, a
priority, an extra, and an emergency.
FULL STOP
1Perhaps just be able to reset to the beginning to try another pass.
So that’s all you need to do. Walk up and down your two vectors until all
the stories have homes with corresponding writers.
FULL STOP
You think there should be more?
Is the task possible? What if, instead of 26 writers (as we have) and 42
well-distributed stories (as we have), there were 10 and 60, respectively?
Clearly impossible. It shouldn’t be hard here under our numbers, but under what conditions will it prove impossible?
Is it possible that you could start assigning stories and paint yourself
into the proverbial corner. That is, if you give out all the News stories to
people who also write Humor, might you end up without enough writers
for those stories?
What about equity?
Should Old Goat Gompei distribute stories with a sense of fairness?
Should everybody get a story before anybody gets a second? How would
you implement that?
Should writers who have not completed their term’s goal get stories before those writers who have fulfilled the term’s requirements?
Should News writers get three News stories right away and then miss out
on the Features and Humor pieces they also write? Note: Just because a
writer has three categories of interest doesn’t mean three different article
categories must be assigned. Or does it?
Should a News, Features, and Humor writer get saddled with three Humor stories, or should be guarantee the first story to be the writer’s primary
interest?
We called one of the writers’ slots “emergency”. Why? Would it be a
legitimate distribution of stories for Gompei to give a writer three stories
while another writer–someone who could take one of those three–gets none?
In what order should the writers get their stories? Cub Reporters before
Reporters? By seniority perhaps? Experienced Editors before Reporters
or Reporters before busy Editors?
You don’t have to do any of that. But think about it. How do the nature
of our data and the way we have presented our data influence what can be
done and what you think should be done?
These are important parts of the human activity of software development.
(4) Post this week’s article assignments on the assignment board.
You should create two Newsie class member functions:
The first is: void print weekly rollcall(vector2 all writers)
For each writer, the console display should be:
first non de plume last title :
article workingtitle
.
.
.
.
.
.
.
.
.
If a writer has no assignment, “NONE” should be displayed:
So a possible start to the output might be:
Alex The Goat Aaron Reporter:
News Voter Registration Drives Face New Challenges
Editorials&Opinion Climate Change: Our Future Is On Fire
Bert The Noob Barron Cub Reporter:
NONE
Chris The Bozz Cartier Editor:
Humor Caprine Corner: You Have GOAT To Be KIDding Me!
(And so on. . . )
Feel free to format it nicely–can you put quotation marks on the nicknames? “The Bozz” instead of just The Bozz”? Can you strip out the
underscore to make it “The Bozz”? Unimportant! But feel free to give it
a go.
You should also write:
void print weekly assignment desk(vector3 all assignments)4
For each assignment, the console display should be:
lastname title article workingtitle
2Whatever data structure you use–vectors will likely be simplest
3Whatever data structure you use–vectors will likely be simplest
4Does this one really need to be a Newsie member function?
If a story has no writer, UNASSIGNED should be display instead of last
and title .
So a possible start to the output might be:
Aaron Reporter News Voter Registration Drives Face New Challenges
Aaron Reporter Editorials&Opinion Climate Change: Our Future Is On Fire
Cartier Editor Humor Caprine Corner: You Have GOAT To Be KIDding Me!
UNASSIGNED Sports Pawsox to Become Woosox
(And so on. . . )
Again, feel free to make it pretty. Ooh! Perhaps an index as the first thing
on the line?
(5) Evaluation
Gompie’s supervisor will evaluate the report based on the following criteria:
Class Extension Newsie Class and File I/O 25%
Data Structures Vectors (?) Developed 25%
Assignments Writers and Assignments Handled 25%
Reports Working Print Functions 25%
(Good working code gets full credit.)