首页 > > 详细

代做MCD4720 - Fundamentals of C++ Assignment 1 - Trimester 1, 2025调试C/C++语言

项目预算:   开发周期:  发布时间:   要求地区:

MCD4720 - Fundamentals of C++

Assignment 1 - Trimester 1, 2025

 

 

 

Purpose

Selections, repetition, reading, and writing from/to files form. the foundation of programming languages. This assignment provides an opportunity for you to

showcase your understanding of these concepts and demonstrate your ability to utilize them effectively.

The assignment relates to Unit Learning Outcomes 1, 2, 3 and 4.

 

 

Your task

Complete the individual tasks as detailed in the instructions below.

Your project must be submitted as a CLion project, including all header (if you did header) and code files, and any appropriate text files to ensure the program

compiles and runs.

 

Value

20% of your total marks for the unit

The assignment is marked out of 100 marks.

Word Limit

No overall word limit

 

Due Date

11:55 pm Friday 28 March 2025 (Week5)

 

 

 

Submission

●   Via Moodle Assignment Submission.

●   Turnitin will be used for similarity checking of all submissions.

●   This is an individual assignment (group work is not permitted).

   DRAFT submission is not assessed.

●   CLion project will be assessed using version 3.24 or higher

 

 

Assessment Criteria

Marks are allocated based on the accuracy of the submission, successful

completion of the tasks without any errors in the code, and the quality of the solution.

The instructions contain an individual marks breakdown for these components.

Scenario:

You have just joined a new software development company called ABC Software Ltd. ABC Software Ltd has been commissioned by a major client to create an application called "The Basic Applications." As a new employee, your task is to create a text-based prototype for this new application.

Your job is to demonstrate some of the basic functionalities of this program, which will then be further developed by a team of programmers once your prototype is complete. To achieve this, you will complete a series of tasks, each task being independent and leveraging the benefits of a modular design.

A project template has been provided and can be found on Moodle.  Please  download it and extract it  into an appropriate folder on your device. Open it with your IDE and begin working on it. At the end, zip your project and submit it on Moodle before the due date. Failure to do so will result in a penalty.

Task 1: Read data from a file and display

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

Create a function called runMenu() and call it from the main() function. Then create another function called displayText(string filename) and call it from the runMenu() function.

This function must accept a filename as a parameter ("About.txt") and successfully read and display the data.

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

You can download the About.txt file from this unit’s Moodle page and copy into the appropriate folder in your project to read and display its content, instead of creating your own. This file is also located in the Assignment1_Template folder on Moodle.

You must update the file to add your details (such as trimester, unit, …)

Task 2: String Analyser Function

Your next task is to create a String Analyser function. The user will input two strings, and the function will perform several tasks to provide various statistics about it. These statistics include:

a)   Display the length of each string.

b)   Create a new string by alternating characters from both strings, starting with the first character of the first

string, then the last character of the second string, followed by the second character of the first string, then  the second last character of the second string, and so on. For example, if the first string is " haidar" and the second string is "MON" the result would be "hNaOiMdar" where the characters are combined in this alternating pattern.

This approach creates a new string by mixing the characters from each string in a specific order.

c)   Replacing all lowercase letters in first string with their corresponding uppercase letters, without using the toupper function, and display it.

To do this, create a function called stringAnalyser () and call it from the runMenu() function.

Use the screenshot as a reference. 

Task 3: Generate a Random Array, Display Minimum Values, and Modify the Border

Your next task is to generate a random array and fill it with 25 elements between 50 and 99 (inclusive) . Then, find and display the minimum value in each column of the array. Afterward, reset the boarder (the first and last rows and columns) to 0.

Create a function called generateArray() and call it from the runMenu() function.

You can break this function into smaller sub-functions (e.g., a function to display the array in 5 rows and 5 columns, find minimum and a function to reset boarder), you may find this will make the coding easier for you. You may qualify for more marks by doing so.

Task 4: Roulette Wheel Game (Dozen)

Your task is to simulate a roulette wheel game. The wheel contains numbers from 1 to 36 (excluding 0). Program the spinning of the roulette wheel and ask the player to guess a dozen range.

 

https://www.toptacular.co.uk/product/roulette-wheel/

Your task is to program the spinning of the roulette wheel and prompt the player to guess a number. Determine whether both the spun number and the guessed number fall within the same dozen range. The three dozen are arranged as follows:

a.    1-12 (First Dozen)

b.    13-24 (Second Dozen)

c.   25-36 (Third Dozen)

•     If the user guesses correctly, display a message:

"Well Done! and you win double what you have bet. You guessed <1-12/13-24/25-36> and it is [rolled number]."

•     If the user guesses incorrectly, display a message:

"Wrong! You lost all your money. You guessed <1-12/13-24/25-36>, it should be [1-12/13-24/25-36]. The rolled number is [rolled number]."

Create a function called spinRoulette () and call it from the runMenu() function.

Use the screenshot as a guide for your display and input request. 

Task 5: Save Encrypted Message to File

