[SOLVED] 代写 Java Object-Oriented Programming in Java MISM/MSIT 95-712

30 $

File Name: 代写_Java_Object-Oriented_Programming_in_Java_MISM/MSIT_95-712.zip
File Size: 602.88 KB

SKU: 9400541430 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


Object-Oriented Programming in Java MISM/MSIT 95-712
Assignment 2
This Assignment is worth 3% of the overall assessment for this course.
1. (60 points) Sherlock is a smart dog that walks around a playground following instructions from its owner. Sherlock holds a marker in one of two positions, up or down. While the marker is down, Sherlock traces out shapes as he moves, and while the marker is up, Sherlock moves about freely without writing anything. In this problem, you will simulate the movement of Sherlock (through user commands) which create different figures as he marks shapes on the playground floor with his marker. These shapes can then be displayed.
The playground floor should be simulated using a 2d array (25 rows and 25 columns). Your program will read commands from an array that stores them after reading values from the user. You will need to keep track of the current position of Sherlock always and whether the marker is currently up or down.
Assume that Sherlock always starts at position (0, 0) of the playground floor with his marker up. The command ¡®1¡¯ will turn the marker up. The other set of commands that Sherlock can follow are listed in the following table. Your application must obviously be able to process these commands.
COMMAND
MEANING
1
Turn marker up
2
Turn marker down
3
Turn right
4
Turn left
5,n
Move forward n spaces. For example, 5,8 would move forward 8 spaces.
6
Display the 25-by-25 2d array
9
End of data
Hint: As Sherlock moves with the marker down, set the appropriate elements of array floor to 1s. When the 6 command (display the array) is given, wherever there is a 1 in the array, display an asterisk or any character you choose. Wherever there is a 0, display a blank.
Demonstrate you program by getting Sherlock to trace some interesting shapes.
1|Page

Suppose that Sherlock is somewhere near the center of the floor. The following ¡°program¡± would draw and display a 12-by-12 square, leaving the marker in the up position:
Remember to keep your code object-oriented. For example, Dog and Playground are different entities. In order to score full points, you should make this an object-oriented program with your world containing objects including the Dog, Playground and a Controller (that contains instructions from the dog¡¯s owner) and method calling between objects of these classes.
2. (40 points) Use the Question class from below to define a Quiz class. A quiz can be composed of up to 25 questions. Define the add method of the Quiz class to add a question to a quiz. Define the giveQuiz method of the Quiz class to present each question in turn to the user, accept an answer for each one, and keep track of the results. Additionally, overload the giveQuiz method so that it accepts two integer parameters that specify the minimum and maximum complexity levels for the quiz questions and only presents questions in that complexity range. Define a class called QuizTime with a main method that populates a quiz, presents it, and prints the final results. Also demonstrate the overloaded giveQuiz method in the main method (allowing users to pick questions within a specific complexity range).
2|Page

//******************************************************************** // Question.java //******************************************************************** public class Question {
private String question, answer;
private int complexityLevel;
//—————————————————————– // Sets up the question with a default complexity. //—————————————————————– public Question (String query, String result)
{
question = query;
answer = result;
}complexityLevel = 1;
//—————————————————————– // Sets the complexity level for this question. //—————————————————————– public void setComplexity (int level)
{complexityLevel = level;
}//—————————————————————– // Returns the complexity level for this question. //—————————————————————– public int getComplexity()
{return complexityLevel;
}//—————————————————————– // Returns the question. //—————————————————————– public String getQuestion()
{return question;
}//—————————————————————– // Returns the answer to this question. //—————————————————————– public String getAnswer()
{return answer;
}//—————————————————————– // Returns true if the candidate answer matches the answer. //—————————————————————– public boolean answerCorrect (String candidateAnswer)
{
return answer.equals(candidateAnswer);
/}/—————————————————————– // Returns this question (and its answer) as a string. //—————————————————————– public String toString()
{
return question + “
” + answer;
} }
3|Page

A Netbeans project should be setup for each assignment question. Before you make your submission, archive the Netbeans project folders into a single compressed (zip) folder, and submit only this one file. Be sure to choose names for all your files that reflect their content. The name of the zip file you submit should contain your Andrew ID, and the assignment number, for example, murlikProj2.zip. You are allowed to resubmit your assignment to Canvas no more than 3 times prior to the deadline. For other IDE’s instructions will follow on Canvas.
4|Page

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 Java Object-Oriented Programming in Java MISM/MSIT 95-712
30 $