We will be practicing creating and interpreting UML class diagrams for our lab t

We will be practicing creating and interpreting UML class diagrams for our lab this week.
UML class diagrams are an industry standard way of designing object-oriented programs. Being able to efficiently create accurate class diagrams will allow you to easily design large, complex programs. The better your initial design is, the better the final product will be. The goal for this lab is to practice using UML class diagrams enough to recognize all of the different symbols and arrows used.
Construct the lab files by following the instructions below. The check-in for the lab this Friday will be for all parts below. Once you have completed the program, you will submit it for this assignment.
Part 1: UML to Java
For the first half of this lab, you will be implementing an existing UML class diagram as a set of Java program files.
Create a Java class file for the King, Knight, Weapon, and Material classes shown in the UML class diagram below. Your classes must implement everything shown in the diagram, including all variables with correct access modifiers, methods, and inheritance. Notes about the diagram are provided below.
Diagram Notes
Access ModifiersMake sure you use the correct access modifiers for the variables and methods in this diagram. The symbols for all three modifiers are shown: + for public, – for private, and # for protected.
Method BodiesEvery method in this diagram is either a constructor, an accessor, or a mutator (equipWeapon and reforge are mutators).
The details of how each method should be filled out aren’t provided on UML class diagrams, so in a practical scenario you would need to have separate documentation to keep track of this. For this lab the methods are all relatively simple.
Relationship Between King and KnightThe relationship between King and Knight is association. This is shown using a plain line with no arrow or diamond. A King can have any number of Knights under his command, but each Knight must have one and only one King.
This relationship is useful for keeping track of the purpose of these classes, but it does not have any impact on the code for this lab. In a more fleshed-out project, this relationship would be enforced somewhere else in the code, in the methods of Knight and King or in another class entirely.
Relationship Between Knight and WeaponThe relationship between Knight and Weapon is aggregation. This is shown using a line with an empty/white diamond on the aggregator. A Knight must always have a Weapon (and in this case, no more than one at a time). In contrast, a Weapon can be wielded by a maximum of one Knight at a time, but it might also be ownerless.
Aggregation relationships demonstrate that one class contains another. In this case, Knight contains Weapon. This is implemented in the code by giving the Knight class a Weapon variable called arms (short for armaments). Since the relationship shown is aggregation, this means a Weapon can exist separate from the Knight class. We can also see this in the multiplicity values; a Weapon can be wielded by 0 or 1 Knights.
Relationship between Weapon and MaterialThe relationship between Weapon and Material is composition. This is shown using a line with a filled/black diamond on the composite class. A weapon must always be made of a material, and (in this program) a material is only ever used to construct one weapon.
Composition relationships are like aggregation relationships in that one class contains another, but they differ in that the contained class cannot exist outside of the container. In the project outlined by this diagram, a Material cannot exist separately from a Weapon. It is created alongside the Weapon, and it is destroyed alongside it as well. Every Material must always belong to exactly one Weapon – no more, no less.
One easily missed detail about this relationship in the diagram above is the getMaterial method of Weapon. It returns a String, the name of the material, instead of the Material object itself. This way the reference to the Material object can’t be accessed or taken outside of the Weapon class (it still must be created outside of the class for the constructor though).
Part 2: Java to UML
For the second half of this lab, you will be documenting an existing Java project as a UML class diagram.
Download and extract the zip file below. Create a UML class diagram containing all of the classes in the zip file. Your diagram must show all details that are in the class files, including all variables, methods, access modifiers, inheritance relationships, and non-inheritance relationships. Notes about the classes are provided below.
You may draw your diagram by hand and submit a picture of it, or you may use any digital drawing software of your choice. You are allowed to use a program that is made specifically for UML diagram creation such as LucidChart (there is a free version available). If you are uncertain whether or not you are allowed to use any given software for this assignment, please send me a message with the name of the software you would like to use and I will see if it is acceptable.
This project models board games and card games. The classes include: BoardGame.java, CardGame.java, Player.java, CardPlayer.java, Card.java, CardDeck.java, Die.java, and Color.java.
Class files for this part:
You can extract a zip file on Windows by right clicking the zip file and selecting “Extract All”, then selecting a destination for the unzipped files (the default location is in a folder with the same name as the zip file, in the same location as the zip file).
You can extract a zip file on Mac just by double clicking it. The unzipped file will be in the same location that the zipped file was.
Notes about the Classes
The Inheritance RelationshipsThis project gives us a sneak peek at a future topic this semester: class inheritance. The CardGame class inherits from the BoardGame class, and the CardPlayer class inherits from the Player class. In the code, you can see this by the use of the “extends” keyword in the class headers.
In UML diagrams, standard inheritance relationships are shown using an empty/white arrow pointing to the “parent” class. These connections should not have role descriptions or multiplicity values. Other than this new type of arrow, nothing else needs to be changed about the classes, and they can all still have other relationships to them as normal. Here is an example of what those connections should look like in your diagram (your diagram should not have the text hint in the middle).
We will revisit this syntax when we cover inheritance relationships.
Static and Constant VariablesUML class diagrams are created to show the relationships between classes in an object-oriented program. Static and constant fields are separate from objects created from the classes, so they are often left out of class diagrams. Please include all static fields and constants for this assignment.
Since these elements are often excluded, the syntax for how to specify them isn’t always consistent. You may write your static and constant class members the same way that you would write non-static and non-constant members, or you may use the following syntax.
For static members: underline them.
For constants: write them the same as variables, but include the value of the constants. For example “+PI: double = 3.14”.
The Non-Inheritance RelationshipsMost of the relationships in this project are either aggregation or composition. The difference between the two is whether the class that is contained in the other continues to exist when the container class is destroyed.
It is best to analyze the code for this, but you can also try to apply some common sense logic. A few examples include:
Does a card continue to exist when its deck is destroyed?
Do the Player objects continue to exist when the BoardGame object is destroyed? (Don’t think of the Player objects as people – they are just collections of board game information, like the player’s score. Does it make sense for a player to take their score from one game and keep it when playing a different one?)
If a card is held by a Player, does it still exist even if that Player is no longer part of the game?
ArrayList in CardPlayerThe CardPlayer class contains an ArrayList as one of its variables. We haven’t covered ArrayLists in-depth yet, but in simple terms they are arrays that can change length as needed whenever new items are added. In your diagram, the type of the CardPlayer’s hand variable needs to use the full type shown: “ArrayList“.
This is the minimum amount of progress that is required for this week’s check-in. Please make your check-in post with your completed diagram for part 2. Please remember to make the check-in post before the deadline. If no revisions are necessary with your check-in post, then that means you are done with this lab and ready to submit.
Submission
For this lab you will be submitting 5 files:
The four class files you created for part 1 of the lab
The picture or screenshot of your UML class diagram you created for part 2 of the lab
Submit your files by clicking “Start Assignment” at the top of the page and then selecting your screenshot and class files for submission. You can submit all files by selecting “Add Another File” in the submission box. Please submit all files individually; this assignment will NOT accept a zip file or an Eclipse project.
Rubric
CriteriaRatingsPts
This criterion is linked to a Learning OutcomePart 1 Class MembersFor full points, the variable names and types, and the method names, parameter names and types, and return types, as well as all access modifier symbols must be correct for all 5 classes.

