You are required to write a program to continuously enter the following information until the user chooses to exit.

  • Movie Title
  • Year released
  • Publisher
  • Length (hrs)
  • Rate the acting (out of 5)
  • Rate the music (out of 5)
  • Rate the cinematography (out of 5)
  • Rate the plot (out of 5)
  • Rate the duration (out of 5)

Ratings are 0 - very bad to 5 - very good.

After the data has been entered correctly, calculate the overall rating of the movie as follows.

  • Rate the acting (out of 5) : 25% of overall rating
  • Rate the music (out of 5) : 15% of overall rating
  • Rate the cinematography (out of 5) : 20% of overall rating
  • Rate the plot (out of 5) : 30% of overall rating
  • Rate the duration (out of 5) : 10% of overall rating

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters.

For example : See image.

Practical Test 1

This practical test requires you to develop an algorithm using pseudocode to define the steps required to solve the Task Description.

Use WordPad or another text editor to write your pseudocode.

Notes:

  • Identify and define all the variables required.
  • Identify and define the constants.
  • Ensure you provide a method to enable continuous data entry.
  • Use sensible and informative prompts.
  • Ensure you provide adequate error checking where required.
  • Organise and indent the pseudocode.
  • Comment where appropriate.
  • Desk check to validate the code with the example data.

Practical Test 2

This practical test requires you to develop and submit the first part of the program as described in the Task Description.

Create a new C# console application project in Visual Studio and name the project pracTest2. Write the C# code to perform the following:

  • Define the variables and constants required.
  • Initialise the variables to the values defined in the Task Description example (above).
  • Output the results as follows: See image.

Notes :

  • You DO NOT have to provide prompts, looping or any error checking.
  • You DO NOT have to perform any calculations to determine the overall rating.
  • Organise and indent your code.
  • Provide a general comment at the top of the C# file containing your name, student number and student ID.
  • Provide code comments as required.

Practical Test 3

Create a new C# console application project in Visual Studio and name the project pracTest3.

Program description: Develop a program that collects information about a movie and associated rating, calculates and outputs an overall rating as per the Task Description. You should collect and store the following information from the user:

  • Movie Title
  • Year released
  • Publisher
  • Length (hrs)
  • Rate the acting (out of 5)
  • Rate the music (out of 5)
  • Rate the cinematography (out of 5)
  • Rate the plot (out of 5)
  • Rate the duration (out of 5)

Calculate the movie rating using the following:

  • Rate the acting (out of 5) : 25% of overall rating
  • Rate the music (out of 5) : 15% of overall rating
  • Rate the cinematography (out of 5) : 20% of overall rating
  • Rate the plot (out of 5) : 30% of overall rating
  • Rate the duration (out of 5) : 10% of overall rating

Your program should display appropriate informative prompts, retrieve the data from the keyboard and store each entry to be used to display output or used to calculate the overall rating. You should output the results a follows: See image.

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters.

Notes :

  • You DO NOT have to provide looping or any error checking.
  • Organise and indent your code.
  • Provide a general comment at the top of the C# file containing your name, student number and student ID.
  • Provide code comments as required.

Practical Test 4

Create a new C# console application project in Visual Studio and name the project pracTest4.

Program description: Develop a program that collects information about a movie and associated rating as per the Task Description. You should collect and store the following information from the user:

  • Movie Title
  • Year released
  • Publisher
  • Length (hrs)
  • Rate the acting (out of 5)
  • Rate the music (out of 5)
  • Rate the cinematography (out of 5)
  • Rate the plot (out of 5)
  • Rate the duration (out of 5)

Calculate the movie rating using the following:

  • Rate the acting (out of 5) : 25% of overall rating
  • Rate the music (out of 5) : 15% of overall rating
  • Rate the cinematography (out of 5) : 20% of overall rating
  • Rate the plot (out of 5) : 30% of overall rating
  • Rate the duration (out of 5) : 10% of overall rating

Notes :

Your program should display appropriate informative prompts, retrieve the data from the keyboard and check the data is valid then store each entry to be used to display output or used to calculate the overall rating. Where an error is detected in the data entry process, display an appropriate message then exit the program. Error checking should include :

  • Data entered is a valid type. EG: Ratings must be integers, duration must be decimal etc.
  • Data entered is within the correct constraints. EG: Ratings must be 0 to 5 only.

You should output the results a follows (Note in the example the results are formatted and aligned) : See image.

Express the overall rating as a whole number out of 10 and write the rating as a series of '*' characters. Ensure you place a comment at the top of the program that contains your full name and student number. Place comments in your code as required and ensure you layout your code appropriately.

Practical Test 5

Program description: Develop a program that continuously collects information about a movie and associated rating until the user decided to exit the program as per the Task Description. Using the solution provided for practical test 4 or your code, enhance and change the program to perform the following : Create a menu that contains the following options:

  • Get movie details (m)
  • Get movie ratings (r)
  • Calculate overall rating and display (c)
  • Exit (x)

Display the menu and wait for the users response. Process the options entered until the user enters 'x' to quit. Using a switch statement organise the code to suit the option Option 'm' : Get movie details should do the following: Collect and store the following information from the user:

  • Movie Title
  • Year released
  • Publisher
  • Length (hrs)

Option 'r' : Get movie ratings should do the following: Collect and store the ratings:

  • Rate the acting (out of 5)
  • Rate the music (out of 5)
  • Rate the cinematography (out of 5)
  • Rate the plot (out of 5)
  • Rate the duration (out of 5)

