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...

1 answer below »
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:
Answered Same DayMar 14, 2021

Answer To: 1 INSY 4305 ADVANCED APPLICATION DEVELOPMENT ASSINGMENT 3 20 points 1. INSTRUCTIONS • For the late...

Neha answered on Mar 16 2021
141 Votes
52024/Duplicate.java
52024/Duplicate.java
// This code is to store 6 elements in an array.
// If the element does not fit in the range of 20-200 then it can't be saved
//If user enters duplicate element then he will be notified to enter different number

import java.util.Scanner;
//Main class 
public class Duplicate 
{
    //Method to check if element already exists or not
    // new number and array is passed in this method
    private static boolean check(int[] arr, int toCheckValue) 
    { 
        boolean test = false; 
        for (int element : arr) { 
            if (element == toCheckValue) { 
                test = true; 
                break; 
            } 
        }
        return test;
    } 
    //main method
    public static void main(String[] args) 
    {
        Scanner in = new Scanner(System.in);
        boolean valid = false;
        int[] inputRange = new int[5];
        int counter = 0;
        int number = 0;
        //Ask for digits between 20 to 200
        System.out.println("Enter 6 digits between 20-200"); 
        for (int i = 0; i < inputRange.length; i++) {
            //Restart "valid" variable for each new user input
            valid = false; 
            do {
                number = in.nextInt();
                if(check(inputRange,number))
                {
                    System.out.println(number+" already exists");
                }
                else
                {
                    if (number >= 20 && number <= 200) 
                    {
                        //If valid, it will exit do-while
                        valid = true; 
                    } 
                    else 
                    {
                        System.out.println("Enter a valid digit between 20-200");
                    } 
                }
            } while (!valid);
            inputRange[i] = number; 
        }
        // if all conditions are passed then number will be added in array and printed
        for (int i = 0; i < inputRange.length; i++) 
        {
            System.out.println(inputRange[i]);
        }
    }
}
52024/Multiplication.java
52024/Multiplication.java
//This code is to teach Multiplication to the users.
// The code will generate two random numbers and user will be asked to ented correct result
//The same question will continue until user enters correct answer
//User can enter -1 to quit
import java.security.SecureRandom; //library for the random number generation
import java.util.Scanner;
//M...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here