The goal of these discussions is to give you more practice with the concepts bef

The goal of these discussions is to give you more practice with the concepts before you have to apply them in a real program. The discussions are a collaborative learning effort – you can work with others to come up with the answers, read your classmates’ posts to get feedback, and figure out the right answers as a class!
Directions
Read the prompt below and make a post containing your response. After you’ve made your first post you will be able to see everyone else’s posts. Use this opportunity to see what everyone else has come up with. You can continue to post, reply, and collaborate until you are satisfied with your answers. If you choose to work in a group, each person must still make their own individual posts.
Before the assignment’s due date, please reply to at least one other person’s post. The details for your reply to this week’s discussion are described in the prompt below. You’re more than welcome to make more than one reply and have discussions!
Click the three dots in the top right of this discussion assignment and select “Show Rubric” to see how points are awarded for this assignment.
Prompt
For your post, create a UML diagram for a single class of your choosing. Your class must contain at least one variable and at least 3 methods. You only need to create the specification for a single class and the variables methods inside of it – you don’t need to add any other classes or class relationships yet. Make sure you use the correct UML syntax when creating your class.
You may draw your diagram by hand and post a picture of it, or you may use any digital drawing software of your choice. You are allowed to use a program that is made specifically for UML diagram creation such as LucidChart (there is a free version available). If you are uncertain whether or not you are allowed to use any given software for this assignment, please send me a message with the name of the software you would like to use and I will see if it is acceptable.
You can post your class specification as a picture by selecting “Insert > Image > Upload Image” in the toolbar above the reply window.
Reply
For your reply this week, pick one of your classmates’ diagrams and add another class to it with some kind of relationship to the first class. Your new class must have at least one variable and at least one method, and you must show the relationship between the original class and your newly added class.
You are allowed to make a single change to the original class to fit the relationship you are going for. For example, if the original post contained a class called “Car”, you can design a class called “Tire” and modify the original car class to contain an array of Tire objects.
You are allowed to add another class to someone’s reply that already has more than one class in it, but the class that you add must still have at least one relationship to one of the existing classes. You may not add on to your own post.
You can choose any relationship between the two classes as long as it makes logical sense and is shown correctly. All relationships must show multiplicity values and descriptions for the two sides of the connections.

Proper referencing in APA format is must Text size 12-Times New Roman only. Avoi

Proper referencing in APA format is must
Text size 12-Times New Roman only.
Avoid plagiarism
You must give 100/100 correct solutions
Avoid using paraphrasing programs or websites
You must provide a correct answer 100/100
You must do the solution in the same attached file
You must do the solution in the same attached file
You must provide the solution within1 hour only from the time you accept the request and do not wait until the time specified on the site
Codes must be written in text and images
If personal information is required, use the attached information
You should avoid plagiarism from any website or artificial intelligence
You must provide the solution within two hours only from the time you accept the request and do not wait until the time specified on the site
Proper referencing in APA format is must
Text size 12-Times New Roman only.
Avoid plagiarisms
Avoid copying from any source
Avoid using another teacher’s solution or a similar previous student’s solution because it is a university whose system can access even the solutions published on the study pool website
You must give 100/100 correct solution
Avoid using paraphrasing programs or websites
You must provide a correct answer 100/100
You must do the solution in the same attached file
You must do the solution in the same attached file
ATTACHMENTS

We will be practicing creating and interpreting UML class diagrams for our lab t

We will be practicing creating and interpreting UML class diagrams for our lab this week.
UML class diagrams are an industry standard way of designing object-oriented programs. Being able to efficiently create accurate class diagrams will allow you to easily design large, complex programs. The better your initial design is, the better the final product will be. The goal for this lab is to practice using UML class diagrams enough to recognize all of the different symbols and arrows used.
Construct the lab files by following the instructions below. The check-in for the lab this Friday will be for all parts below. Once you have completed the program, you will submit it for this assignment.
Part 1: UML to Java
For the first half of this lab, you will be implementing an existing UML class diagram as a set of Java program files.
Create a Java class file for the King, Knight, Weapon, and Material classes shown in the UML class diagram below. Your classes must implement everything shown in the diagram, including all variables with correct access modifiers, methods, and inheritance. Notes about the diagram are provided below.
Diagram Notes
Access ModifiersMake sure you use the correct access modifiers for the variables and methods in this diagram. The symbols for all three modifiers are shown: + for public, – for private, and # for protected.
Method BodiesEvery method in this diagram is either a constructor, an accessor, or a mutator (equipWeapon and reforge are mutators).
The details of how each method should be filled out aren’t provided on UML class diagrams, so in a practical scenario you would need to have separate documentation to keep track of this. For this lab the methods are all relatively simple.
Relationship Between King and KnightThe relationship between King and Knight is association. This is shown using a plain line with no arrow or diamond. A King can have any number of Knights under his command, but each Knight must have one and only one King.
This relationship is useful for keeping track of the purpose of these classes, but it does not have any impact on the code for this lab. In a more fleshed-out project, this relationship would be enforced somewhere else in the code, in the methods of Knight and King or in another class entirely.
Relationship Between Knight and WeaponThe relationship between Knight and Weapon is aggregation. This is shown using a line with an empty/white diamond on the aggregator. A Knight must always have a Weapon (and in this case, no more than one at a time). In contrast, a Weapon can be wielded by a maximum of one Knight at a time, but it might also be ownerless.
Aggregation relationships demonstrate that one class contains another. In this case, Knight contains Weapon. This is implemented in the code by giving the Knight class a Weapon variable called arms (short for armaments). Since the relationship shown is aggregation, this means a Weapon can exist separate from the Knight class. We can also see this in the multiplicity values; a Weapon can be wielded by 0 or 1 Knights.
Relationship between Weapon and MaterialThe relationship between Weapon and Material is composition. This is shown using a line with a filled/black diamond on the composite class. A weapon must always be made of a material, and (in this program) a material is only ever used to construct one weapon.
Composition relationships are like aggregation relationships in that one class contains another, but they differ in that the contained class cannot exist outside of the container. In the project outlined by this diagram, a Material cannot exist separately from a Weapon. It is created alongside the Weapon, and it is destroyed alongside it as well. Every Material must always belong to exactly one Weapon – no more, no less.
One easily missed detail about this relationship in the diagram above is the getMaterial method of Weapon. It returns a String, the name of the material, instead of the Material object itself. This way the reference to the Material object can’t be accessed or taken outside of the Weapon class (it still must be created outside of the class for the constructor though).
Part 2: Java to UML
For the second half of this lab, you will be documenting an existing Java project as a UML class diagram.
Download and extract the zip file below. Create a UML class diagram containing all of the classes in the zip file. Your diagram must show all details that are in the class files, including all variables, methods, access modifiers, inheritance relationships, and non-inheritance relationships. Notes about the classes are provided below.
You may draw your diagram by hand and submit a picture of it, or you may use any digital drawing software of your choice. You are allowed to use a program that is made specifically for UML diagram creation such as LucidChart (there is a free version available). If you are uncertain whether or not you are allowed to use any given software for this assignment, please send me a message with the name of the software you would like to use and I will see if it is acceptable.
This project models board games and card games. The classes include: BoardGame.java, CardGame.java, Player.java, CardPlayer.java, Card.java, CardDeck.java, Die.java, and Color.java.
Class files for this part:
You can extract a zip file on Windows by right clicking the zip file and selecting “Extract All”, then selecting a destination for the unzipped files (the default location is in a folder with the same name as the zip file, in the same location as the zip file).
You can extract a zip file on Mac just by double clicking it. The unzipped file will be in the same location that the zipped file was.
Notes about the Classes
The Inheritance RelationshipsThis project gives us a sneak peek at a future topic this semester: class inheritance. The CardGame class inherits from the BoardGame class, and the CardPlayer class inherits from the Player class. In the code, you can see this by the use of the “extends” keyword in the class headers.
In UML diagrams, standard inheritance relationships are shown using an empty/white arrow pointing to the “parent” class. These connections should not have role descriptions or multiplicity values. Other than this new type of arrow, nothing else needs to be changed about the classes, and they can all still have other relationships to them as normal. Here is an example of what those connections should look like in your diagram (your diagram should not have the text hint in the middle).
We will revisit this syntax when we cover inheritance relationships.
Static and Constant VariablesUML class diagrams are created to show the relationships between classes in an object-oriented program. Static and constant fields are separate from objects created from the classes, so they are often left out of class diagrams. Please include all static fields and constants for this assignment.
Since these elements are often excluded, the syntax for how to specify them isn’t always consistent. You may write your static and constant class members the same way that you would write non-static and non-constant members, or you may use the following syntax.
For static members: underline them.
For constants: write them the same as variables, but include the value of the constants. For example “+PI: double = 3.14”.
The Non-Inheritance RelationshipsMost of the relationships in this project are either aggregation or composition. The difference between the two is whether the class that is contained in the other continues to exist when the container class is destroyed.
It is best to analyze the code for this, but you can also try to apply some common sense logic. A few examples include:
Does a card continue to exist when its deck is destroyed?
Do the Player objects continue to exist when the BoardGame object is destroyed? (Don’t think of the Player objects as people – they are just collections of board game information, like the player’s score. Does it make sense for a player to take their score from one game and keep it when playing a different one?)
If a card is held by a Player, does it still exist even if that Player is no longer part of the game?
ArrayList in CardPlayerThe CardPlayer class contains an ArrayList as one of its variables. We haven’t covered ArrayLists in-depth yet, but in simple terms they are arrays that can change length as needed whenever new items are added. In your diagram, the type of the CardPlayer’s hand variable needs to use the full type shown: “ArrayList“.
This is the minimum amount of progress that is required for this week’s check-in. Please make your check-in post with your completed diagram for part 2. Please remember to make the check-in post before the deadline. If no revisions are necessary with your check-in post, then that means you are done with this lab and ready to submit.
Submission
For this lab you will be submitting 5 files:
The four class files you created for part 1 of the lab
The picture or screenshot of your UML class diagram you created for part 2 of the lab
Submit your files by clicking “Start Assignment” at the top of the page and then selecting your screenshot and class files for submission. You can submit all files by selecting “Add Another File” in the submission box. Please submit all files individually; this assignment will NOT accept a zip file or an Eclipse project.
Rubric
CriteriaRatingsPts
This criterion is linked to a Learning OutcomePart 1 Class MembersFor full points, the variable names and types, and the method names, parameter names and types, and return types, as well as all access modifier symbols must be correct for all 5 classes.

