posted the assignment as a filequestions are in the word doc
DIPLOMA IN INFORMATION TECHNOLOGY COURSEWORK 1 Subject: JAVA PROGRAMMING Subject code: DIT1323 DEADLINE: Student Name: Student ID: INSTRUCTIONS TO CANDIDATES This assignment will contribute 35% to your final grade. This is an individual assignment. IMPORTANT The Sunway Diploma Studies requires students to adhere to submission deadlines for any form of assessment. Penalties are applied in relation to unauthorized late submission of work. · Coursework submitted after the deadline but within 1 week will be considered as late submission. · Work handed in following the extension of 1 week after the original deadline will be regarded as a non-submission and marked zero. Academic Honesty Acknowledgement “We verify that this paper contains entirely my own work. We have not consulted with any outside person or materials other than what was specified (an interviewee, for example) in the assignment or the syllabus requirements. Further, we have not copied or inadvertently copied ideas, sentences, or paragraphs from another student. we realize the penalties (refer to the student handbook diploma and undergraduate programme) for any kind of copying or collaboration on any assignment.” Signature: _______________________ Name: _______________________Date: ___________ Learning Outcome LO1: Write short Java programs. LO2: Apply Java programming concepts and techniques in problem-solving. LO3: Build robust application using Java’s object-oriented features. Instructions You are required to present and demonstrate your practical exercises by developing a portfolio. The portfolio report should include the following aspects: - · Program Codes with comments (zip file) · Programs’ screenshots · Design work (pseudocode, flowchart or UML class diagram) The following are the pieces of practical exercise (Appendix A) that need to be included in the portfolio: - 1. Elementary Programming 2. Selection 3. Selection 4. Methods 5. Class and Object Assessment Criteria You will be assessed based on the following requirements: REQUIREMENTS MARKS Portfolio · Elementary Programming (20 marks) · Selection (20 marks) · Selection (20 marks) · Methods (20 marks) · Class and Object (20 marks) 20*5= 100 marks TOTAL 100 Mode of Submission · Assignment must be submitted in softcopy (portfolio, report and source code). Both must be attached together. Ensure that the files do not contain any malicious program. · Report must use Times New Roman, 12 pt standard and 1.5 lines spacing. · All codes must use Courier New, 9 pt standard with single lines spacing. Appendix A Portfolio Question 1 (20 marks) – flowchart or pseudcode Elementary Programming A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm will ships cartons of milk to a local grocery store. The cost of producing one liter of milk is $0.38, and the profit of each carton of milk is $0.27. Write a program that does the following: a. Prompts the user to enter the total amount of milk produced in the morning. b. Outputs the number of milk cartons needed to hold milk. (Round your answer to the nearest integer.) c. Outputs the cost of producing milk. d. Outputs the profit for producing milk. Question 2 (20 marks) – flowchart or pseudocode Selection Write a program that prompts the user to input three numbers. The program should then output the numbers in non-descending order. Question 3 (20 marks) – flowchart or pseudocode Selection You have several pictures of different sizes that you would like to frame. A local picture framing store offers two types of frames—regular and fancy. The frames are available in white and can be ordered in any colour the customer desires. Suppose that each frame is 1 inch wide. The cost of colouring the frame is $0.10 per inch. The cost of a regular frame is $0.15 per inch and the cost of a fancy frame is $0.25 per inch. The cost of putting a cardboard paper behind the picture is $0.02 per square inch and the cost of putting glass on top of the picture is $0.07 per square inch. The customer can also choose to put crowns on the corners, which costs $0.35 per crown. Write a program that prompts the user to input the following information and then output the cost of framing the picture: a. The length and width, in inches, of the picture. b. The type of the frame. c. Customer’s choice of colour to colour the frame. d. If the user wants to add the crowns, then the number of crowns. Question 4 (20 marks) – flowchart or pseudocode Methods The cost to become a member of a fitness center is as follows: a. the Senior citizens discount is 30%; b. if the membership is bought and paid for 12 or more months in advance, the discount is 15%; or c. if more than 5 personal training sessions are purchased, the discount on each session is 20%. Write a menu driven program that determines the cost of a new membership. Your program must contain a method that displays the general information about the fitness center and its charges, a method to get all the necessary information to determine the membership cost, and a method to determine the membership cost. Use appropriate parameters to pass information in and out of a method. Question 5 (20 marks) – UML class diagram Class and Object Write the definition of a class, swimmingPool, to implement the properties of a swimming pool. Your class should have the instance variables to store the length (in feet), width (in feet), depth (in feet), the rate (in gallons per minute) at which the water is filling the pool, and the rate (in gallons per minute) at which the water is draining from the pool. Add appropriate constructors to initialize the instance variables. Also add member functions, to do the following: a. determines the amount of water needed to fill an empty or partially filled pool; b. the time needed to completely or partially fill the pool, or empty the pool; and c. add water or drain for a specific amount of time. DIT1323 – JP (Aug 2020)