Cash-back offer from May 2nd to 7th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 16.00

Programming Assignment 1 and 2

Question posted by
Online Tutor Profile
request

Software Design Document for Secret Simulation

Programming Assignment 1 and Programming Assignment 2 complete solution correct answer key
Prepared For
Dr. Rick Coleman, Instructor
CS 221, Data Structures in C++
Computer Science Department
University of Alabama in Huntsville

Software Design Document

Secret Simultation

1.0 System Overview
A secret government agency has need of a special Abstract Data Type (ADT) for use in a Basically Secret Simulation (BSS). The ADT may be thought of abstractly as three queues (3Qs). The 3Qs each can hold the same type of data structure. Commands at regular time intervals (CARTI) will be sent to this portion of the BSS. Command one (C1) will be to dynamically create a data structure (DCDS), place into the data structure information to be supplied (TBS), and enqueue it into the first queue (Queue A). Command two and three (C2 and C3) will be to dequeue a structure from Queue A and immediately enqueue it into Queue B (C2) or Queue C (C3). Command four and five (C4 and C5) will be to dequeue and destroy a structure from either Queue B (C4) or Queue C (C5). Details of this functionality are given in section 2.0. As usual should you or any of your programming team divulge even the smallest bit of information about this BSS we will have to shoot you. 

2.0 Referenced Documents

  • Programming Assignment 1 Statement of Work.
  • Dale, Nell and Teague, David, C++ Plus Data Structures 2nd ed. 2001.
  • “Programming Assignment 2 Hints” web page, http://cs.uah.edu/~rcoleman/CS221/ProgAssign/cs221Prog2Hints.html

3.0 Architectural Design

3.1 Concept of Execution
This program will be a simple command line application with a text only interface. When started the application will display the title and copyright information on the application and instructions on its use. When the user presses any key the screen will be cleared then the application will enter its main execution loop. 

In the main execution loop the main menu will be displayed (see Appendix A for diagram of the main menu). The user will be asked to enter a number corresponding to his/her choice of actions from the main menu. That action will then be executed. This will continue until the user selects the Quit option at which time the application will exit the main execution loop and terminate. 

3.2 Abstract Data Type
The task list will be implemented as a linked list with all list functions and data stored in a single C++ class to be called ToDoList. 
3.3 Code Outline
This program will consist of the following files:
Prog1Class.cpp - This file will instantiate an instance of the ToDoList class, implement the user interface, and handle all interactions between the user and the ToDoList object.
Class: Prog1Class.h and Program1Class.cpp

1.     Void setIntVal(int val) – Stores a single argument value in the member variable m_iVal

2.     Void setDoubleVal(double val) – Stores a single argument value in the member variable m_dval

3.     Void setStringVal(char*val) – Stores a char array string single argument in the member variable m_sLine

4.     Void setStructVals(in arg1, double arg2, char*arg3) --

4.0 Detailed Design

4.1 Source File: ProgXMain.cpp
   4.1.1 Function: main()

4.1.1.1 Purpose
This function will control the display of all screens and the user interface.
4.1.1.2 Arguments
int argc -- standard argument to main() giving the number of command line arguments. Not used.
char **argv -- standard argument to main(). Pointer to an array of pointes to char listing the command line arguments. Not used.
4.1.1.3 Return value
The function returns an int. Using standard programming procedure the value of zero will be returned to indicate to the operating system normal termination of the program without error.
4.1.1.4 Function outline in pseudocode
Instantiate a ToDoList object and other variables as needed
Print program title and instructions
Print prompt to user requesting "Press any key to continue."
Input key press
Clear screen
Begin Loop
      Display main menu
      Get user input
      if (valid input)
           switch on input number
           1 = Call clearList()
           2 = Get task info from user then call insert()
           3 = Get task info from user then call delete()
           4 = Get task info from user then call getNestTask
                 and print the info on this task()
           5 = Call printList()
           6 = Exit loop and terminate application
