diff_months: 18

Engineering Programming Assessment

Download Solution Now
Added on: 2022-11-04 11:43:29
Order Code: 474213
Question Task Id: 0

INSTRUCTIONS:

1. ACADEMIC INTEGRITY GUIDELINES

The following actions may be deemed to constitute a breach of the General Academic Regulations Part 7: Academic Discipline, Section 2 Dishonesty During Assessment or Course of Study

  • 2.1.1 copies from, or inappropriately communicates with another person
  • 2.1.3 plagiarises the work of another person without indicating that the work
    is not the student's own – using the full work or partial work of another person without giving due credit to the original creator of that work
  • 2.1.4 Unauthorised collaboration in Assessment - collaborates with others in the preparation of material, except where this has been approved as an assessment requirement. This includes contract cheating where a student obtains services to produce or assist with an assessment
  • 2.1.5 resubmits previously submitted work without prior approval of the exam board
  • 2.1.6 Using any other unfair means

2. This is an individual assignment

  • No collaboration is allowed. Don't show this assignment to others. Don't publish your assignment, assignment description, or solution on the internet.
  • This assignment has been personalized to reduce unauthorized collaboration. Don't solve someone else's assignment.

3. The actual assignment is described on the following pages

Requirements

The assignment is to write a C/C++ program for the game Where is my key?

The aim of the game is to find your car key in one of the rooms of your house.

  • The house has 6 rooms.
  • Each room has a name. One of the rooms is named the entrance hall'. This is where you start.
  • Every room has 3 doors to one other room each.
  • Some doors are locked at first.
  • The house layout, i.e. which room is connected to which other room by a door, is different every time the program runs.

At the start of the program:

  • A startup message is printed.
  • The elapsed time is set to zero.
  • One room is selected to have the missing key (but it is not revealed to the user).
  • The first turn starts.

Each turn proceeds as follows:

  1. The elapsed time is printed.
  2. The program prints the name of the room that you are in.
  3. The program prints the names of the three rooms you can go to (by using a door).
  4. The program lets the user enter an option. The options are:
    1. The user enters q. Then the program prints an end message and terminates.
    2. The user enters s. Then the elapsed time is incremented by a random number from 1 to 3. If the player is in the room with the keys, then the elapsed time is printed, followed by an end message, and the program terminates. Otherwise, a message is displayed that the key is not in the room, and the next turn starts.
    3. The user enters h. Then the program prints the name of the room with the key, the elapsed time is incremented by one, and the next turn starts.
    4. The user enters the name of a room. Then
      1. If the room is the same as where the player already is, then the elapsed time is incremented by two and the next turn starts.
      2. If the room is accessible via an unlocked door, then the elapsed time is incremented by one, and the player moves to the new room.
      3. If the door to the room is locked, then the program gives the option to unlock the door. If the player chooses to unlock the door, then the elapsed time is incremented by one and the door will be open in future turns. Either way, the player does not move to another room, yet, and a new turn starts.
    5. If the user input is not valid (e.g. no valid room name or no door to the room), then an error message is displayed and the next turn starts.
  • Uploaded By : Katthy Wills
  • Posted on : November 04th, 2022
  • Downloads : 0
  • Views : 205

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more