The goal of these discussions is to give you more practice with the concepts bef

The goal of these discussions is to give you more practice with the concepts before you have to apply them in a real program. The discussions are a collaborative learning effort – you can work with others to come up with the answers, read your classmates’ posts to get feedback, and figure out the right answers as a class!
Directions
Read the prompt below and make a post containing your response. After you’ve made your first post you will be able to see everyone else’s posts. Use this opportunity to see what everyone else has come up with. You can continue to post, reply, and collaborate until you are satisfied with your answers. If you choose to work in a group, each person must still make their own individual posts.
Before the assignment’s due date, please reply to at least one other person’s post. The details for your reply to this week’s discussion are described in the prompt below. You’re more than welcome to make more than one reply and have discussions!
Click the three dots in the top right of this discussion assignment and select “Show Rubric” to see how points are awarded for this assignment.
Prompt
For your post, create a UML diagram for a single class of your choosing. Your class must contain at least one variable and at least 3 methods. You only need to create the specification for a single class and the variables methods inside of it – you don’t need to add any other classes or class relationships yet. Make sure you use the correct UML syntax when creating your class.
You may draw your diagram by hand and post a picture of it, or you may use any digital drawing software of your choice. You are allowed to use a program that is made specifically for UML diagram creation such as LucidChart (there is a free version available). If you are uncertain whether or not you are allowed to use any given software for this assignment, please send me a message with the name of the software you would like to use and I will see if it is acceptable.
You can post your class specification as a picture by selecting “Insert > Image > Upload Image” in the toolbar above the reply window.
Reply
For your reply this week, pick one of your classmates’ diagrams and add another class to it with some kind of relationship to the first class. Your new class must have at least one variable and at least one method, and you must show the relationship between the original class and your newly added class.
You are allowed to make a single change to the original class to fit the relationship you are going for. For example, if the original post contained a class called “Car”, you can design a class called “Tire” and modify the original car class to contain an array of Tire objects.
You are allowed to add another class to someone’s reply that already has more than one class in it, but the class that you add must still have at least one relationship to one of the existing classes. You may not add on to your own post.
You can choose any relationship between the two classes as long as it makes logical sense and is shown correctly. All relationships must show multiplicity values and descriptions for the two sides of the connections.

Last week we created the SudokuPuzzle and SudokuBook objects to model and store

