There are 3 questions. We are using the book "Java: How to Program Early Objects" 11th edition. We have reached chapter 7 & can not use any methods that are past that.
1 INSY 4305 ADVANCED APPLICATION DEVELOPMENT ASSINGMENT 3 20 points 1. INSTRUCTIONS • For the late submissions, 2% of the total points will be deducted per hour automatically on Canvas. • PLEASE, ONLY USE TECHNIQUES THAT WE LEARNED IN CHAPTER 5, CHAPTER 6, AND CHAPTER 7. • If you use other techniques, 4 pts will be deducted. • In this assignment, you are expected to upload one .zip/.rar file including four Java applications. o YourFirstNameLastName.zip/.rar [including MyTest.java, Duplicate.java, Multiplication.java, MultiplicationTest.java] • Each question is independent of each other. • Do not forget to add comments to explain how your codes are working! Short comments are acceptable. • Write your codes individually! Do not copy of any of them from someone else! • NOTE: If you are using any IDE (Netbeans, Eclipse, etc.), please delete the statement package xxxxx; (and save it again), from your application. Otherwise, I will get a compilation error, and you will lose 1 pt for each file giving a compilation error. It is your responsibility. 2 2. GRADING POLICY • Case 1: o For each question: o I will compile your .java files. If any compilation error occurs, 1 pt will be deducted from each file including a compilation error. o After that, I will check your algorithms whether they are correct or not. For example; if it says find odd and even numbers. I will check whether it really finds both even and odd numbers. This part will be evaluated based on your work. o Additionally, comments will be checked whether they clearly and briefly explain what you have done. If comments are missing or not clear, enough, or brief 1 pt will be deducted. • Case 2: o For each question: o If there is not any compilation error: ▪ I will try each case scenario stated in each question. For example; if it says find odd and even numbers. I will try both even and odd numbers. This part will be evaluated based on your work. ▪ Additionally, comments will be checked whether they clearly and briefly explain what you have done. If comments are missing or not clear, enough, or brief 1 pt will be deducted. • Case 3: o If you do not upload a .java file, I will not evaluate your answer. • Case 4: o If it is determined that you copy the codes from someone else, you will get 0 pt. 3 QUESTIONS Note: In each question, assume that the user enters correct inputs. You do not handle with exceptions. 1. (8 pts) Write an application that is including a three-question multiple choice quiz about Java programming language. Each question must have four possible answers (numbered 1 to 4). Also, ask user to type 0 to exit the test. [Assume that a user enters only integers 1,2,3,4, or 0]. Firstly, display a message that this quiz includes three questions about the Java programming language and display that each question has four possible answers. If the answer is correct for the given question, display that the answer is correct. If the answer is not correct for the given question, display that the answer is wrong. If the user answers three questions correctly, display “Excellent”, if two, display “very good”, if one or fewer, display “It is time to start to learning Java”. After that, ask user whether he or she wants to play again [you can use a boolean variable]. If user inputs true, start the game again. If user inputs false, then display a goodbye message and finish the game [Assume that user enters only true or false]. UPLOAD MyTest.java 2. (4 pts). Use a one-dimensional array to solve the following program. Write an application that inputs six numbers [Keep the numbers in an array]. The numbers must be between 20 and 200, inclusive. If the number is not between 20 and 200, ask for another input. When a number is entered, display the number only if it is not a duplicate of a number already entered. If it is a duplicate of a number already entered, display a message that the number is a duplicate number and ask for another input. Provide for the worst case in which all six numbers are different. Display the complete set of unique values input after the user enters each new value. UPLOAD Duplicate.java 4 Sample output: 3. (8 pts). Write a program that will help a student learn multiplication. Use SecureRandom object to produce two positive integers between 1 and 20. The program should then prompt the user with a question (use a sentinel-controlled loop), such as: How much is 10 times 11? The student then inputs the answer. If the answer is correct display the message “very good” and ask another question. If the answer is wrong to display the message “no, please try again” and let the student try the same question until the student finally gets it right. 5 You must create two java files: Multiplication.java and MultiplicationTest.java. In Multiplication add two methods: CreateQuestion and CheckResponse. In MultiplicationTest.java, test your methods. UPLOAD Multiplication.java and MultiplicationTest.java Sample output: