Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Additional Notes: The starter code provided for PlayGame.java provides String constants that can be used for the prompts and the level descriptions. For the congratulations

Additional Notes:

  • The starter code provided for PlayGame.java provides String constants that can be used for the prompts and the level descriptions. For the congratulations message, be sure to add in the name of the student.

  • The Yes/No inputs should be case-insensitive.

  • As shown in the examples, the congratulations statement and the career obstacles should only be printed if the student graduates.

  • Career time should always be printed with one decimal place.

  • If a student retries a level, only consider their most recent attempts when counting the projects completed and hard topics mastered.

  • You may assume the user inputs will be valid and logically correct.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
GameSettings.java This class represents the game settings for Students of CS or in other words, what obstacles the student must overcome FIELDS Field Name Type Access Modifier Description levels int private Number of levels hardTopicsPerLevel private Number of complicated topics per level int projectsPerLevel lint private Number of projects per level CONSTRUCTOR Access Modifier Constructor Input Parameters Description Name public GameSettings Construct a newly allocated GameSettings object and instantiate the fields to the following: levels to 12 hard TopicsPerLevel to 4 projectsPerLevel to 5. METHODS Method Name Return Access Input Parameters Description Type Modifier toString String public Return information about the game settings in the format provided in the next section. getLevels int public GetHard TopicsPerLevel int public Returns the levels of this GameSettings Returns the hard Topics Perlevel of this GameSettings Returns the projectsPerLevel of this GameSettings get ProjectsPerLevel Int public customize void public int levels Change Customize the settings by int topics Change, changing the values of the instance int projectsChange variables based on the parameters given as input If the parameter is positive, the value of the corresponding field should increase and if the parameter is negative, the value should decrease. Leave the instance variable as is if the corresponding parameter is 0. toString format Course Obstacles: Levels: Projects Per Level: Student.java This class represents the student character. Fields Field Name Type Access Modifier Description hame String private Name of student university String private University student attends. hard TopicsMastered int private indicates number of hard topics the student has mastered. projects Completed int private Indicates the number of projects the student has completed. graduated boolean private Indicates whether or not the student has graduated (true if all levels have been passed). career Time double private Indicates total time college career has taken in years as a decimal The total time of all courses will be calculated by summing up the time taken in each of the levels courses) and should be rounded to the nearest multiple of 0.5. For example, a total time in all the levels of 3.2 should be rounded to 3.5 and 3.75 should be rounded to 4. The field is always rounded up. never down Constructors: Access Modifier Constructor Input Parameters Description Name public Student Construct a newly allocated Student object and instantiate the fields to the specified parameters. String name, String university, int hard TopicsMastered, int projects Completed boolean graduated double career Time Methods: Method Name Access Modifier Input Parameters Description Return Type String toString public Return information about the student in the format provided in the next section getName String public setUniversity String public setHard TopicsMastered int public set Projects Completed int public Returns the name of this Student Returns the university of this Student Returns the hard TopicsMastered of this Student Returns the projects Completed of this Student Returns the graduated status of this Student Returns the career Time of this Student int hard TopicsMastered Sets the hard TopicsMastered of this Student isGraduated boolean public setCareer Time double public setHard TopicsMastered void public SetProjects Completed void public int projects Completed Sets the projects Completed of this Student setGraduated void public boolean graduated Sets the graduated status of this Student round Career Time void public double Sets the career Time of career TimeNotRounded this Student Round the given value to the nearest semester (Exc 0.5.1, 1.5, etc.) as specified in the fields section above. Note: Only calculate the rounded time after all the levels have been lentered toString format: ... Now displaying information about the student- Name: University: Hard Topics Mastered: hard TopicsMastered> Projects Completed: years Level.java This class represents each level (course) required to graduate. Note: In the event that a student repeats a level, only the data from their most recent attempt should be saved. Fields Field Name Type Access Description Modifier levelNumber private Indicates the level number of this level. Using the default settings, this could be a value between 1 and 12. inclusive. description String private Describes the material the course covers based on the level number: 1-Object-Oriented Programming and Problem Solving 2- Programming in C 3 - Computer Architecture 4- Data Structures & Algorithms 5-Systems Programming 6-Software Engineering int 7-Compilers 8 - Operating Systems 9 - Introduction to Analysis and Algorithms difficulty String private 9- Introduction to Analysis and Algorithms 10-Data Mining and Machine Learning 11 - Software Testing 12 - Software Engineering II 12+- Diabolical Software Engineering Course Note: 12+ refers to any level numbers of 13 or greater. The difficulty of the level will be determined based on the level number: If the level number is less than or equal to 4, the difficulty is Easy If the level number is between 5 and 8. the difficulty is Intermediate If the level number is between 9 and 12, the difficulty is Hard If the level number is greater than 12, the difficulty is Diabolical. Number of exams in which the student receives a perfect score. Each aced exam gives a student one additional hard topic or one additional incomplete regular project without having to retake the course. aced Tests int private hard TopicsIncomplete int private The number of difficult topics that the student does not complete The number of regular projects that the student does not complete regular ProjectsIncomplete int private capstoneProjects incomplete int private The number of capstone projects a student does not complete time double private The time spent on this course in years. Note that a course will typically be 0.5 or 1.0 years in duration, but this variable will be less than that value because it will be proportional to the amount of time during the semester the student spends on this course (based on other courses student is taking and extracurricular involvements). passed boolean private The level is passed if the student has less than the maximum number of strikes allowed. Recall that typically, 2 strikes are allowed but this number can increase by 1 for every aced exam. An incomplete capstone project is automatic failure of the course regardless how many strikes the student has and is allowed. Constructor: Access Constructor Modifier Name Input Parameters Description public Level int levelNumber int aced Tests. int hard Topics Incomplete intregular ProjectsIncomplete, int capstone Projects incomplete. double time Construct a newly allocated Level object and instantiate the fields to the specified parameters Set the description field using the options listed in the field description. Set the difficulty field using the options listed in the field description Set the passed fields to false if the student fails a capstone project or if the sum of hard topics and incomplete projects is greater than 2. Otherwise, set passed to true. Methods: Method Name Description Return Access Input Type Modifier Parameters String public toString Return information about the level in the format provided in the next section. This will be used to give the user information about the level if it is failed. setPassed boolean public Returns the passed status of this Level. getLevelNumber int public Returns the levelNumber of this Level. getDescription String public Returns the description of this level. get Difficulty String public Returns the difficulty of this level. getAced Tests int public Returns the aced Tests of this Level. get Hard Topics incomplete int public Returns the hard Topicsincomplete of this Level. Returns the regular Projectsincomplete of this Level. getRegular Projectsincomplete int public getCapstoneProjectsIncomplete int public Returns the capstone Projects incomplete of this Level. getTime double public Returns the time of this Level. toString format: Level Number: clevelNumber> Description: "description Difficulty:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions