CPSC1012 Assignment 3 Part 2 - Fall 2022 Term CPSC1012 Assignment 3 Part 2 – Arrays Weight: 5% of your final mark Due Date: 11:50pm Wednesday, November 23, 2022 (Late submissions will not be...

Programming fundamentals in C#


CPSC1012 Assignment 3 Part 2 - Fall 2022 Term CPSC1012 Assignment 3 Part 2 – Arrays Weight: 5% of your final mark Due Date: 11:50pm Wednesday, November 23, 2022 (Late submissions will not be graded) Introduction In this assignment you will design and write a modularized menu-driven program that allows the user to play Lotto MAX with EXTRA or to play Lotto 6/49 with EXTRA. LOTTO MAX You can play LOTTO MAX by picking seven unique numbers from 1 to 50. To win a prize, numbers matched must appear in the same selection (line) as shown in the table below. Match Prize 7 of 7 Win or share Jackpot of at least $10 Million or 87.25% of Pools Fund 6 of 7 + Bonus Share of 2.5% of Pools Fund 6 of 7 Share of 2.5% of Pools Fund 5 of 7 + Bonus Share of 1.5% of Pools Fund 5 of 7 Share of 3.5% of Pools Fund 4 of 7 + Bonus Share of 2.75% of Pools Fund 4 of 7 $20 3 of 7 + Bonus $20 3 of 7 Free Play LOTTO 6/49 You can play LOTTO 6/49 by picking six unique numbers from 1 to 49. To win a prize, numbers matched must appear in the same selection (line) as shown in the table below. Match Prize 6 of 6 Win or share Jackpot (79.5% of the Pools Fund) 5 of 6 + Bonus Share of 6% of the Pools Fund 5 of 6 Share of 5% of the Pools Fund 4 of 6 Share of 9.5% of the Pools Fund 3 of 6 $10 2 of 6 + Bonus $5 2 of 6 Free Play LOTTO EXTRA You can play EXTRA by getting the system to generate 7 digits for you. To win a prize match the number drawn in exact order from the right-hand side to win. Match Prize All 7 digits $250,000 Last 6 digits $100,000 Last 5 digits $1,000 Last 4 digits $100 Last 3 digits $50 Last 2 digits $10 CPSC1012 Assignment 3 Part 2 - Fall 2022 Term Last digit $2 Program Menu Create a program menu to allow the user to perform the operations shown below in the sample: |------------------------------------------------| | CPSC1012 Lotto Centre | |------------------------------------------------ | | 1. Change Lotto MAX winning numbers | | 2. Change Lotto 6/49 winning numbers | | 3. Change Lotto EXTRA winning numbers | | 4. Play Lotto MAX | | 5. Play Lotto 6/49 | | 0. Exit Program | |------------------------------------------------| Enter your menu number choice > 1 The current Lotto MAX winning numbers are: 5, 7, 15, 18, 35, 37, 45 (Bonus: 47) Would you like to generate or enter the winning numbers (g/e): g The new Lotto MAX winning numbers are: 10, 20, 24, 25, 32, 39, 46 (Bonus: 15) // re-display menu Enter your menu number choice > 1 The current Lotto MAX winning numbers are: 10, 20, 24, 25, 32, 39, 46 (Bonus: 15) Would you like to generate or enter the winning numbers (g/e): e Enter number #1: 10 Enter number #2: 17 Enter number #3: 18 Enter number #4: 22 Enter number #5: 23 Enter number #6: 25 Enter number #7: 34 Enter bonus number: 37 The new Lotto MAX winning numbers are: 10, 17, 18, 22, 23, 25, 34 (Bonus: 37) // re-display menu Enter your menu number choice > 3 The current Lotto EXTRA number is: 1646351 The new Lotto EXTRA number is: 5379569 // re-display menu Enter your menu number choice > 4 The current Lotto MAX winning numbers are: 5, 7, 15, 18, 35, 37, 45 (Bonus: 47) The current Lotto EXTRA number is: 1646351 Your Lotto MAX quick pick numbers are: 1, 3, 5, 7, 35, 37, 50 Your Lotto EXTRA number is: 1646359 Your Lotto MAX Match: 4 / 7 Your Lotto MAX Prize: $20 Your Lotto EXTRA Match: 0 digits Your Lotto EXTRA Prize: $0 // re-display menu Enter your menu number choice > 5 The current Lotto 6/49 winning numbers are: 6, 8, 13, 14, 35, 40 (Bonus: 26) The current Lotto EXTRA number is: 2647447 Your Lotto 6/49 quick pick numbers are: 2, 4, 6, 8, 30, 49 Your Lotto EXTRA number is: 2647047 CPSC1012 Assignment 3 Part 2 - Fall 2022 Term Your Lotto 6/49 Match: 4 / 7 Your Lotto 6/49 Prize: Free Play Your Lotto EXTRA Match: Last 2 digits Your Lotto EXTRA Prize: $10 // re-display menu Enter your menu number choice > 0 Good-bye and thanks for coming to the CPSC1012 Lotto Centre. Generate the winning numbers for Lotto MAX, Lotto 6/49, and Lotto EXTRA at program startup. Design your program to use methods where each method cannot have more than 30 statements. Your program must handle invalid input values and not crash. CODING STANDARDS The following coding standards must be followed when developing your program: • Your C# Console App project must be named as Assignment3Part2-YourFullName (eg: Assignment3Part2-CodeGuru) • A C# comment block at the beginning of the source file with titles for the purpose, inputs, outputs, algorithm, test plan, written by, written for, section no, and last modified of the program such as shown below: /* Purpose: ____________________________________________________ Inputs: ____________________________________________________ Outputs: ____________________________________________________ Algorithm: ____________________________________________________ ____________________________________________________ ____________________________________________________ Test Plan: Test Case Test Data Expected Results --------- --------- ---------------- Written by: Your full name Written for: Instructor Name Section No: ____________________________________________________ Last modified: yyyy.MM.dd */ • Write only one statement per line. • Write only one declaration per line. • Use camelCase (firstName) for local variable names and method parameter names. • Use PascalCase/TitleCase (FirstName) for constant variable names and method names. • If continuation lines are not indented automatically, indent them one tab stop (four spaces). CPSC1012 Assignment 3 Part 2 - Fall 2022 Term • Do NOT use the goto or continue statement • Do NOT use break statement to exit a looping structure (a switch statement is not a looping structure) • Braces layout must be at next line. • If statement must include braces. • Multi-way if-else statement must include an else block. • Switch statement must include a default case. • All looping statements must include braces. • Value-returning methods are not allowed to use more than ONE return statement. • Write descriptive comments in your code for each major task you perform. • Do not use data structures in your code that has not been presented in class without consulting your instructor first. MARKING RUBRIC Mark Description 5 Excellent – no improvements to recommend 4 Very Good – program passes all test cases but there are some improvements to the code that is recommended 3 Acceptable – coded all the requirements but some test cases are not passing because there are minor logical errors in the code 2 Needs Work – coded most of the requirements and code is structured correctly but there are major logical errors in the code 1 Unsatisfactory – coded some of the requirements, code has syntax errors, code has many warnings 0 Not done. Submission Requirements • Your instructor will inform you on how/where your final solution should be submitted.
Nov 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here