Write a complete java program called GroceryItems. Which will do the following tasks: 1- This program should ask the user: "How many grocery items you want to pay?" and store the answer in an integer variable. 2- Based on the number of the items, it should allow the user to enter the price of each item and store them in a one-dimensional array of type double. 3- The program should display an appropriate message to ask the user to enter items price. 4- Finally, it should find and print the total price and the average.
Q: I need help to write this code in JAVA with comment please Write a program that stores the…
A: Program code: //import the required package import java.util.Scanner; //define the class…
Q: A Week 5 .pdf + X O File | C:/Users/SUPERB/Desktop/FALL%202021/0OP/week%207/Week%205%20.pdf (O Page…
A: Java Source Code: WorkingWithArrays.java: import java.util.Arrays; import java.util.HashSet; public…
Q: Write a Java program that obtains products' numbers (array named products[]), and allows the user to…
A: This java program is to perform array operations in an array : initializeArray() – initialize the…
Q: Write a program in which you create an object of type ArrayList named BZ and then add 3 elements in…
A: Use constructor with collection for creating a new ArrayList and then use removeAll method to cancel…
Q: Needs to be written for Java and in one program: Write a program that asks the user to input two…
A: Objective: This program creates an array within a given range and returns the array to the main…
Q: Given the following table containing information about employees of an organization, develop a small…
A: Java used to answer this question
Q: Question 4: Write Program in Java with following features a. The program asks user to provide an…
A: I give the code in Java along with output and code screenshot
Q: Write a java program that prompts the user to enter ten integer values and reads them into an array.…
A: package bartlebey;// Importing the required packagesimport java.io.*;import java.util.*;public class…
Q: ITCS114 - Computer Programming II Lab Assignment # 2- Chapter 07 Write a Java program that will read…
A: Answer Code in Java import java.util.*; public class Solution { public static void…
Q: Q3: Write a Java program that has the following methods: computeAverage () which takes an array of…
A: Average = total marks/ number of students If a students scores more than or equal to 35 then he/she…
Q: Write a class called TwoDArray that has the following behaviors for an array of ints.…
A: Answer the above question are as follows:
Q: Write a Java application and use a Two dimensional array to store five Dutch, French and Italian…
A: One-dimensional array: A one-dimensional array is a type of linear array. Accessing its elements…
Q: Write a program RottenTomatoes.java that creates a 2 dimensional integer array of movie ratings from…
A: Actually, the code has given below:
Q: Question 4: Write Program in Java with following features a. The program asks user to provide an…
A: I have written the program code in step 2. I have also mentioned comments in the entire program .…
Q: Create a Java program that instantiates an array of five integers called intArray, reads five…
A: Program : import java.util.Scanner; public class Main { public static void main (String[]…
Q: Write a program that asks the user to enter a series of 20 numbers. The program should store the…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { int arr[]…
Q: in Java please This program will store roster and rating information for a soccer team. Coaches…
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: Java Write a Bank class with main method. In the main method, ask the user to input how many…
A: Answer: //java program for randomly generating Bank accountIDs and balance import java.util.*;…
Q: The local Driver’s License Office has asked you to write a program that grades the written portion…
A: Given data, The local Driver’s License Office has asked you to write a program that grades the…
Q: Write a Java program that performs the following steps: Prompt the user to input two positive…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: Create a class named Problem1, the program (Java) would do the following: -The program prompts the…
A: The answer to the given question is in subsequent steps.
Q: Write a method named printOdd() that accepts an integer array as argument and print all the odd…
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will help…
Q: 1. Calculate the test averages 2. Return test averages 3. Calculate grades, 4. return grades. 5. And…
A: All the solution code is below:
Q: Write a loop that computes the average of an array of integers [2, 5, 6, 7,9] called avgNum that has…
A: Find the sum of all elements and then divide the sum by length of array
Q: Write a program called Range_array.java that has a method with one integer array and two integers…
A: import java.util.*;public class Main{ public static int [] delete_range(int [] arr,int start,int…
Q: Get the element number(length of the array) from the user. It cannot be less than 10. And fill this…
A: The code is written below for the given problem- import java.util.Random; // importing Random class…
Q: PLEASE HELP ME WITH MY JAVA HOMEWORK PLEASE PLEASE! Write a program that stores positive random…
A: This Question explains about JAVA program :
Q: Write a complete java program called Marks. Which will do the following tasks: I- This program…
A: The program is implemented in Java with procedural approach. We have declared an array of undeclared…
Q: Write a program java that creates an array of Oblong objects to represent the dimensions of rooms in…
A: Below is the required Java program: - Approach: - Define the class Room. Declare the variables to…
Q: 1. Write a complete Java program named FindAverage that contains the following: a. A main method…
A: import java.util.Scanner;import java.util.Random; public class Main //FindAverage{ public…
Q: Write a program named calendar.java that prints a one-month calendar. The user specifies the number…
A:
Q: Write a program called TwoDimensionalSearch.java that prompts the user to enter a integer. You…
A: Step-1: StartStep-2: Declare an array data with array element { 1, 2, 3, 4, 5, 6, 7 }, { 8, 11, 15,…
Q: Write a java method that receives two arrays of integers called arr1 and arr2 and then returns the…
A: Here I have performed right rotation on arr2, to check that arr1 and arr2 becomes the same.…
Q: A teacher has three exam grades for all the members of her class, and she worries that the grades…
A: PROGRAM: //Importing required header file import java.util.*; //Defining class public class Grades…
Q: The Code must be in Java Using the program segment you wrote to find Fibonacci Numbers in lab 8 as…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a complete java program called Marks. Which will do the following tasks: 1- This program…
A: import java.util.*;public class Main{ public static void main(String[] args) { int course;…
Q: You must write a small application in JAVA that stores SRC candidate names and the votes they…
A: equals method in String class is useful to check whether contents of 2 strings are same or not
Q: java language Create a class name FunWithArrays and create the following methods:…
A: Read the size of the arrays(int and string) then read an array of integer and array of strings from…
Q: Write a JAVA program that plays a simple trivia game. The game should have five questions. Each…
A: Define a class. Declare string type arrays for containing question and answer. Declare int type…
Q: You must write a small application in JAVA that stores SRC candidate names and the votes they…
A: We will solve this problem in Java language.
Q: Intellij - Java Write a program which does the following: Create a class with the main() method.…
A: Algorithm: Start Read array size Read array of strings Using Arrays.toString() print array…
Q: In this assignment, you will write a Java program that counts the 26 letter frequencies for a given…
A: Code: import java.util.*; import java.io.*; class LetterCounterArrayApp { // Method 1:…
Q: ze of the 2D square array. Assume the size is at least 5 . Note that the array size may be an even…
A: Code: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: write a java program that contains 2 arrays, one for 10 students names and the other for their…
A: Logic: Accept names from the user and keep it names array which is one dimensional. Accept grades…
Q: How many elements are in the array? int[][] userVals = new int[2][4]; A. 2 B. 4 C. 6 D. 8
A: Solution:
Q: This program is meant to be written in java write a program that stores 20 random integers between…
A: Step-1 Start Step-2 Input a array a of 20 random integer between 1 and 100 Step-3 Print the array…
Q: Write a complete Java program named FindAverage that contains the following: A main method asks…
A: Given: Write a complete Java program named FindAverage that contains the following: A main method…
Q: Write a java program named Largest that creates an array of 10 integer numbers. Then it finds and…
A: Program Description: Write a java program named Largest that creates an array of 10 integer numbers.…
Q: Part 2: Coding 1. Write a complete Java program named FindAverage that contains the following: a. A…
A: logic to generate random number in range:- Min + (int)(Math.random() * ((Max - Min) + 1)); where…
Q: A teacher has three exam grades for all the members of her class, and she worries that the grades…
A: Given: A two-dimensional array containing test marks of several students, the number of students…
Step by step
Solved in 4 steps with 2 images
- Part 1: 1. Write a Java program called Numbers1 that reads 10 integer numbers from the user and displaysthem in reverse order to the way they were scanned.Hint: Use an array to store the 10 integers.2. Generalize the above program, so it reads any number of integer numbers (instead of 10 integernumbers).Hint: promote the user to enter the size (length) of the array. Part 2: Write a Java program called Numbers2 that that reads 10 real (double) numbers from the user, and thenit should find and display the average of the array elements, the largest number and the smallestnumber.Hint: Use an array to store the 10 numbers.Write a complete Java program named FindAverage that contains the following: A main method asks the user to provide the number of rows and columns for a 2-dimensional array of integers. A main method calls the getArray() method that creates the 2D array of specified size and populates it with random values from 0 to 100. A main method prints the elements of the 2D array created by getArray(). A main method calls the printAverage method that will: i. Receive the two-dimensional array as input ii. Calculate the average of elements in this array iii. Display the average on the Console. The average of all elements should be formatted as xxx.xx.Write a program in a class FlowerCounter that computes the cost of flowers sold at a flower stand. Five kinds of flowers—petunia, pansy, rose, violet, and carnation— are stocked and cost, respectively, 50¢, 75¢, $1.50, 50¢, and 80¢ per flower. Create an array of strings that holds the names of these flowers. Create another array that holds the cost of each corresponding flower. Your program should read the name of a flower and the quantity desired by a customer. Locate the flower in the name array and use that index to find the cost per stem in the cost array. Compute and print the total cost of the sale.
- The Code must be in Java Using the program segment you wrote to find Fibonacci Numbers in lab 8 as a basis, you will create an array of the first 50 Fibonacci Numbers as follows: Create an array of 50 elements to hold the Fibonacci numbers. Make the array an array of type long, which is a type of int which can hold larger integers than we normally need. For example: long [] fibs = new long [50]; Fill the array with the first 50 Fibonacci numbers I have an array of the first 50 Fibonacci numbers in the picture. Your program should ask the user for a number between 4 and 21. Using that input as a location in the array, with that location and the next three locations (for example base, base+1, base+2 and base+3) you will multiply the outer values, base and base+3, (the first and last of the four). Do the same for the inner values (base+1 and base+2 multiplied) and then double that value. These two values form the two sides of a right triangle. Now find the hypotenuse.…I need help to write this code in JAVA with comment please Write a program that stores the total amount of rain for each month in an array. Prompt the user for the values for each month to load the array. Display this information back to them in a nice format with the name of the month and the rainfall for that month. Display back the total rainfall for the year, the average monthly rainfall, the month with the most rain, the month with the least rain, the months with rainfall above average, and the months with rainfall below average. Do not accept negative numbers from the user to be stored in the array.Create a class named Problem1, the program (Java) would do the following: -The program prompts the user to enter a positive integer n. The program must error check (keep prompting and reading integers until you get a positive integer n). -The program then will create an array with n elements, and prompt the user to enter n elements and store them in that array. - The program should print all the elements of the array on the same line separated by spaces. -The program should find and print the maximum integer entered, the minimum integer entered and the average of all integers entered.-The program should print all the elements that are greater than the average. - The program should print all the elements that are greater than the last element of the array. - The program should print all the array elements on the same line separated by spaces THIS TIME IN REVERSE ORDER (last to first).
- In java Write a program that uses a 2-D array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods with their appropriate parameters:a.) getData: This method reads and stores the data in the 2-D array.b.) averageHigh: This method calculates and returns the average high temperature of the year.c.) averageLow: This method calculates and returns the average low temperature of the year.d.) indexHighTemp: This method returns the index of the highest temperature in the array.e.) indexLowTemp: This method returns the index of the lowest temperature in the array.Use the following input:High temp for each month: 30 40 45 60 70 90 89 95 79 90 70 40Low temp for each month: 10 -10 20 30 50 75 85 79 50 80 30 20Suppose you are given a `Employee` class with instance variables `name`, `age`, `department, and salary. You are also given a static variable "total Employees and a static variable `totalSalary`, which respectively keep track of the total number of employees and the total salary of all employees. Using this class, write a Java program that does the following: 1. Create an array of size 3 to store Employee objects. 2. Initialize the array with the following Employee` objects: • Name: Alice, Age: 25, Department: HR, Salary: 50,000 Name: Bob, Age: 35, Department: Marketing, Salary: 60,000 Name: Charlie, Age: 30, Department: Sales, Salary: 55,000 3. Modify the age of the first employee in the array to 26. 4. Modify the salary of the second employee in the array to 65,000. 5. Print out the total number of employees and the average salary of all employees. 6. Use the static method `findEmployeeByName to find the `Employee` object with the name "Alice", and print out the…Write a Java application and use a Two dimensional array to store five Dutch, French and Italian translated words. Use a single array to store the English words.Your program must:Q.2.1Contain a single array to contain the following five English words and a Two dimensional array to store the following Dutch, French and Italian translated words.ENGLISH WORD skyrunstudymusic dogDUTCH WORD hemelrennenstudiemuziek hondFRENCH WORD cielcouriretudemusique chienITALIAN WORD cielocorrerestudiamusica cane Print out each English word with the translated Dutch, French and Italian word
- in Java Develop a method called normalizeGrades() in Java following the details below: The method should accept an array of numeric grades as argument. Each grade in the array is a numeric value (of type double) between 0 to 100. The method should create an integer array of grades, following: If a grade in the array is greater than 50, then the method should round the numeric grade to the nearest integer value using Math.round() method, and then again round it to an integer grade to a nearest multiple of 5. If a grade in the array is less than or equal to 50, then the method should round the numeric grade to the nearest integer value using Math.round() method. The method should create a character array of letter grades, using a switch statement by translating the integer grades created in (b) to an array of letter grades of type character, following the grade notation: 100 or 95 or 90 85: A 70, 75, 80: B 55, 60, 65: C…JAVA Program(*MUST WORK IN HYPERGRADE*) Homework #1. Chapter 7. PC# 2. Payroll Class (page 488-489) Write a Payroll class that uses the following arrays as fields: * employeeId. An array of seven integers to hold employee identification numbers. The array should be initialized with the following numbers: 5658845 4520125 7895122 8777541 8451277 1302850 7580489 * hours. An array of seven integers to hold the number of hours worked by each employee * payRate. An array of seven doubles to hold each employee’s hourly pay rate * wages. An array of seven doubles to hold each employee’s gross wages The class should relate the data in each array through the subscripts. For example, the number in element 0 of the hours array should be the number of hours worked by the employee whose identification number is stored in element 0 of the employeeId array. That same employee’s pay rate should be stored in element 0 of the payRate array. The class should have a method that accepts an…Code an exam in Java that repeatedly asks the user to enter the capital for a province in Canada. Then, the program should report whether the answer is correct. Eventually, you must display how many answers the user guessed correctly.The requirements are as follows: - Use a 2D array to hold the provinces and their capitals (as implied by the table below)- Answers are not case-sensitive (e.g. Toronto and tOrOnto are considered the same)