Last week we created the SudokuPuzzle and SudokuBook objects to model and store any number of Sudoku puzzles. This week we will be using those existing objects and saving them to files. Saving object data to files can be as easy or as difficult as you need it to be, and for this assignment we will be trying out multiple ways of saving the puzzles that we’ve generated.
The coding skills you will practice in this assignment include:
writing data to sequential binary files
reading data from sequential binary files
writing data to random access files
reading data from random access files
The Outline
For this assignment you will be creating the SudokuSaver class. This is going to be a static class with methods for writing and reading SudokuBook and SudokuPuzzle data from files.
Create a static class called SudokuSaver and give it the following methods. More details are provided for each method further down.
public static void saveBinary(String filename, SudokuBook book) throws IOExceptionSaves an entire SudokuBook object into a sequential binary file.
public static SudokuBook readBinary(String filename) throws IOException, ClassNotFoundExceptionReads an entire SudokuBook object from an existing sequential binary file that was created using saveBinary().
public static void saveRABook(String filename, SudokuBook book) throws IOExceptionSaves an entire SudokuBook object into a random access file by writing out the values in each puzzle sequentially.
public static SudokuBook readRABook(String filename) throws IOExceptionReads an entire SudokuBook object from an existing random access file that was created using saveRABook().
public static void saveRAPuzzle(String filename, SudokuPuzzle puzzle, int position) throws IOExceptionSaves a single SudokuPuzzle object into a random access file at the specified position. Puzzles written in this way should remain consistent with the formatting of saveRABook so that the entire file can be read as a SudokuBook object as well.
public static SudokuPuzzle readRAPuzzle(String filename, int position) throws IOException
Reads a single SudokuPuzzle object from the specified position in a random access file that was created using saveRABook().
All of these methods must follow these rules:
All data in the objects must be saved to the files, which includes both the grid and original arrays in SudokuPuzzle and the puzzles array in SudokuBook.
The puzzle data must not be changed by the writing and reading processes. In other words, the puzzles must be the same coming out as they were going in.
All of the random access file methods must be compatible with each other if used properly.For example, if you use saveRABook to save a whole SudokuBook, then saveRAPuzzle to overwrite a single puzzle in that same file, then readRABook to read out the SudokuBook from that file, then the resulting book must be a modified version of the original SudokuBook object with one puzzle replaced. All of the other puzzles in the book should be unmodified.
You will be using the classes that you created last week (you will also want SudokuGenerator to create new puzzles you can use for testing). The SudokuSaver class must be in the same project as those files so that it is able to use them. Either add SudokuSaver to your project from last week, or make a new project with copies of last week’s files. If you were unable to get your SudokuPuzzle or SudokuBook classes working last week, then you may use these samples instead:
All of the methods in SudokuSaver will use throws clauses to allow the program to run despite the checked exceptions. Note that this means if anything goes wrong at any point in the file reading/writing process, the program will crash.
Method Details
saveBinaryIf you want to save SudokuBook and SudokuPuzzle objects to binary files, you must first implement the Serializable interface. Once you’ve done that this method becomes fairly straightforward: just write the whole SudokuBook object into a binary file using the provided file name.
readBinaryFor this method, just read out a single object from the specified binary file and return it. You must cast that object to type SudokuBook before you can return it.
saveRABookWriting SudokuBook objects to random access files is trickier than sequential binary files because you can’t use the writeObject method. Instead, you must write out all of the data from the puzzles in the book as integers. This means for each puzzle, you will be writing 162 integers: 81 from the grid array and 81 from the original array. This is repeated for each puzzle in the book.
There is one caveat: the puzzles in the SudokuBook can be null. You must check each puzzle to see if it is null before you write it into the file. If a puzzle is null, then you can write -1 into the file as an identifier that the puzzle in that location was null. Then you must use the seek() method to skip ahead to the next puzzle’s starting position so that the null space is big enough to fill a puzzle in the future. The saveRAPuzzle method needs to be able to write a full puzzle into the random access file at any position, so even empty spaces must be large enough to fit an entire puzzle. Each puzzle takes up exactly 648 bytes (162 integers * 4 bytes per integer).
Example: Your SudokuBook can hold 3 puzzles. The first and third puzzles are actual objects, but the second puzzle is null. To write this book into a random access file, you first write the integers from the first puzzle as normal starting from position 0 in the file. After you are done writing that puzzle’s values, you will end up at position 648 (right after the end of the first puzzle). Then for the second puzzle you detect that it is null. You write -1 into the file, then jump forward another 647 spaces, ending up at position 1296. Then you write the third puzzle’s values as normal, ending at position 1944. You are now done writing that book into the file.
readRABookThis method is the counterpart to the previous one, and it must read out and return a SudokuBook object that was previously written to a random access file. This means you must reverse the processes that you used to write the puzzle data into the file. Since you can’t use readObject, you will need to create all new SudokuBook and SudokuPuzzle objects and use the data from the file to fill in their values.
The first hurdle to overcome is finding the size of the book – you need to know how many spaces your new SudokuBook object needs before you read out any puzzle data. You can calculate this by using the length() method of the file. You can calculate how many puzzles are stored in the file because each puzzle takes up exactly 648 bytes. For example, a file of length 1944 contains 3 puzzles (1944 / 648 = 3).
The second hurdle is reconstructing your SudokuPuzzle objects. You can read out the integers into 2D arrays to reconstruct the grid and original arrays of the object, but there is no constructor that lets you create a new SudokuPuzzle object using both of those arrays. Create a new constructor in SudokuPuzzle with two 2D array parameters. This constructor sets both of the object’s 2D arrays to its parameters.
Lastly, make sure that whenever you start reading out the values of a puzzle in the file you are checking for -1. If you encounter a -1, then that puzzle is null and you don’t have to fill the corresponding position in the SudokuBook object. Don’t forget to use seek() to jump ahead to the next puzzle’s data afterward!
saveRAPuzzleThis method must save a single puzzle into a random access file at the specified parameter position. This method should be compatible with files created by the saveRABook method! For example, if you use saveRABook to write a whole book into a file, then you can use saveRAPuzzle to overwrite any of the books in that file without corrupting the rest of the book’s data.
The position parameter must correspond to the position value used by the SudokuBook object. A value of 2 corresponds to the third puzzle in the book/file (positions are indexed starting from 0). Remember that each puzzle takes up 648 bytes in the file!
For example, you use saveRABook to write a SudokuBook object with 3 puzzles into a new random access file. For this example we’ll call the puzzles A, B, and C respectively. Then you use saveRAPuzzle to overwrite the puzzle at position 1 in the file (B) with a new puzzle called D. After doing that, you use readRABook to read out the entire SudokuBook object stored in the file. The resulting object should be a book containing the puzzles A, D, and C in that order. Puzzles A and C are exactly as they were originally, and puzzle D is also exactly as it should be (not partially containing B’s values).
If you try to write a null puzzle into the file, then a -1 should be written at the first integer position of the puzzle. You don’t have to erase any existing data that might have been in the rest of the puzzle’s position.
readRAPuzzleThis method must read out and return a single SudokuPuzzle object that is stored in a random access file. The process is like a combination of readRABook and saveRAPuzzle. If you detect a -1 in the indicated position, then you must return a null object.
Saving to Text Files
This section is optional and you will not be penalized if it does not appear in your submission.
Once you have completed the required methods for this project, you can also try saving your SudokuBook objects to text files. Create two more methods in SudokuSolver called saveText and readText, which respectively write and read entire SudokuBook objects to/from text files. The behavior of these methods must follow these rules:
The number of puzzles stored in the file must be written at the top of the file.If you don’t do this then there is no way to determine how big to make the SudokuBook when you read it out.
Both the original and grid arrays must be saved into the file
The puzzles must be written to the file exactly as they would appear using the display() method. They must look like real Sudoku puzzles, not like long lists of numbers.This includes writing blank spaces into the puzzles instead of 0’s.
You may create new methods in SudokuPuzzle to facilitate this process.
If you open the resulting text file and modify the numbers (without ruining the formatting), then those changes must be reflected when you read the object back from the file.You don’t have to account for the user ruining the formatting – that is allowed to crash the program.
You must somehow detect and save any null puzzles that were in the book. The SudokuBook that is retrieved from the file must be EXACTLY as it was originally.
If you are able to correctly create both of these methods without major errors, you will be awarded an additional 10 points on this assignment. No partial credit will be given for incomplete/buggy code. You will not be penalized if these methods do not work properly, but please make sure the code for these methods doesn’t prevent the program from compiling or disrupt any other methods. You will lose points if your code does not compile for any reason.
Submission
Please test your methods thoroughly to avoid losing points for errors.
When you have completed this assignment, submit all of the Java class files used in your project. Your submission must include four files: SudokuPuzzle.java, SudokuBook.java, SudokuGenerator.java, and SudokuSaver.java.
Submit your files by clicking “Start Assignment” at the top of the page and then selecting all of your files for submission. This assignment will only accept the .java files individually and the screenshot file; it will NOT accept an Eclipse project file or a zip file. No points will be given to programs that do not compile.
CriteriaRatingsPts
This criterion is linked to a Learning OutcomesaveBinaryFor full points, the saveBinary method must correctly save an entire SudokuBook object to a sequential binary file.

Last week we created the SudokuPuzzle and SudokuBook objects to model and store

Last week we created the SudokuPuzzle and SudokuBook objects to model and store any number of Sudoku puzzles. This week we will be using those existing objects and saving them to files. Saving object data to files can be as easy or as difficult as you need it to be, and for this assignment we will be trying out multiple ways of saving the puzzles that we’ve generated.
The coding skills you will practice in this assignment include:
writing data to sequential binary files
reading data from sequential binary files
writing data to random access files
reading data from random access files
The Outline
For this assignment you will be creating the SudokuSaver class. This is going to be a static class with methods for writing and reading SudokuBook and SudokuPuzzle data from files.
Create a static class called SudokuSaver and give it the following methods. More details are provided for each method further down.
public static void saveBinary(String filename, SudokuBook book) throws IOExceptionSaves an entire SudokuBook object into a sequential binary file.
public static SudokuBook readBinary(String filename) throws IOException, ClassNotFoundExceptionReads an entire SudokuBook object from an existing sequential binary file that was created using saveBinary().
public static void saveRABook(String filename, SudokuBook book) throws IOExceptionSaves an entire SudokuBook object into a random access file by writing out the values in each puzzle sequentially.
public static SudokuBook readRABook(String filename) throws IOExceptionReads an entire SudokuBook object from an existing random access file that was created using saveRABook().
public static void saveRAPuzzle(String filename, SudokuPuzzle puzzle, int position) throws IOExceptionSaves a single SudokuPuzzle object into a random access file at the specified position. Puzzles written in this way should remain consistent with the formatting of saveRABook so that the entire file can be read as a SudokuBook object as well.
public static SudokuPuzzle readRAPuzzle(String filename, int position) throws IOException
Reads a single SudokuPuzzle object from the specified position in a random access file that was created using saveRABook().
All of these methods must follow these rules:
All data in the objects must be saved to the files, which includes both the grid and original arrays in SudokuPuzzle and the puzzles array in SudokuBook.
The puzzle data must not be changed by the writing and reading processes. In other words, the puzzles must be the same coming out as they were going in.
All of the random access file methods must be compatible with each other if used properly.For example, if you use saveRABook to save a whole SudokuBook, then saveRAPuzzle to overwrite a single puzzle in that same file, then readRABook to read out the SudokuBook from that file, then the resulting book must be a modified version of the original SudokuBook object with one puzzle replaced. All of the other puzzles in the book should be unmodified.
You will be using the classes that you created last week (you will also want SudokuGenerator to create new puzzles you can use for testing). The SudokuSaver class must be in the same project as those files so that it is able to use them. Either add SudokuSaver to your project from last week, or make a new project with copies of last week’s files. If you were unable to get your SudokuPuzzle or SudokuBook classes working last week, then you may use these samples instead:
All of the methods in SudokuSaver will use throws clauses to allow the program to run despite the checked exceptions. Note that this means if anything goes wrong at any point in the file reading/writing process, the program will crash.
Method Details
saveBinaryIf you want to save SudokuBook and SudokuPuzzle objects to binary files, you must first implement the Serializable interface. Once you’ve done that this method becomes fairly straightforward: just write the whole SudokuBook object into a binary file using the provided file name.
readBinaryFor this method, just read out a single object from the specified binary file and return it. You must cast that object to type SudokuBook before you can return it.
saveRABookWriting SudokuBook objects to random access files is trickier than sequential binary files because you can’t use the writeObject method. Instead, you must write out all of the data from the puzzles in the book as integers. This means for each puzzle, you will be writing 162 integers: 81 from the grid array and 81 from the original array. This is repeated for each puzzle in the book.
There is one caveat: the puzzles in the SudokuBook can be null. You must check each puzzle to see if it is null before you write it into the file. If a puzzle is null, then you can write -1 into the file as an identifier that the puzzle in that location was null. Then you must use the seek() method to skip ahead to the next puzzle’s starting position so that the null space is big enough to fill a puzzle in the future. The saveRAPuzzle method needs to be able to write a full puzzle into the random access file at any position, so even empty spaces must be large enough to fit an entire puzzle. Each puzzle takes up exactly 648 bytes (162 integers * 4 bytes per integer).
Example: Your SudokuBook can hold 3 puzzles. The first and third puzzles are actual objects, but the second puzzle is null. To write this book into a random access file, you first write the integers from the first puzzle as normal starting from position 0 in the file. After you are done writing that puzzle’s values, you will end up at position 648 (right after the end of the first puzzle). Then for the second puzzle you detect that it is null. You write -1 into the file, then jump forward another 647 spaces, ending up at position 1296. Then you write the third puzzle’s values as normal, ending at position 1944. You are now done writing that book into the file.
readRABookThis method is the counterpart to the previous one, and it must read out and return a SudokuBook object that was previously written to a random access file. This means you must reverse the processes that you used to write the puzzle data into the file. Since you can’t use readObject, you will need to create all new SudokuBook and SudokuPuzzle objects and use the data from the file to fill in their values.
The first hurdle to overcome is finding the size of the book – you need to know how many spaces your new SudokuBook object needs before you read out any puzzle data. You can calculate this by using the length() method of the file. You can calculate how many puzzles are stored in the file because each puzzle takes up exactly 648 bytes. For example, a file of length 1944 contains 3 puzzles (1944 / 648 = 3).
The second hurdle is reconstructing your SudokuPuzzle objects. You can read out the integers into 2D arrays to reconstruct the grid and original arrays of the object, but there is no constructor that lets you create a new SudokuPuzzle object using both of those arrays. Create a new constructor in SudokuPuzzle with two 2D array parameters. This constructor sets both of the object’s 2D arrays to its parameters.
Lastly, make sure that whenever you start reading out the values of a puzzle in the file you are checking for -1. If you encounter a -1, then that puzzle is null and you don’t have to fill the corresponding position in the SudokuBook object. Don’t forget to use seek() to jump ahead to the next puzzle’s data afterward!
saveRAPuzzleThis method must save a single puzzle into a random access file at the specified parameter position. This method should be compatible with files created by the saveRABook method! For example, if you use saveRABook to write a whole book into a file, then you can use saveRAPuzzle to overwrite any of the books in that file without corrupting the rest of the book’s data.
The position parameter must correspond to the position value used by the SudokuBook object. A value of 2 corresponds to the third puzzle in the book/file (positions are indexed starting from 0). Remember that each puzzle takes up 648 bytes in the file!
For example, you use saveRABook to write a SudokuBook object with 3 puzzles into a new random access file. For this example we’ll call the puzzles A, B, and C respectively. Then you use saveRAPuzzle to overwrite the puzzle at position 1 in the file (B) with a new puzzle called D. After doing that, you use readRABook to read out the entire SudokuBook object stored in the file. The resulting object should be a book containing the puzzles A, D, and C in that order. Puzzles A and C are exactly as they were originally, and puzzle D is also exactly as it should be (not partially containing B’s values).
If you try to write a null puzzle into the file, then a -1 should be written at the first integer position of the puzzle. You don’t have to erase any existing data that might have been in the rest of the puzzle’s position.
readRAPuzzleThis method must read out and return a single SudokuPuzzle object that is stored in a random access file. The process is like a combination of readRABook and saveRAPuzzle. If you detect a -1 in the indicated position, then you must return a null object.
Saving to Text Files
This section is optional and you will not be penalized if it does not appear in your submission.
Once you have completed the required methods for this project, you can also try saving your SudokuBook objects to text files. Create two more methods in SudokuSolver called saveText and readText, which respectively write and read entire SudokuBook objects to/from text files. The behavior of these methods must follow these rules:
The number of puzzles stored in the file must be written at the top of the file.If you don’t do this then there is no way to determine how big to make the SudokuBook when you read it out.
Both the original and grid arrays must be saved into the file
The puzzles must be written to the file exactly as they would appear using the display() method. They must look like real Sudoku puzzles, not like long lists of numbers.This includes writing blank spaces into the puzzles instead of 0’s.
You may create new methods in SudokuPuzzle to facilitate this process.
If you open the resulting text file and modify the numbers (without ruining the formatting), then those changes must be reflected when you read the object back from the file.You don’t have to account for the user ruining the formatting – that is allowed to crash the program.
You must somehow detect and save any null puzzles that were in the book. The SudokuBook that is retrieved from the file must be EXACTLY as it was originally.
If you are able to correctly create both of these methods without major errors, you will be awarded an additional 10 points on this assignment. No partial credit will be given for incomplete/buggy code. You will not be penalized if these methods do not work properly, but please make sure the code for these methods doesn’t prevent the program from compiling or disrupt any other methods. You will lose points if your code does not compile for any reason.
Submission
Please test your methods thoroughly to avoid losing points for errors.
When you have completed this assignment, submit all of the Java class files used in your project. Your submission must include four files: SudokuPuzzle.java, SudokuBook.java, SudokuGenerator.java, and SudokuSaver.java.
Submit your files by clicking “Start Assignment” at the top of the page and then selecting all of your files for submission. This assignment will only accept the .java files individually and the screenshot file; it will NOT accept an Eclipse project file or a zip file. No points will be given to programs that do not compile.
CriteriaRatingsPts
This criterion is linked to a Learning OutcomesaveBinaryFor full points, the saveBinary method must correctly save an entire SudokuBook object to a sequential binary file.