Your   next   task   is   to   save   the   encrypted   player   message   using   the   Caesar   cipher   to   a   file   called “ savedMessages .txt” . To familiarise yourself with the Caesar cipher, refer to the MCD4700 Lecture 10.1 slides or visit this link: https://cryptii.com/pipes/caesar-cipher.

1.    In the runMenu(), call a function called generateMessage():

•     When generateMessage() is called, ask the user to enter a message.

•     Then, ask the user to input a key (integer) for the Caesar cipher.

•     Use the Caesar cipher method to encrypt the message with the provided key. Note that you are only required to encrypt the letters (a-z and A-Z).

2.   Create a function called saveData(string message):

•    This function will accept a string parameter, which will include the encrypted message (after applying the Caesar cipher).

•    The function will then prompt the user whether they want to save this message to the text file or not.

3.   When the second function runs:

•     Display the encrypted message (the result of the Caesar cipher).

•    Ask  the  user  if  they  want  to  save  the  encrypted  message.   If  yes,  save  the  message  to  the “savedMessages.txt” file and display a success message.

Use the screenshot as a guide for your display and input details. You should also inform the user when the data is saved, before returning to the menu.

This screenshot shows sample content saved into the “savedMessages.txt” file. 

Task 6: Create and Display a Menu

This task is for HD students

To get HD in this assignment you have to think again before ignoring this task.

Your last task is to put everything together, create and display a menu, just like the one shown here.

All the above functions should be called and run when the corresponding option is selected.

In this example, option [6] has been selected, this option terminates the program.

The menu should be coded in the runMenu function  runMenu()“ . From this function, the user must be able to select any of the displayed options as often as they want before ending the program.

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

You should process the options as numeric such as  [1] for displaying the information,  [2] for drawing the first letter and etc. 

Assignment Notes:

It is your responsibility to know what is expected of you. If you are unsure about anything, ask your tutor sooner rather than later. Write any questions and/or notes here to help you clarify what you must do.

Assignment 1: Marking Criteria [100 marks in total]

NOTE: Your submitted project must be correctly identified and submitted, otherwise it will receive an automatic 10-mark penalty (applied after marking).

Does the program compile and run? Yes or No

NOTE!  Your submitted program  MUST compile  and run. Any submission that does not compile will receive an automatic 10 marks penalty.

Marking Guide:

1.  Application Design [20]

1.1.  The main () function has appropriate function calls to keep it uncluttered [5]

1.2.  Has all the correct #include statements [5]

1.3.  Has created all function prototypes correctly [5]

1.4.  Appropriate additional functions created to streamline code [5]

2.  Functionality [60]

2.1.  Task 1: Display About” Information [10]

2.1.1.  The displayText()  function uses the correct argument and return type [2]

2.1.2.  Appropriate validation checks have been made [2]

2.1.3.  Appropriate use of loop and decision structures to read and display data [2]

2.1.4.  Appropriately display the file including student’s details [4]

2.2.  Task 2: String Analyser Function [10]

2.2.1.  Function uses the correct argument and return type [2]

2.2.2.  Point a has been correctly achieved [2]

2.2.3.  Point b has been correctly achieved [2]

2.2.4.  Point c has been correctly achieved [4]

2.3.  Task 3: Generate a Random Array, Display Minimum Values, and Modify the Border [10]

2.3.1.  Function uses the correct argument and return type [2]

2.3.2.  Correct declaration and initialisation of an array [2]

2.3.3.  Appropriate use of decisions and loops to the minimum and modify the border [2]

2.3.4.  The generateArray() function displays the maximum, array before and after in 5 by 5 format [4]

2.4.  Task 4: Roulette Wheel Game [10]

2.4.1.  Function uses the correct argument and return type [2]

2.4.2.  Appropriate validation checks have been made [2]

2.4.3.  Ask user to guess [2]

2.4.4.  The message displayed correctly [4]

2.5.  Task 5: Save a message to file [10]

2.5.1.  Function uses the correct argument and return type [2]

2.5.2.  Data entered correctly [2]

2.5.3.  Appropriately save data in file if user says yes to save [2]

2.5.4.  Ask user if they want to save or not, an appropriate message displayed and appropriate validation [4]

2.6.  Task 6: Menu [10]

2.6.1.  The menu options are clearly displayed [2]

2.6.2.  Appropriate use of loop and decision structures to process user input [2]

2.6.3.  Correct use of function calls when responding to user input [2]

2.6.4.  The user controls when to return to the menu [2]

2.6.5.  Appropriate exit [2]

3.  Quality of Solution and Code [20]

3.1.  The program complied with no error? [10]

3.2.  Has a well-designed program been implemented and the Programming Style Guide been followed? [10]

3.2.1.  Demonstrates the use of logical procedures [2]

3.2.2.  Code is indented correctly [2]

3.2.3.  White spaces are used properly [2]

3.2.4.  All functions and variables have meaningful names and use correct camel notation [2]

3.2.5.  Appropriate use of comments throughout the code (top of the program, above the functions and in line) [2]

 

 


软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!