Skip to content

Jange19/CS4080-Assignment2-Assignment3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

CS4080-Assignment2

Assignment2 This is my submission for CS 4080 Assignment 2.

The name of my file is AIAssistantProgram.java. I used Visual Studio Code in order to run my program so to run the program I simply took the completed java file which has all the classes and main driver in the same file so simply compile and run in VSC to be able to run the program.

A quick overview of the program all the required items are on their, User Profile, Request Response, Base class AIAssistant with greetUser, handleRequest(request), generateResponse(), the two subclasses I chose MusicAssistant and FitnessAssistant, and finally the main driver that has userProfiles and request.

Specifically talking about the AI Assistant it includes what was necessary incluing a proper AI response, being able to handle the request provided, more specifically using CHATGPT when it came to the part in the instructions for how each subclass should override relevant methods I learned that I would need to override the handleRequests and by providing a simple base case in the AIAsisstant base class I could then override them in their subclasses based on what request is made by the user, if the request includes a request that isn't either of the two subclasses then it would print the default message, otherwise the subclass would specialize it once processed). So from this after the base class, the two subclasses MusicAssistant and FitnessAssistant both utilize Polymorphism in handleRequest to determine which subclass is used. And if either of the subclasses is valid based on user request it will process and provide a response based on the given subclass either provide a playlist or a suggested workout(at least it should but here it just prints out the action being taken). The last part of the assistant functionality was just in the driver, using an array was needed to store all the users and their requests so a loop could be used to simply run through each and print out the results in the end.

I'm actually taking CS 3560 in conjunction with this class so I'm learning a lot of the topics needed for this project in that class and honestly it made it much easier to take the concepts from that class and use them here. For example inheritance such as here is was used in the subclasses as the subclasses MusicAssistant and FitnessAssistant both utilized it to extend the AIAssistant base class. As I mentioned above polymorphism was also utilized as handleRequest was given a base response however it was overridden based on the selected subclass. Dynamic Solution was used in the driver along the arrays in order to ensure that both the multiple users and the multiple requests could be handled simultaneously and then print the results. I also implemented null checks to ensure that the requests were not blank or null and it was accurate to what was needed from the user input. The only thing that I really didn't learn about was for the command type since it requested enumeration, I did not know of Enum but from what I learned it was used to ensure only the correct command type was utilized to prevent errors especially in spelling. I also only tested two base cases just to have enough time to submit but definitely needed to try more users and requests.

About

Assignment2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages