+1 (315) 557-6473 

Best Java Lab Assignment Help

Are you struggling with introduction to Java programming problems? Take our Java lab assignment help service ASAP! We have hired a team of professional Java lab homework tutors to assist you with your complicated assignment. Regardless of the complexity or technicality of your assignment, we assure you that you will receive impeccable solutions. Our Java homework help service is available round the clock.

Java Programming Using Eclipse

For this lab you will use Eclipse. Create a Java project called JavaLab1. Create a class called Lab1. Copy the code at the bottom of the assignment and paste into the Lab1 class file. The Main method will call all the problem methods for all problems. A method has been created for each problem. You will create additional methods/functions as indicated in the question. Add a comment for your name at the top. You can comment out the call to each problem method in main as you get them done. You will zip the entire project (folder called JavaLab1 in your workspace) and upload the zip file on this assignment.
1) Write a program in problem1 method that prompts the user for the amount of change (0 – 99) and calculates the correct (fewest number of coins) number of quarters, dimes, nickels and pennies to return as change.
Hint: Be sure to use a whole number (int) type for all variables. Use Div (/ with int types) and Mod (%) operators.
                Sample run:
                                Enter total change: 87
                                Quarters: 3
                                Dimes: 1
                                Nickels: 0
                                Pennies: 2

A Program that Prints A Statement

2) Write a program in problem2 method that prompt for a whole number and print the correct statement based on the following rules:
                if the number is evenly divisible by 3 print Sassee
                if the number is evenly divisible by 5 print Wazza
                if the number is evenly divisible by 3 and 5 print SasseeWazza
                if the number is not evenly divisible by 3 or 5 print the number
Sample run:
                                Enter a number: 30

3) Write a program in problem3 method that plays the number guessing game. Ask the user for the number of numbers, ie 10 for secret number between 1 and 10, 100 for secret number between 1 and 100. Use the Random object to generate the secret number. Prompt the user for their guess, tell them to “Guess higher”, “Guess lower” or “Correct after x guesses”.
                Sample run (when secret is 3):
                                Enter number of numbers: 10
                                Guess: 5
                                Guess Lower
                                Guess: 2
Guess Higher
                                Guess: 3
                                Correct after 3 guesses

A Problem that Calculates Even and Odd Average Numbers

4) Write a program in problem4 method that calculates the even and odd average of whole numbers input. The user will enter “done” when complete. Use a real number type to calculate and store averages, not integer division.
                Sample run:
                                Enter number: 11
Enter number: 24
                                Enter number: 18
                                Enter number: 29
Enter number: 7
Enter number: done
                                Even Average: 21
                                Odd Average: 15.6666666666667

5) Write a program in problem5 method that produces the printout below. Be sure to use dash “-”, asterisk “*” and plus “+”.
Sample run:
                                -------*
                                ------*+*
                                -----*+++*
                                ----*+++++*
                                ---*+++++++*
                                --*+++++++++*
                                -*+++++++++++*
                                *+++++++++++++*
                                -*+++++++++++*
                                --*+++++++++*
                                ---*+++++++*
                                ----*+++++*
                                -----*+++*
                                ------*+*
                                -------*

GetIntArrayFrom User Method

6) Create a method getIntArrayFromUser that takes the size of the array to retrieve from the user and prompts the user for all values one at a time, then returns the array. Write a program in problem6 method that uses the getIntArrayFromUser method to reads 6 numbers from the console and print the values in the array using a for each loop.
                Sample run:
                                Enter next whole number: 9
                                Enter next whole number: 4
                                Enter next whole number: 17
                                Enter next whole number: 8
                                Enter next whole number: 21
                                Enter next whole number: 6
                                9
                                4
                                17
                                8
                                21
                                6
7) Create a method averageIntArray that takes an array of integers and calculates and returns the average of all values in the array as a double Write a program in problem7 method that uses getIntArrayFromUser method to get an array of 7 numbers, then calls the averageIntArray method to get the average then prints all values in the array that are greater than the average.
                Sample run:
                                Enter next whole number: 3
                                Enter next whole number: 8
                                Enter next whole number: 4
                                Enter next whole number: 12
                                Enter next whole number: 13
                                Enter next whole number: 6
                                Enter next whole number: 9
                                Average: 7.857143
                                8
                                12
                                13
                                9