End Loop
Print farwell message
4.1.1.5 Tracability
This function will partially fulfill requirements 2.1 through 2.5 of the SOW by providing a user interface through which the user can execute all the functions of the application.

4.2 Source File: ToDoList.h and ToDoList.cpp
   4.2.1 Function: ClearList()

4.2.1.1 Purpose
This function will remove all nodes from the task list and free all memory associated with a list so a new list can be built
4.2.1.2 Arguments
None. Function accesses the list via the pointer member variable. 
4.2.1.3 Return value
The function returns void.
4.2.1.4 Function outline in pseudocode
Declare temp pointer to item structure
Set temp pointer to head of list
While temp is not null
      Set head pointer to head->next
      Delete node temp points to
      Advance temp to head
End While
4.2.1.5 Tracability
This function partially fulfills requirement 2.1 of the SOW by clearing any old list before the user creates a new list.

   4.2.2 Function: Insert()

4.2.2.1 Purpose
This function adds a task to the list. Tasks are inserted into the list in order with those tasks with lower priorities placed toward the front of the list.
4.2.2.2 Arguments
char *task Pointer to a character string holding the task.
int priority Integer defining the priority of the task.
4.2.2.3 Return value
The function returns void.

4.2.3.4 Function outline in pseudocode
Declare temp and back pointer to ToDoItem structures
if head == null return - nothing to delete
Set back = null and temp = head
While temp != null and temp priority != key priority
      Advance back to temp and temp to temp->next
End While
If back == null delete first node in list
      Set head = temp->next
      Delete node pointed to by temp
Else if temp != null delete from middle or end of list
      Set back next = temp next
      Delete node pointed to by temp
Else (temp is null) so report node not found
4.2.3.5 Tracability
This function partially fulfills requirement 2.2 of the SOW by removing items to the list.

   4.2.4 Function: GetNextTask()

4.2.4.1 Purpose
This function gets the next task in the list.
4.2.4.2 Arguments
None. Function accesses the list via the pointer member variable. 
4.2.4.3 Return value
Pointer to dynamically allocated character string that is a duplicate of the task string stored in the first node of the list.
4.2.4.4 Function outline in pseudocode
Declare pointer to character
if head == null return null as list is empty
Else
      Create new char array and set pointer to it
      Copy task string from first node into new array
      Call Delete function to remove node at head of list.
      Return pointer to task string.
4.2.4.5 Tracability
This function partially fulfills requirement 2.4 of the SOW by fetching the next task in the list.

 4.2.5 Function: PrintList()

4.2.5.1 Purpose
This function prints all tasks in the list on the screen.
4.2.5.2 Arguments
None. Function accesses the list via the pointer member variable. 
4.2.5.3 Return value
This function returns void
4.2.5.4 Function outline in pseudocode
Declare temp pointer to ToDoItem structure
Set temp pointer to head of list
While temp pointer is not null
      Print task and priority of node pointed to by temp
      Advance temp to temp next
4.2.5.5 Tracability
This function partially fulfills requirement 2.5 of the SOW by fetching the next task in the list.

 

 

 

Appendix A

 

Sample Main Screen Display



____________________________________________________________________

 

H O N E Y   D E W   L I S T

Things I gotta do today.

____________________________________________________________________

 

What would you like to do?

 

1. Start a new task list.

 

2. Add a task to the current list.

 

3. Remove a task from the current list.

 

4. Get the next task in the list.

 

5. Quit.

 

Enter the number of your choice then press [Enter]...

___________________________________________________________________

 

 

 

Available Answer
$ 16.00

[Solved] Programming Assignment 1 and 2

  • This solution is not purchased yet.
  • Submitted On 21 Jul, 2015 07:46:00
Answer posted by
Online Tutor Profile
solution
Software Design Document for Secret Simulation Programming Assignment 1 Monday, July 6, 2015 Prepared By Domicia N. Herring [email protected] Prepared For Dr. Rick Coleman, Instructor CS 221, Data Structures in C++ Computer Science Department University of Alabama in Huntsville   Table of Contents 1.0 System Overview............................1 2.0 Referenced Documents.......................1 3.0 Architectural Design.......................1 3.1 Concept of Execution...................1 3.2 Abstract Data Type.....................1 3.3 Code Outline...........................2 4.0 Detailed Design............................2 4.1 Source File: main.cpp..................2 4.2 Source File: ToDoList.cpp..............3 Appendices A. Sample Screen Display......................7   Software Design Document Secret Simulation 1.0 System Overview A secret government agency has need of a special Abstract Data Type (ADT) for use in a Basically Secret Simulation (BSS). The ADT may be thought of abstractly as three queues (3Qs). The 3Qs each can hold the same type of data structure. Commands at regular time intervals (CARTI) will be sent to this portion of the BSS. Command one (C1) will be to dynamically create a data structure (DCDS), place into the data structure information to be supplied (TBS), and enqueue it into the first queue (Queue A). Command two and three (C2 and C3) will be to dequeue a structure from Queue A and immediately enqueue it into Queue B (C2) or Queue C (C3). Command four and five (C4 and C5) will be to dequeue and destroy a structure from either Queue B (C4) or Queue C (C5). Details of this functionality are given in section 2.0. As usual should you or any of your programming team divulge even the smallest bit of information about this BSS we will have to shoot you. 2.0 Referenced Documents • Programming Assignment 1 Statement of Work. • Dale, Nell and Teague, David, C++ Plus Data Structures 2nd ed. 2001. • “Programming Assignment 2 Hints” web page, http://cs.uah.edu/~rcoleman/CS221/ProgAssign/cs221Prog2Hints.html 3.0 Architectural Design 3.1 Concept of Execution For fthe fhigh-level fdesign, fa fcall-return farchitecture fhas fbeen fspecified fusing fstructure fcharts. fFor fprocedural fdesign, fthe fhigh-level fdesign fmodules fhave fbeen fexplained fusing fPDL. The Scheduler farchitecture fis fas ffollows: The ffileserver fstores fthe fworkspaces fof fall fprocesses, fas fwell fas fthe fbinary fexecutables fof fthe fscheduler fitself. fCommunications fdaemons f(commd) fare frunning fon feach fof fthe fhost fon fa fspecified fTCP fport f(786), fand fform fthe fmeans fof fcommunication fbetween fhosts. fExecution fhosts fcontain fexecution fqueues, feach fwith ftheir fown fscheduling fpolicies, fon fwhich fjobs fare fsent fto fexecute. fThe fmaster fhost fcontains fthe fcentral fqueue fmanaging fdaemon, fqmaster, fand fthe fscheduling fdaemon, fwhich fmakes fthe factual fscheduling fdecisions fregarding fwhich fjob fis fto fbe fassigned fto fwhich fexecution fqueue. fSubmit fhosts fare fthe fentry-points ffor fthe fusers. fA fsubmit fhost fsubmits fjobs fusing fthe f‘qsub’ fcommand, fwhich fsubmits fthe fjob falong fwith fits fcorresponding fdetails fto fthe fmaster fhost. fThe fmaster fhost fsummons fthe fscheduler, fwhich fhas faccess fto fthe fQueue fState fTable fwhich fin fturn fcontains finformation fon feach fof fthe fexecution fhosts. fBased fon fthe fscheduling falgorithm fimplemented fvia ffthe fscheduler fwill fchoose fan fexecution fqueue, fwhich fthe fqmaster fwill fsubsequently fdispatch fthe fjob fto. f QMonitor f– fJob fControl f(Pending fJobs) Once fa fjob fis fsubmitted, fit fgoes fto fthe fmaster fhost fwhich fplaces fit fin fthe fpending fjobs fqueue. fOnce fthere, fits fID, fPriority, fName, fOwner, fStatus fand fQueue f(to fwhich fit fwill fbe fsent) fare fstored funtil fthe fjob fis factually fdispatched fto fthe fqueue. fEvery fjob finitially fgoes fto fthe fpending fqueue fwhile fthe fscheduling fdaemon fruns fthe fselected fscheduling falgorithm fto fdetermine fthe fexecution fqueue fto fwhich fthe fjob fis fto fproceed. fOnce fthis fis fdone, fthe fjob fgoes finto fthe fRunning fJobs ftab f(not fshown fin fthe fscreen fimages), fafter fwhich fit fends fup fin fthe ffinished fjobs fqueue. This program will be a simple command line application with a text only interface. When started the application will display the title and copyright information on the application and instructions on its use. When the user presses any key the screen will be cleared then the application will enter its main execution loop. In the main execution loop the main menu will be displayed (see Appendix A for diagram of the main menu). The user will be asked to enter a number corresponding to his/her choice of actions from the main menu. That action will then be executed. This will continue until the user selects the Quit option at which time the application will exit the main execution loop and terminate. 3.2 Abstract Data Type The task list will be implemented as a linked list with all list functions and data stored in a single C++ class to be called ToDoList. 3.3 Code Outline This program will consist of the following files: Prog1Class.cpp - This file will instantiate an instance of the ToDoList class, implement the user interface, and handle all interactions between the user and the ToDoList object. This fwindow flists fthe fcurrently fconfigured fqueues ffor fthe fexecution fhosts fin fthe fcluster. fIn fthe fabove fexample, fexecution fhosts fmspc29 fand fmspc36 feach fhave fa fqueue f(called f‘q’) frunning fon feach fof fthem, fand feach fof fthese fqueues fhas f0 fout fof fa fmaximum fof f1 fjob frunning fon fthem. fFurther, fmore fqueues fmay fbe fadded fto fthe fspecified fexecution fhosts, fand fexisting fqueues fmay fbe fmodified for fdeleted. Class: Prog1Class.h and Program1Class.cpp 1. Void setIntVal(int val) – Stores a single argument value in the member variable m_iVal 2. Void setDoubleVal(double val) – Stores a single argument value in the member variable m_dval 3. Void setStringVal(char*val) – Stores a char array string single argument in the member variable m_sLine 4. Void setStructVals(in arg1, double arg2, char*arg3) – • This fis fthe class ffrom fwhich fqueue fconfigurations fmay fbe fchanged. fFor finstance, fdifferent fload/suspend fthresholds, fwhich fspecify fthe fceiling fof fmaximum fallowed fload ffor fthe fqueue, fbeyond fwhich fit fwill fbegin fto fsuspend fjobs frunning fon fit ftill fthe fthreshold fis fsatisfied. fAlso, fcomplexes fmay fbe fattached for fdetached ffrom fthe fqueue, fmaking fqueues fcater fto fdifferent fresource frequirements f(in...
Buy now to view the complete solution
Other Similar Questions
User Profile
4.0St...

CSIS 312 LU Programming Assignments 1, 2, 3, 4, 5, 6, 7, 8

All Solutions for entire class Included in one order. Programming Assignments 1-8 CSIS312 (BMIS 312) LU ...
User Profile
Exper...

MAT540 Week 8 Assignment 1. Linear Programming Case Study | Complete Solution

Let’s assume they need to order, X1 units of the adult Open Trail, X2 units of the adult Cityscape, X3 units of the girl's Sea Sprite and X4 units of the boy's Trail Blazer to maximize the profit. Then from the given in...
User Profile
smart...

CSCI 114 Programming Fundamentals II | Lab 4 Wallet | Solution

This Tutorial is rated A+ previously,if you have any questions regarding this tutorial then you can contact me....
User Profile
termp...

Object-oriented Programming (OOP) / Event-Driven Programming (EDP) versus Procedural Programming

Object-oriented Programming (OOP)Object-oriented Programming (OOP)Object-oriented Programming (OOP) ...
User Profile
termp...

IT244M2Part1A.docx Security with Python Programming Purdue University Global Python S

IT244M2Part1A.docx Security with Python Programming Purdue University Global Python Security The python coding language is a great tool for data security. Since python is open source there are a wide variety of librarie...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35