You must do the solution in the same attached file – I want a 100/100 correct so

You must do the solution in the same attached file
– I want a 100/100 correct solution
It must be a comprehensive and comprehensive solution
You should avoid plagiarism from any website or artificial intelligence
You must provide the solution within two hours only from the time you accept the request and do not wait until the time specified on the site
Proper referencing in APA format is must
Text size 12-Times New Roman only.
Avoid plagiarisms
Avoid copying from any source
Avoid using another teacher’s solution or a similar previous student’s solution because it is a university whose system can access even the solutions published on the study pool website
You must give 100/100 correct solution
Avoid using paraphrasing programs or websites
You must provide a correct answer 100/100
You must do the solution in the same attached file
You must do the solution in the same attached file
Proper referencing in APA format is must

You must do the solution in the same attached file – I want a 100/100 correct so

You must do the solution in the same attached file
– I want a 100/100 correct solution
It must be a comprehensive and comprehensive solution
You should avoid plagiarism from any website or artificial intelligence
You must provide the solution within two hours only from the time you accept the request and do not wait until the time specified on the site
Proper referencing in APA format is must
Text size 12-Times New Roman only.
Avoid plagiarisms
Avoid copying from any source
Avoid using another teacher’s solution or a similar previous student’s solution because it is a university whose system can access even the solutions published on the study pool website
You must give 100/100 correct solution
Avoid using paraphrasing programs or websites
You must provide a correct answer 100/100
You must do the solution in the same attached file
You must do the solution in the same attached file
Proper referencing in APA format is must

Java Variable A variable is a location in memory (storage area) to hold data.

Java Variable
A variable is a location in memory (storage area) to hold data.
In simple terms, it is a storage place that has some memory allocated to it. Basically, a variable is used to store data.
To indicate the storage area, each variable should be given a unique name (identifier).
A variable name can consist of alphabets (both upper and lower case), numbers, and the underscore ‘_’ character. However, the name must not start with a number.