8) Create a method countTargetIntArray that takes an array of integers and the target value then counts and returns the number of times the target value appears in the array. problem8 method that uses getIntArrayFromUser method to get an array of 10 numbers, then calls the averageIntArray method to get the count then prints the number of times the target was found in array.
                Sample run:
                                Enter next whole number: 2
                                Enter next whole number: 6
                                Enter next whole number: 2
                                Enter next whole number: 4
                                Enter next whole number: 5
                                Enter next whole number: 2
                                Enter next whole number: 4
                                Enter next whole number: 3
                                Enter next whole number: 6
                                Enter next whole number: 2
                                Enter target value: 2
                                target found 4 times
9) Create a program in problem9 that prompts the user for product price and quantity, and continues until the user enters N when asked to continue. Store the inputs (price and quantity) in separate arrays. Once the user has entered N, calculate the grand total, print the grand total, then print the item number as well as the subtotal for each item. The quantity will always be a whole number. Use appropriate data types for the arrays. Assume the user will never enter more than 10 products.
                Sample run:
                                Add to order (Y/N): Y
                                Enter Price: 52.25
                                Enter Quantity: 4
                                Add to order (Y/N): Y
                                Enter Price: 21.85
                                Enter Quantity: 5
                                Add to order (Y/N): Y
                                Enter Price: 1.25
                                Enter Quantity: 55
                                Add to order (Y/N): N
                                Grand Total: $387.00
                                Item 1 subtotal: $209.00
                                Item 2 subtotal: $109.25
                                Item 3 subtotal: $68.75
10) Create a program in problem10 that works just like problem 9 but is not limited to supporting only 10 products. Do this by using ArrayLists instead of arrays for the prices and quantities.
                Sample run:
                                Add to order (Y/N): Y
                                Enter Price: 52.25
                                Enter Quantity: 4
                                Add to order (Y/N): Y
                                Enter Price: 21.85
                                Enter Quantity: 5
                                Add to order (Y/N): Y
                                Enter Price: 1.25
                                Enter Quantity: 55
                                Add to order (Y/N): N
                                Grand Total: $387.00
                                Item 1 subtotal: $209.00
                                Item 2 subtotal: $109.25
                                Item 3 subtotal: $68.75
Java Lab 1 Start Code
import java.util.Scanner;
import java.util.Random;
import java.util.ArrayList;
public class Lab1 {
    static Scanner input = new Scanner(System.in);
    public static void main(String[] args) {
        problem1();
        //problem2();
        //problem3();
        //problem4();
        //problem5();
        //problem6();
        //problem7();
        //problem8();
        //problem9();
        //problem10();
input.close();
    }
    static void problem1()
    {
        //System.out.print("Enter total change: ");
        //change = input.nextInt();
        //input.nextLine();
        //System.out.println("Quarters: " + quarters);
    }
    static void problem2()
    {
        // System.out.print("Sassee");
    }
    static void problem3()
    {
        //Random random = new Random();
        //secret = random.nextInt(numNums) + 1;
        //System.out.printf("Correct after: %d", guessCount);
    }
    static void problem4()
    {
        //System.out.printf("Odd Average: %.2f\n", oddAverage);
    }
    static void problem5()
    {
        // System.out.print("*");
        // System.out.println();
    }
    //static int[] getIntArrayFromUser(int size)
    static void problem6()
    {
        // System.out.println(x);
    }
    //static double averageIntArray(int [] array)
    static void problem7()
    {
        //System.out.printf("Average: %.2f\n", average);
        // System.out.println(x);
    }
    //static intcountTargetIntArray(int [] array, int target)
    static void problem8()
    {
        //System.out.print("Enter target value: ");
        //System.out.printf("target fount: %d times\n", count);
    }
    static void problem9()
    {
            //System.out.print("Enter Price: ");
            //System.out.print("Add to order (Y/N): ");
        //System.out.printf("GrandTotal $%.2f\n", grandTotal);
            //System.out.printf("Item %d subtotal: $%.2f\n", y+1, subTotal);
    }
    static void problem10()
    {
        //ArrayList prices = new ArrayList();
            //System.out.print("Enter Price: ");
            //System.out.print("Enter Quantity: ");
            //System.out.print("Add to order (Y/N): ");
        //System.out.printf("GrandTotal $%.2f\n", grandTotal);
            //System.out.printf("Item %d subtotal: $%.2f\n", y+1, subTotal);
    }
}