---+Mastermind with objects: Fall 2026 ---++ Learning Objective(s) * Learn to create, use and test simple classes ---++ Overview of the Program Modify the previous program so that it uses classes ---++ Specifics * The main program is called <b>MasterMindGame</b> and should not need modifying. * There is a class called <b>Response</b>. You may used it. It should not need modifying. * There is no file i/o for this program. * You will need to write a <b>Pattern</b> class. That stores a solution/guess. The data should be stored in an integer array. * It will need to support the methods classed from the main program. * Use what was discussed in class to help plan the field variable and methods for the Pattern class. * It needs a constant to represent the number of different colors available. * You need to write a unit tester for the <b>Response</b> class. Call it <b>TestResponse</b>. * you may use the solution from the previous lab ---++ Sample dialogue This has not changed ---++Lab Hints none ---++ Submission * Create a software development report * For the system design, you need to make your own flowchart. * For testing report, * make sure your tests ensure that each statement is executed at least one. * your <b>expected output</b> <font color="red">CANNOT</font> be pasted from the dialogue of a running. Only the actual output may be pasted. * you also need to refer to your !TestResponse testing * It should contain at least one different input that is an "error" * For the improvement section, specify how many points were lost from the last lab that you should not lose points for on this lab because you corrected the problem * create a pdf document from your software development report * create an empty zip folder * place your two files (Pattern.java and !TestResponse.java) in the zip folder. If you have modified any of my code, only then should you place them in the zip folder. * place your pdf document into it (with a complete UML diagram for all three classes (not the Test programs)) * submit the zip folder on canvas ---++ Optional improvements Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor. 1. Only allow the user to enter a valid guess (correct number of pegs and allowed colors) 1. Output the number of guesses it took to get the right answer. At the end of the program, output the average number of guesses over all the games played. 1. Submission instructions a. Any code that is modified should be changed to have the class end in a 2. Include the original code and the new code in the zip folder. Be sure to include appropriate testing data in your sdr for your extra credit
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
CSC121SylF2026
>
CSC121F2026Lab13
Topic revision: r1 - 2026-06-04 - CathyBareiss
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback