CS 2510 : Modern Programming Languages
代写Network | 作业network | 代写java | project | assignment – 这是一个java面向对象设计的practice, 考察java的理解, 涵盖了Network/network/java等方面, 这个项目是assignment代写的代写题目
Hand-In Deadline: Midnight (23:59) 22 February 2021
This exercise is part of the formal assessment of the course, and the work done must be your own. You are reminded to read the section on Cheating and Plagiarism in your student handbook. Marks for each question are shown in brackets.
Introduction Several studies such as the TELL study have found that the COVID-19 lockdown has been challenging for young people such as yourself. The lockdown stories on TeenVogue inspired this coursework. Since the lockdown, young people are unable to find activities to fill their days resulting in negative feelings such as boredom, loneliness, confusion, and sadness. Since you as a youngster understand the situation from direct experience, you started investigating how to restore positive feelings such as hope and happiness in young adults (i.e., yourself and your friends). Your investigations led you to the finding that a good match between a person s personality and the activities the person engages in is directly responsible for invoking positive feelings in the person. (Assume that this finding is scientifically established.)
You decided to launch an online service, called Youth Support that recommends lockdown compliant activities that invoke positive feelings in young adults. Before you work on the industry grade software for your Youth Support service, you decided to build a prototype in java as a proof of concept (POC). You intend to show your POC to investors to raise funds for your proposed Youth Support service. Imagine the investors asked you to demonstrate the service end-to-end including simulating human feelings. Using your POC, you want to show the following:
- Represent a young adult (in the age group of 16 to 24) and her family (mum, dad and one sibling). Assume the sibling is in the same age group as the young adult. Beyond the family, the young adult has a social network of friends in the same age group and tutors who are adults (age > 24).
- Add personality traits to the young adult from above.
- Add a list of activities for a typical day to the young adult assuming normal pre-lockdown life.
- Output an anonymized version of the young adults data. (Note: The Java classes you build for 1,2, 3 and 4 in the POC would be reusable in your online service.)
- Output a list of feelings that pre-lockdown activities, in relation to young adults personality, invoke in the young adult. You are free to use this list of feelings experienced by young adults. This step will establish the pre-lockdown feelings in the young adult as a baseline. This step is required only in your POC. When you launch your online service, feelings arise in real users of your service. In the POC you computationally simulate user response. (Note: Most of the Java classes you build in 5 will not be reused in your online service.)
- Apply lockdown which prohibits many of the pre-lockdown activities.
- Output a list of feelings that lockdown invoked in the young adult. When your investors compare these feelings with the baseline pre-lockdown feelings from step 5 , they should be able to appreciate the need for your proposed Youth Support service.
- Recommend lockdown compliant activities that maximize positive feelings for individual young adults considering the personality traits of the young adult. This is the main feature of your proposed online service and therefore the code from this part should be reusable in the final online service.
- Output a list of feelings that recommended activities invoked in the young adult. When your investors compare these feelings with the pre- and post-lockdown feelings from steps 5 and 7, they should be able to see the value of your proposed Youth Support service.
Your Tasks In this assignment you create the required Java software for your POC and answer some questions about your software using the concepts your learnt about programming languages in this course. Each of your classes should define its state using appropriate fields and its behaviour using appropriate methods as described in the lesson
Object-Oriented Programming Concepts. You are reminded that your Java classes should mainly aim to model
generic computations that apply in a wide range of application contexts. This improves your class librarys reusability which is the main advantage of Object-oriented programming.
- Create the Java classes required for the following detailed software requirements. It is impossible to specify software requirements completely. Please assume any missing requirements sensibly and state your assumptions clearly in your submission.
i. Create Java classes to model two types of persons - adults (used to model adult family members and tutors) and young adults (used to model friends and siblings). i. A young adult class models a person whose age is >= 16 and <=24. An adult class models a person with age> 24. ii. All person classes should store personal information - first name, last name, data of birth, gender, and mobile number. iii. A person is associated with five personality traits that characterise the persons personality. Assume that adults and young adults have stable personalities which can be described along the Big Five personality traits (dimensions) each measured on a scale of 1 to 5. iv. In addition to the required getters and setters all person classes should offer method(s) to hide real personal information and output dummy values unless privacy mode is set to off. v. Create Java class(es) to model activities for young adults which store the name of the activity, type of the activity (e.g., educational, home chores, sports, entertainment, and socialization), participants, start and end timestamps. vi. In addition to the required setters and getters, add useful methods to activity class(es) as required by your software. vii. A young adult has a packed day full of exciting activities prior to the lockdown. The young adult class should store these activities for a day as a list. viii. The young adult class should offer a method to return a list of feelings felt by the young adult. Assume that feelings depend on activities and their match to the personality traits of the young adult. For example, low scores on conscientiousness (a personality trait) and a home chore
activity (an activity of home chore type) may result in frustration (a feeling). You are free to use your own mappings from activities and personality traits to feelings. ( 5 ) ii. Create a Java class to model the COVID-19 lockdown. i. The lockdown class stores a list of activities that are prohibited for young adults. ii. The lockdown class should offer a method to apply the lockdown on a young adult this means, it removes prohibited activities from a young adults activity list. ( 3 ) iii. Create Java class, YouthSupport to model your proposed Youth Support service. The main functionality offered by the service is to recommend lockdown compliant activities that maximize positive feelings for individual young adults. ( 4 )
iv. Create a demo class (similar to the BicycleDemo class from the lesson Object-Oriented Programming
Concepts) with only a public static void main(String args) method to demonstrate the usage of your
classes from 1.i to 1.iii. In the demo class, there is no need to read data from external files. Create hardcoded objects directly in the demo class. While creating the required (hardcoded) objects of your classes, assume the required data on your own. You are only required to demonstrate the functionality of your software; reality of your data is not a huge concern. Your demo class should create one young adult and that persons family members (adults), tutors (adults) and friends (young adults). For each of the persons created, set your choice of values (on a scale of 1 to 5) for personality traits. For the young adult add your choice of activities for a day prior to lockdown. At this stage, list the personal details of the young adult with privacy mode on and list the feelings of the young adult as pre-lockdown feelings. Next call the method in the lockdown class to apply the lockdown on the young adult. Once again list the feelings of the young adult immediately after the lockdown without Youth Support. Next, using the YouthSupport class add activities allowed in lockdown to the young adult. Finally, list the feelings of the young adult with Youth Support. As an example, your demo class output should resemble the following (Note: It is possible to convert the output from your POC into a story like the ones on the lockdown stories on TeenVogue): Jane Private, 17 Pre-lockdown: Confident, Excited and Ecstatic In Lockdown without Youth Support: Lonely, Confused and Sad. In Lockdown with Youth Support: Hopeful and Happy ( 2 )
- Answer the following questions that test how you relate your Java code from 1, to the concepts learnt so far in the course. i. Defend your choice of data types for fields in your Java classes from 1. Your explanation should use only two of your classes and their fields (not all fields in all classes) as examples and reflect your understanding of data types as studied in the current course. ( 2 ) ii. Describe one example of a class or instance variable each from your Java classes from 1, along with a brief justification. ( 1 )
iii. State and explain the memory allocation mechanisms JVM (Java Virtual Machine) would use for constants, class variables, instance variables, objects and method-local variables giving examples from your Java classes from 1. ( 2 ) iv. For an object of young adult class from 1, calculate the memory size JVM allocates on the heap. Show all the steps in your calculations clearly, instead of writing down only the final value. ( 2 )
- Answer the following questions reflecting over your Java programming experience from 1 above. i. Explain how you exploited Javas object-oriented features (inheritance and polymorphism) to model the problem domain (Youth Support) the right way in your Java classes. ( 2 ) ii. Explain two positive and negative features of Java that you observed while using Java in part 1 above in comparison with your programming experiences using Python. (2)