Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PASTEBINnew pastetrends
- search...
- Guest User
- -
- SHARE
- TWEET
- Untitled
- A GUEST APR 26TH, 2017 0 NEVER
- Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- rawdownloadcloneembedreportprint text 15.72 KB
- Directions
- ///////////////////////////////////////////////////////////
- BIT 143 - Assignment 2
- DUE DATE: < Listed In Course Schedule >
- Linked Lists and the 'Browser History' Application
- You are not allowed to work in groups this assignment. For this assignment, you should start, finish, and do all the work on your own. If you have questions, please contact the instructor.
- Learning Objectives:
- (This is a list of the major topics that you, as students, will learn in this assignment:)
- Linked Lists
- In this assignment, you will need to implement a simple linked list class (either a pure linked list class that is used by other classes, or else you will merge an implementation of a linked list class into another class). Specifically, you will need to be able to add nodes to / remove nodes from the ends of the linked list.
- Abstract Data Type(s)
- In this assignment, you will need to select and implement an appropriate Abstract Data Type (although perhaps not a 'pure' implementation of said ADT).
- Part 1: Writing the program
- Imagine that you're writing an application to manage a browser's history. Because we want to keep things (relatively) simple for this homework assignment we're only going to track the name of each page (specifically, we're not going to track the URL, or the contents of the page, etc). Essentially, the way the program works is that you visit a page and then the program adds that page to the 'history' that it's tracking. As you add more pages it'll keep adding these new pages to your history. You can then 'back up' in the history, much like you can push the 'Back button' in a real web browser. When you back up in the history the program moves the most recently visited page from your history into a list of 'future' pages, so that if you choose to then go forwards in your history you can revisit those pages. Here's an example transcript of one run of the program;
- Example Transcript (user input is underlined, bold, and highlighted)
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:1
- History:
- Previously visited pages:
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 1 (Google)
- History:
- Previously visited pages:
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 2 (Hacker News)
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 3 (Ars Technica)
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- XKCD
- History:
- Previously visited pages:
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- explainxkcd.com
- History:
- Previously visited pages:
- explainxkcd.com
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 1 (Google)
- Pages in your 'future':
- Page 2 (Hacker News)
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:3
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:3
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- New Page 4
- History:
- Previously visited pages:
- New Page 4
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:1
- History:
- Previously visited pages:
- New Page 4
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:5
- As you examine the above transcript you should notice that if you 'back up' in the history and then visit a new page the program will remove all the pages your 'future'. Also note that backing up past the first entry is not possible, nor is it possible to move forwards when there's no items in the 'future'.
- You should base your program's design off one of the Abstract Data Types that we've examined. The ADT should be implemented using a linked list, so that you get experience implementing linked lists.
- Starter Project: You will be provided with a starter project that will provide you with a console-based user interface that will use the code that will use the BrowserHistory class that you implement in order to provide the functionality described in the previous paragraph.
- The interface to the BrowserHistory class is defined below, so that you're clear on how the BrowserHistory class needs to behave. You are free to create other classes ('helper classes', or auxiliary classes) that you use to implement the BrowserHistory class.
- BrowserHistory Data & Methods
- Data Field Name
- Type
- Description:
- You're free to add any
- data fields that you need to, in
- order to accomplish the objectives set forth in this assignment
- Note: all data fields should be marked private (if you need to expose them, use Properties, or accessor/mutator methods)
- Method Name
- Returns
- Description/Parameters:
- <constructor>
- Nothing, by definition
- Any initialization that you need to do
- VisitPage void
- Parameters:
- string pageName: This is a text description of what the page is
- This method will take the page's name, and immediately add that page to the 'previously visited' part of the browser's history.
- MoveBackwards
- void
- Parameters: None
- If there's at least 1 page in the 'previously visited' part of the browser's history this method will remove it and add that item to the 'future history' of the browser.
- This method does the opposite of the MoveForwards method.
- MoveForwards
- void
- Parameters: None
- If there's at least 1 page in the 'future visited' part of the browser's history this method will remove it and add that item to the 'previously visited' part of the browser's history.
- This method does the opposite of the MoveBackwards method.
- PrintAll void
- Parameters: None
- If there are any pages in the history this method will print them all. Note that you must print out all the pages in the 'previous' history, then print out all the pages in the 'future history', as shown in the transcript above.
- Note: all methods should be marked public
- Note: All methods should run in a minimum amount of time, and with a minimum amount of space (memory) consumed. Using Big 'Oh' notation, all methods (except PrintAll) should run in O(1) time and space.
- Group Work, Commenting:
- You are not allowed to work in groups for this assignment. You should start, finish, and do all the work on your own. If you have questions, please contact the instructor.
- Additionally, you should aggressively comment your code, paying particular attention to areas that are difficult to understand. If you found something to be tricky when you wrote it, make sure to comment it so that the next person (the instructor, who's grading you) understands what your code is doing. It is not necessary to comment every single line.
- The purpose of new requirement is to both help you understand, and have you demonstrate, a thorough understanding of exactly how your program works.
- Every file that you turn in should have:
- At the top of each file that you normally edit, you should put your name (first and last), the name of this class (“BIT 143”), and the year and quarter, and the assignment number, including the revision number, which starts at 0 (“A2.0”). If you’re handing this in again for a regrade, make sure to increase the minor version number by one (from “A2.0”, to “A2.1").
- You normally edit the C# source code files (.CS files), and any Word documents that you're handing in (if any).
- You do not normally edit the .SLN or .CSPROJ files, and so you should not try to put this identifying information in those files.
- In general, you should make sure to do the following before handing in your project:
- All variables used should have meaningful names.
- The code should be formatted consistently, and in an easy to read format.
- What to turn in:
- · A single electronic folder (a directory). This folder should contain:
- The source code for the program – all the .CS files in your project.
- You should not include the bin or obj directories, nor anything from them. I will dock you a couple points if you do.
- How to electronically submit your homework:
- There's a link on the homework page to the document that guides you through handing in your work.
- ///////////////////////////////////////////////////////////////////////////////////
- //UserInterface.cs
- //using System;
- //namespace Helpdesk
- //{
- // class UserInterface
- // {
- // public void RunProgram()
- // {
- // History browserHistory = new History();
- // bool fContinue = true;
- // string desc; // description of problem, for inputting new problems
- // while (fContinue)
- // {
- // int userChoice = -1;
- // while (userChoice < 1 || userChoice > 5)
- // {
- // Console.WriteLine(); // visual spacer
- // Console.WriteLine(" Your options are:");
- // Console.WriteLine("1) View your history");
- // Console.WriteLine("2) Move 1 page backwards in your 'browser history'");
- // Console.WriteLine("3) Move 1 page forwards in your 'browser history'");
- // Console.WriteLine("4) Visit a new page");
- // Console.WriteLine("5) Quit");
- // Console.Write("Type in your choice here:");
- // if (!Int32.TryParse(Console.ReadLine(), out userChoice))
- // {
- // Console.WriteLine("You need to type in a number!");
- // }
- // Console.WriteLine(); // visual spacer
- // }
- // switch (userChoice)
- // {
- // case 1:
- // browserHistory.PrintAll();
- // break;
- // case 2:
- // Console.WriteLine("Moving backwards in your (browser) history:");
- // browserHistory.MoveBackwards();
- // browserHistory.PrintAll();
- // break;
- // case 3:
- // Console.WriteLine("Moving forwards in your (browser) history:");
- // browserHistory.MoveForwards();
- // browserHistory.PrintAll();
- // break;
- // case 4:
- // Console.WriteLine("What page are you visiting?");
- // String pg = Console.ReadLine();
- // browserHistory.VisitPage(pg);
- // browserHistory.PrintAll();
- // break;
- // case 5:
- // Console.WriteLine("Thanks for using the program!\nGoodbye!\n\n");
- // Console.WriteLine("<Press the enter key to exit>");
- // Console.ReadLine();
- // return;
- // }
- // }
- // }
- // }
- //}
- //////////////////////////////////////////////////////////////////////////
- //Program.cs
- //using System;
- //namespace Helpdesk
- //{
- // /// <summary>
- // ///
- // /// </summary>
- // class Program
- // {
- // static void Main(string[] args)
- // {
- // UserInterface ui = new UserInterface();
- // ui.RunProgram();
- // }
- // }
- //}
- ///////////////////////////////////////////////
- //History.cs
- //using System;
- //using System.Collections.Generic;
- //using System.Text;
- //namespace Helpdesk
- //{
- // class History
- // {
- // public void PrintAll()
- // {
- // }
- // public void MoveBackwards()
- // {
- // }
- // public void MoveForwards()
- // {
- // }
- // public void VisitPage(string desc)
- // {
- // }
- // }
- //}
- RAW Paste Data
- Directions
- ///////////////////////////////////////////////////////////
- BIT 143 - Assignment 2
- DUE DATE: < Listed In Course Schedule >
- Linked Lists and the 'Browser History' Application
- You are not allowed to work in groups this assignment. For this assignment, you should start, finish, and do all the work on your own. If you have questions, please contact the instructor.
- Learning Objectives:
- (This is a list of the major topics that you, as students, will learn in this assignment:)
- Linked Lists
- In this assignment, you will need to implement a simple linked list class (either a pure linked list class that is used by other classes, or else you will merge an implementation of a linked list class into another class). Specifically, you will need to be able to add nodes to / remove nodes from the ends of the linked list.
- Abstract Data Type(s)
- In this assignment, you will need to select and implement an appropriate Abstract Data Type (although perhaps not a 'pure' implementation of said ADT).
- Part 1: Writing the program
- Imagine that you're writing an application to manage a browser's history. Because we want to keep things (relatively) simple for this homework assignment we're only going to track the name of each page (specifically, we're not going to track the URL, or the contents of the page, etc). Essentially, the way the program works is that you visit a page and then the program adds that page to the 'history' that it's tracking. As you add more pages it'll keep adding these new pages to your history. You can then 'back up' in the history, much like you can push the 'Back button' in a real web browser. When you back up in the history the program moves the most recently visited page from your history into a list of 'future' pages, so that if you choose to then go forwards in your history you can revisit those pages. Here's an example transcript of one run of the program;
- Example Transcript (user input is underlined, bold, and highlighted)
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:1
- History:
- Previously visited pages:
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 1 (Google)
- History:
- Previously visited pages:
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 2 (Hacker News)
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- Page 3 (Ars Technica)
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- XKCD
- History:
- Previously visited pages:
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- explainxkcd.com
- History:
- Previously visited pages:
- explainxkcd.com
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- XKCD
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:2
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 1 (Google)
- Pages in your 'future':
- Page 2 (Hacker News)
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:3
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Page 3 (Ars Technica)
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:3
- Moving backwards in your (browser) history:
- History:
- Previously visited pages:
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- XKCD
- explainxkcd.com
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:4
- What page are you visiting?
- New Page 4
- History:
- Previously visited pages:
- New Page 4
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:1
- History:
- Previously visited pages:
- New Page 4
- Page 3 (Ars Technica)
- Page 2 (Hacker News)
- Page 1 (Google)
- Pages in your 'future':
- Your options are:
- 1) View your history
- 2) Move 1 page backwards in your 'browser history'
- 3) Move 1 page forwards in your 'browser history'
- 4) Visit a new page
- 5) Quit
- Type in your choice here:5
- As you examine the above transcript you should notice that if you 'back up' in the history and then visit a new page the program will remove all the pages your 'future'. Also note that backing up past the first entry is not possible, nor is it possible to move forwards when there's no items in the 'future'.
- You should base your program's design off one of the Abstract Data Types that we've examined. The ADT should be implemented using a linked list, so that you get experience implementing linked lists.
- Starter Project: You will be provided with a starter project that will provide you with a console-based user interface that will use the code that will use the BrowserHistory class that you implement in order to provide the functionality described in the previous paragraph.
- The interface to the BrowserHistory class is defined below, so that you're clear on how the BrowserHistory class needs to behave. You are free to create other classes ('helper classes', or auxiliary classes) that you use to implement the BrowserHistory class.
- BrowserHistory Data & Methods
- Data Field Name
- Type
- Description:
- You're free to add any
- data fields that you need to, in
- order to accomplish the objectives set forth in this assignment
- Note: all data fields should be marked private (if you need to expose them, use Properties, or accessor/mutator methods)
- Method Name
- Returns
- Description/Parameters:
- <constructor>
- Nothing, by definition
- Any initialization that you need to do
- VisitPage void
- Parameters:
- string pageName: This is a text description of what the page is
- This method will take the page's name, and immediately add that page to the 'previously visited' part of the browser's history.
- MoveBackwards
- void
- Parameters: None
- If there's at least 1 page in the 'previously visited' part of the browser's history this method will remove it and add that item to the 'future history' of the browser.
- This method does the opposite of the MoveForwards method.
- MoveForwards
- void
- Parameters: None
- If there's at least 1 page in the 'future visited' part of the browser's history this method will remove it and add that item to the 'previously visited' part of the browser's history.
- This method does the opposite of the MoveBackwards method.
- PrintAll void
- Parameters: None
- If there are any pages in the history this method will print them all. Note that you must print out all the pages in the 'previous' history, then print out all the pages in the 'future history', as shown in the transcript above.
- Note: all methods should be marked public
- Note: All methods should run in a minimum amount of time, and with a minimum amount of space (memory) consumed. Using Big 'Oh' notation, all methods (except PrintAll) should run in O(1) time and space.
- Group Work, Commenting:
- You are not allowed to work in groups for this assignment. You should start, finish, and do all the work on your own. If you have questions, please contact the instructor.
- Additionally, you should aggressively comment your code, paying particular attention to areas that are difficult to understand. If you found something to be tricky when you wrote it, make sure to comment it so that the next person (the instructor, who's grading you) understands what your code is doing. It is not necessary to comment every single line.
- The purpose of new requirement is to both help you understand, and have you demonstrate, a thorough understanding of exactly how your program works.
- Every file that you turn in should have:
- At the top of each file that you normally edit, you should put your name (first and last), the name of this class (“BIT 143”), and the year and quarter, and the assignment number, including the revision number, which starts at 0 (“A2.0”). If you’re handing this in again for a regrade, make sure to increase the minor version number by one (from “A2.0”, to “A2.1").
- You normally edit the C# source code files (.CS files), and any Word documents that you're handing in (if any).
- You do not normally edit the .SLN or .CSPROJ files, and so you should not try to put this identifying information in those files.
- In general, you should make sure to do the following before handing in your project:
- All variables used should have meaningful names.
- The code should be formatted consistently, and in an easy to read format.
- What to turn in:
- · A single electronic folder (a directory). This folder should contain:
- The source code for the program – all the .CS files in your project.
- You should not include the bin or obj directories, nor anything from them. I will dock you a couple points if you do.
- How to electronically submit your homework:
- There's a link on the homework page to the document that guides you through handing in your work.
- ///////////////////////////////////////////////////////////////////////////////////
- //UserInterface.cs
- //using System;
- //namespace Helpdesk
- //{
- // class UserInterface
- // {
- // public void RunProgram()
- // {
- // History browserHistory = new History();
- // bool fContinue = true;
- // string desc; // description of problem, for inputting new problems
- // while (fContinue)
- // {
- // int userChoice = -1;
- // while (userChoice < 1 || userChoice > 5)
- // {
- // Console.WriteLine(); // visual spacer
- // Console.WriteLine(" Your options are:");
- // Console.WriteLine("1) View your history");
- // Console.WriteLine("2) Move 1 page backwards in your 'browser history'");
- // Console.WriteLine("3) Move 1 page forwards in your 'browser history'");
- // Console.WriteLine("4) Visit a new page");
- // Console.WriteLine("5) Quit");
- // Console.Write("Type in your choice here:");
- // if (!Int32.TryParse(Console.ReadLine(), out userChoice))
- // {
- // Console.WriteLine("You need to type in a number!");
- // }
- // Console.WriteLine(); // visual spacer
- // }
- // switch (userChoice)
- // {
- // case 1:
- // browserHistory.PrintAll();
- // break;
- // case 2:
- // Console.WriteLine("Moving backwards in your (browser) history:");
- // browserHistory.MoveBackwards();
- // browserHistory.PrintAll();
- // break;
- // case 3:
- // Console.WriteLine("Moving forwards in your (browser) history:");
- // browserHistory.MoveForwards();
- // browserHistory.PrintAll();
- // break;
- // case 4:
- // Console.WriteLine("What page are you visiting?");
- // String pg = Console.ReadLine();
- // browserHistory.VisitPage(pg);
- // browserHistory.PrintAll();
- // break;
- // case 5:
- // Console.WriteLine("Thanks for using the program!\nGoodbye!\n\n");
- // Console.WriteLine("<Press the enter key to exit>");
- // Console.ReadLine();
- // return;
- // }
- // }
- // }
- // }
- //}
- //////////////////////////////////////////////////////////////////////////
- //Program.cs
- //using System;
- //namespace Helpdesk
- //{
- // /// <summary>
- // ///
- // /// </summary>
- // class Program
- // {
- // static void Main(string[] args)
- // {
- // UserInterface ui = new UserInterface();
- // ui.RunProgram();
- // }
- // }
- //}
- ///////////////////////////////////////////////
- //History.cs
- //using System;
- //using System.Collections.Generic;
- //using System.Text;
- //namespace Helpdesk
- //{
- // class History
- // {
- // public void PrintAll()
- // {
- // }
- // public void MoveBackwards()
- // {
- // }
- // public void MoveForwards()
- // {
- // }
- // public void VisitPage(string desc)
- // {
- // }
- // }
- //}
- create new paste / dealsnew! / api / trends / syntax languages / faq / tools / privacy / cookies / contact / dmca / scraping / go
- Site design & logo © 2017 Pastebin; user contributions (pastes) licensed under cc by-sa 3.0 -- Dedicated Server Hosting by Steadfast
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement