C++代写|Assignment 1 – Task-Oriented Project


Submission Instructions:

Your project must be submitted as a Visual Studio project OR Visual Studio Code, including your project files, and any appropriate text files to ensure the program compiles and runs.

You may complete the tasks in your preferred IDE, however you MUST create a Visual Studio OR Visual Studio Code project in order to submit. Your project folder must be identified by using your name and assignment number,such as YourNameA1.

The entire project folder must then be zipped up into one zip file for submission. The zipped file MUST be named “A1-YourFirstNameLastName.zip” – do not include anything else! This zip file must be submitted via the Moodle assignment submission page.

Explicit assessment criteria are provided, however please note you will also be assessed on the following broad criteria:

NOTE! Your submitted program MUST compile and run. Any submission that does not compile will automatically be awarded a ZERO. This means it is your responsibility to continually compile and test your code as you build it.

NOTE! Your submitted files must be correctly identified and submitted (as described above). Any submission that does not comply will receive and automatic 10% penalty (applied after marking).


You have just joined a new multimedia company called CyberRoo. As a new employee, you have been tasked with creating a text-based prototype for a new creative writing tool the company has been asked to create by a major client called “The Amazing Mad Lib Story Generator”.

“Mad Libs is a phrasal template word game where one player prompts others for a list of words to substitute for blanks in a story, before reading the – often comical or nonsensical – story aloud. The game is frequently played as a party game or as a pastime.” Wikipedia

Your job is to demonstrate the basic functionality of the program, to be further developed by the team of programmers after your finish the prototype. To do this you must complete a series of tasks, each building upon the previous task.

Task List:

Task 1: Create and Display a Menu

Your first task is to create and display a menu, just like the one shown here. In the example, option [0] has been selected, terminating the program.

Create a function called runMenu() and call it from the main() function. From this function, the user must be able to select any of the displayed options as often as they want before ending the program.

The options should be displayed using its own function.

Ensure that you validate the user’s input so that only the options displayed can be chosen.

You may process the options as either numeric or single character input, such as [0] or [E] for ending the program, [1] or [I] for displaying the information, etc.

Task 2: Display an Information Screen

Your next task is to display some information about the application, just like the one shown here.

Create a function called displayTextData() and call it from the runMenu() function when option [1] Display  “About” Information is selected.

This function must accept a filename as a parameter (MadAbout.txt) then read and display the data.

You must allow the user some time to read the displayed information before returning them to the menu.

You can copy MadAbout.txt into the appropriate folder to read and display, instead of creating your own. However,you may need to modify the format of the data, depending on how you intend to import it into your program.

You may create your own information if you wish. If you do, keep it short!

Task 3: Read and Store Data from a File

Your next task is to read and store the Mad Lib data, from one (or more) text files, and store this data in appropriate variables. This data will be used to generate the randomised Mad Libs in the next task.

Create a function called createLists() and call it from the runMenu() function when option [2] Read and Store  Data from File is selected.

This function must accept a filename as a parameter (“*.txt”) and successfully read and store the data. The data is to be stored in two collection variables named madLibs, and madBits.

You can choose to read the data from a single file, storing each data set in the different variables, OR read and store each data set with two separate calls to the same function with different arguments OR use another suitable method of your own devising.

You may also be required to manipulate the string data, using appropriate string methods.

The data for the two individual collections can be found in MadLibData.txt, which you can modify or change to suit your method of reading and storing the data, instead of writing your own. You are free to write your own data, if you wish. Remember to name and store your text files as required by the brief.

The data for the mad bits is currently written so that it identifies the types of words the user must input for its matching Mad Lib. The Mad Libs themselves have place holders for each word, which will be replaced by the user’s input.