this java program computes the sale of flowers
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: In java language Create a class name FunWithArrays and create the following methods:…
A: public class FunWithArrays{ public static void main(String[] args) { int arr[] =…
Q: Write a method called priceIsRight that mimics the guessing rules from the game show The Price Is…
A: Given: Write a method called priceIsRight that mimics the guessing rules from the game show The…
Q: Implement a method named insert. This method should take an array of ints, the index at which a new…
A:
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: Given the following table containing information about employees of an organization, develop a small…
A: Java used to answer this question
Q: Assume an array candidates[ ] that contains candidate names, as in the following sample data:…
A: Program: import java.util.*; public class Test { public static void main(String[] args){ String[]…
Q: In Java: Ask the user to enter the size of an array. It must be greater than 0. Write a method,…
A: Step 1 : Start Step 2 : Define the method inputValidation() which inputs the array size from the…
Q: *CODE SHOULD BE IN JAVA* A personal phone directory contains room for first names and phone numbers…
A: The code is completed in java. Here the maximum directory limit is 30, already 10 peoples are there…
Q: Suppose that longitude is assigned to the first column of an array and latitude is assigned to the…
A: Here, the command line arguments, args[] is an array of Strings and that too a 1D array So, here you…
Q: In a program, firstly create an array with the size of 10 and prompt you enter to the numbers. Then…
A: Given: In a program, firstly create an array with the size of 10 and prompt you enter to the…
Q: Given an ArrayUnboundedQueue of Strings called mygueue, and the following values for its fields:…
A: Note: As you have asked a multipart question, as per our policy we will solve the first three for…
Q: Write a java console application that generates 10 random numbers between 1-10 Store these numbers…
A: Here we need to use the random class provided by java to generate random number. Let's define array…
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: D creates an associative array containing three key-value pairs
A: let town = { name: "Helena", county: "Shelby", population: 18500}; AnsweR : D creates…
Q: When the user enters 4 at the menu prompt, your program will access all objects in the array to…
A: this is the code:
Q: How many elements are in the array? int[][]userVals=newint[2][4];
A: int[][]userVals=newint[2][4]; In the above declaration: 2 indicates number of rows. 4 indicates…
Q: Mr. Ahmed wants to create a database of employees in his company with three records for each…
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will…
Q: Write an application containing three parallel arrays that hold 10 elements each. The first array…
A: ANSWER:-
Q: This code is in java. You are walking along a hiking trail. On this hiking trail, there is…
A: We need to run loop from 1 to length-1 and check the highest difference.
Q: Write an application with a main method that allows you to: • Create an array of 3 Cars, the user…
A: Solution: Java code: Car.java public class Car { private String code; private String…
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: Prompt the user to enter an integer, then asks the user to enter that many values. Store these…
A: Prompt the user to enter an integer, then asks the user to enter that many values.Store these values…
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: This program asks the user to enter 4 names for a team, storing them in an array of Strings.
A: 1. Create function input Team with parameter int array size. i. create array of string of…
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: Write a complete java program called GroceryItems. Which will do the following tasks: 1- This…
A: Algorithm: Start Read the no.of items n Declare an array a of size n Read prices of n items in the…
Q: Write a Java program named Findletter that asks the user to enter 10 letters and store them in an…
A: The required Java code is given below: import java.util.Scanner;public class Findletter{ public…
Q: Write an Java application that prompts the user for a checking account balance and a savings account…
A: Java Code: The Balance.java application code is shown below: import java.lang.Math; import…
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: A point in the 2D is represented by a pair (x, y). To represent a group of points, a 2D array is…
A: EXPLANATION Below is the program for the given question. Hope you understand it well. If you have…
Q: You are to write a boarding system for a Cruise ship in java. The system will print a menu with…
A: Step 1 Algorithm: Start Create a class named Ship with name and year as its attributes Implement…
Q: Create an ArrayList, Named it Husnain that can hold Integers, and fill each slot with a different…
A: By specifying the number n, we can generate the random number from 0 to n-1 So, add 1 to this, and…
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 Java program named searchForLastOccurence that : Asks the user to enter an integer value…
A: Introduction: This question explains about JAVA program
Q: Use the Account class created in Programming Exercise9.7 to simulate an ATM machine. Create 10…
A: PROGRAM STRUCTURE First statement is importing the package whose functions are required later in…
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: Assume an array candidates[ ] that contains candidate names, as in the following sample data:…
A: Program: import java.util.*; public class Test { public static void main(String[] args){ String[]…
Q: The Grades.java class file has a studentScores array with 6 elements. Add a loop that will Check…
A: Please find the answer below :
Q: JAVA LANGUAGE Create an ArrayList, Name it YourRegNoandName that can hold Integers, and fill each…
A: import java.util.*;import java.lang.*;import java.util.Scanner;public class main{ public static…
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: Write a program that do the following: Ask the user to input his/her first name and store it in a…
A: import java.util.*; class TestClass { public static void main(String args[] ) throws Exception {…
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: Write a program RURottenTomatoes.java that creates a 2 dimensional integer array of movie ratings…
A: public class RURottenTomatoes{ public static void main(String[] args) { //parse the arguments…
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: code in javascipt create an array with elements and objects and print the whole array
A: Javascript code is as follows:-
Q: The Grades.java class file has a studentScores array with 6 elements. Add a loop that will Check…
A: Please find the answer below :
Q: Wnite a Java program to input a single dimensional integer array of size 10. Pass the array to a…
A: import java.util.Scanner;import java.util.*;import java.lang.*;public class MyClass { public…
this java program computes the sale of flowers. Name of flowers: daisy, pansy, rose, violet, carnation Flowers are stored in the flowers arrayprices = daisy = $2, pansy = 4, rose = 9, violet = 3, carnation = 7. Ask the user what kind of flower would you likeVerify the user has entered a valid flower name by comparing the entry with the elements of flowers; for an invalid flower name, display a message and exit the programFor a valid flower name, ask the user the quantity and compute the total. Ask the user if he or she has a coupon, if y, subtract the coupon value from total, if the total is greater than the coupon; display total; otherwise, tell the user the coupon could not be applied because the min purchase was not met and display total, without applying the coupon.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a Java Console application in which you initialize an arraylist with 10 String values. For example, 10 colour names, or fruit names, or veg names, or car names, etc. Display all the values in the list in a neat tabular format. Randomly select a value from the array. Now allow the user 3 chances to guess the value. After the first incorrect guess provide the user with a clue: the first letter of the randomly selected word. After the second incorrect guess provide the user with another clue: the number of letters in the word. Once the user correctly guesses the word, remove that word from the list. Display the number of items in the list. The user must have the option to play again.In java, please read the text file as array. Then, replace the null with 0 and calculate the sum of the new students in ABC University.Example of text file: (university,year,total_students,new_students,new_staff,ABC, 2000, 3457, , ,ABC, 2001, 3675,218, ,EFG, 2000, 2389,602, ,EFG, 2001, 2785,396, 65,)a java application that will store three different details for a local car dealership the vehicle details must be stored in parallel arrays for the vechicle identification number (vin) vehicle manufacturer and vehicle price
- Another way to write this java applacation? Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it’s not a duplicate of a number already read. Provide for the “worst case,” in which all five numbers are different. Use the smallest possible array to solve this problem. Display the complete set of unique values input after the user enters each new value. Here is the code I have I just want to see another way it could be written. import java.util.Scanner; public class DuplicateElimination { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int arr[] = new int[5]; int size = 0, n; for(int i = 0;i<5;i++){ System.out.print("Enter an integer between 10 and 100:"); n = scanner.nextInt(); if(size==0 || elemanVarmı(arr,size,n)){ System.out.println("This is the first time "+n+" has been entered");…A teacher has three exam grades for all the members of her class, and she worries that the grades are too low. You need to complete the method, named testAverage, in the class named Grades.java. There are two parameters to this method: the first is an integer representing the number of students in the class and, the second is a two-dimensional array of integers. In other words, each row represents the three grades for one student, while the columns represent the three sets of test grades. The return value should be the number of students with an average exam grade below seventy. The grades should be treated as double variables. For example, consider the grades for the four students in the following 2-D array, [88, 84, 89] [76, 64, 67] [85, 76, 79] [95, 90, 91] The first student has an exam average of 87.0 (= (88+84+89)/3 = 261/3), the second student has an exam average of 69.0 (= (77+64+67)/3 = 207/3), the third student has an exam average of 80.0 (= (85+76+79)/3 = 240/3), while the…A teacher has three exam grades for all the members of her class, and she worries that the grades are too low. You need to complete the method, named testAverage, in the class named Grades.java. There are two parameters to this method: the first is an integer representing the number of students in the class and, the second is a two-dimensional array of integers. In other words, each row represents the three grades for one student, while the columns represent the three sets of test grades. The return value should be the number of students with an average exam grade below seventy. The grades should be treated as double variables. For example, consider the grades for the four students in the following 2-D array, [ [88, 84, 89] [76, 64, 67] [85, 76, 79] [95, 90, 91] ] The first student has an exam average of 87.0 (= (88+84+89)/3 = 261/3), the second student has an exam average of 69.0 (= (77+64+67)/3 = 207/3), the third student has an exam average of 80.0 (= (85+76+79)/3 = 240/3), while…
- 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 wordIn Java, please don't modify only fill in the code where it says "/* Type your code here. */" everything need to stay the same as written below under PlayerRoster.java or do not answer it. This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. 1. Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int array and the ratings in another int array. Output these arrays (i.e., output the roster). Ex: Enter player 1's jersey number: 84 Enter player 1's rating: 7 Enter player 2's jersey number: 23 Enter player 2's rating: 4 Enter player 3's jersey number: 4 Enter player 3's rating: 5 Enter player 4's jersey number: 30 Enter player 4's rating: 2 Enter player 5's jersey number: 66 Enter player 5's rating: 9 ROSTER Player 1 -- Jersey number: 84, Rating: 7 Player 2 -- Jersey number: 23, Rating: 4 ... 2. Implement…(in java) (with a screenshot of the code please) write a java program that contains 2 arrays, one for 10 students names and the other for their grades they must be all entered by the user -the names array will be a 1d array (single array) -the grades array will be a 2d array and it will have 3 rows and 10 columns, the first one is will represent the first exam, the second will represent the second exam, and the third one will represent the final exam finally, you will do a loop that will calculate the sum of all exams for each student
- in java Integer numVals is read from input and integer array userCounts is declared with size numVals. Then, numVals integers are read from input and stored into userCounts. If the first element is less than the last element, then assign Boolean firstSmaller with true. Otherwise, assign firstSmaller with false. Ex: If the input is: 5 40 22 41 84 77 then the output is: First element is less than last element 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class UserTracker { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumVals; int[] userCounts; inti; booleanfirstSmaller; numVals=scnr.nextInt(); userCounts=newint[numVals]; for (i=0; i<userCounts.length; ++i) { userCounts[i] =scnr.nextInt(); } /* Your code goes here */ if (firstSmaller) { System.out.println("First element is less than last element"); } else { System.out.println("First element is not less…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…In Java: Ask the user to enter the size of an array. It must be greater than 0. Write a method, inputValidation, that returns the size of the array to the main.