Option 'c' : Calculate overall rating and display (c) should do the following: Calculate the movie rating using the following:

  • Rate the acting (out of 5) : 25% of overall rating
  • Rate the music (out of 5) : 15% of overall rating
  • Rate the cinematography (out of 5) : 20% of overall rating
  • Rate the plot (out of 5) : 30% of overall rating
  • Rate the duration (out of 5) : 10% of overall rating

Output the results a follows: See image.

Use a for loop to write the '*' character to the screen Option 'x' : Exit (x) should do the following: Exit the program

Notes :

  • Your program should display appropriate informative prompts, retrieve the data from the keyboard and check the data is valid then store each entry to be used to display output or used to calculate the overall rating.
  • Where an error is detected in the data entry process, display an appropriate message then re prompt the user to enter the data again.
  • You need to ensure that the option 'Calculate and display (c)' is not executed if the movie details and ratings have not been entered.
  • Use a for loop to write the '*' character to the screen
  • Ensure you place a comment at the top of the program that contains your full name and student number.
  • Place comments in your code as required and ensure you layout your code appropriately.

Assignment 1

Create a new C# console application project in Visual Studio and name the project ass1.

Program description: Develop a program that collects information about a maximum of 50 movies including their ratings. Provide functions to Add, Search, Display and Delete a movie and enable the user to calculate and display an overall movie rating to the ratings entered. The program should contain the following functionality: Store a maximum of 50 movie records containing the following:

  • Movie Title
  • Year released
  • Publisher
  • Length (hrs)
  • Overall Rating

Add a movie record : Prompt for the movie data and store the data entered into the next array position. Validate the following fields to ensure they are correct before storing the data:

  • Year released must be numeric and 4 digits
  • Length is a valid numeric (decimal) value

Find a movie record : Prompt for the Movie Title of the movie to search.

  • The user may enter part or all of the Movie Title.
  • Search through all the Movie Titles until a match is found and return the index of the movie found.
  • Display the movie record found.

Delete a movie : Delete the current active movie

  • Ensure you display the Movie Title, then ask the user to confirm they want to delete the movie before deleting.
  • It is up to you how you undertake the deleting in the array.

Display the current movie Output the movie details a follows: See image.

Get, Calculate and display a overall movie rating : Display current active movie Prompt for the ratings data for the movie Calculate the overall movie rating using the following:

  • Rate the acting (out of 5) : 25% of overall rating
  • Rate the music (out of 5) : 15% of overall rating
  • Rate the cinematography (out of 5) : 20% of overall rating
  • Rate the plot (out of 5) : 30% of overall rating
  • Rate the duration (out of 5) : 10% of overall rating

If the current movie has a previously calculated overall rating, use the new value to update the overall rating by adding the new value to the current value and dividing the value by 2.

EG:

  • Current Overall Rating = 7/10
  • Entered Overall Rating = 5/10
  • New Overall Rating = 6/10

Output the results a follows: See image.

Use a for loop to write the '*' character to the screen

Requirements:

You have two options in the way you declare and manage the data.

  • You may use arrays to store the movie data. You must declare the arrays within the Main and pass the arrays to the methods.
  • You may create a movie class and create an array of 50 movie objects and pass the reference to the array to the methods.

You must use functions in your code. Functions could include:

  • AddMovie
  • FindMovie
  • DeleteMovie
  • DisplayMovie
  • GetCalculateDisplayRating
  • GetRatings

Other functions may be created as required. Data must be passed to the functions. Use a menu to control the program:

  • Add a movie (a)
  • Find a movie (f)
  • Display current movie (m)
  • Delete current movie (d)
  • Get, Calculate and display rating for current movie (c)
  • Exit (x)

Notes :

  • Display the menu and wait for the users response.
  • Process the options entered until the user enters 'x' to quit.
  • Use a switch statement organise the code to suit the option selected.
  • Your program should display appropriate informative prompts, retrieve the data from the keyboard and check the data is valid then store each entry.
  • Where an error is detected in the data entry process, display an appropriate message then re prompt the user to enter the data again.
  • Ensure you place a comment at the top of the program that contains your full name and student number.
  • Place comments in your code as required and ensure you layout your code appropriately.

Assignment 2

Assignment 2 consists of 2 parts. Part A : worth 5%, requires you to include code within the movie program to write the array of movie data to a file called movies.txt and read the movies.txt into program if requested by the user. Part B : worth 5%, design a user interface that could be used to control the functions of the movie program.

Part A: Description

Create a new C# console application project in Visual Studio and name the project ass1-partA Using the solution provided to Assignment 1 or your solution for Assignment 1, include a two new options in the menu that perform the following: Save data to file (0) : when chosen, open a file called movies.txt and write the data for all movies entered to the file.

EG : See image.

Each movies data should be written to the file on a newline and all data is comma separated. Read data from file (0) : when chosen, open the file called movies.txt and read the following data for all movies contained within the file into the movie data arrays.

EG : See image.

Each movie data is read from the file one line at a time, split into the individual elements using the comma separator. NOTES : Ensure you use try catch statements to provide the following error checking to ensures the program does not crash.

  • Check the files can be opened.
  • Check you can read or write to the file.
  • Ensure you do not read in more than the 50 persons allowed.

Part B : Description

Create a new C# Windows Forms project in Visual Studio and name the project ass1_partB. Develop an interface that could be used to move the console movie program into a Windows Forms Program. You may use any type of control available and you may explore all types of layout. An example of your interface could be as follows: See image.

You do not have to incorporate any of the existing code into the Windows Forms application. It is just the interface and no actions or events are required. Place the relevant controls and labels on the form. Name each control with an appropriate property name. EG: The Movie Title TextBox could be called movieTitleTextBox You do not have to place default data in the control but you may if you wish.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.