C1. Write a Java program named Counter that asks the user to enter 15 real numbers and store them in an array. Then it should find and display how many numbers are below 25 in the array. The user should enter ten numbers in response to a message. A sample run of the program: Enter 15 real numbers: 55 101 -44 39 17 99 0 42 11 37 61 -51 78 213 55.75 There are 5 numbers are below 25 in the array.
Q: TASK 3 Write a Java method that returns the location of the largest element in a two-dimensional…
A: To construct the 2-D array, we need to know the number of rows and columns. When the user enter it,…
Q: Create a java program that generates elements (randomly from 10 – 50) of a 2-dimensional array (5x5)…
A: import java.util.*; import java.lang.Math; public class Program { public static int…
Q: Write a program in a class NumberBelowAverage that counts the number ofdays when the temperature is…
A: Code: #include <stdio.h> // Returns the new average after including xfloat getAvg(float…
Q: Write a program that copies an array including the following days: Sat,Sun,Mon,Tue,Wed,Thu,Fri The…
A: Given:
Q: Write a program in a class EvensOddsAvg that counts the integers that are below the average. Read 15…
A: Here since programming language not mentioned, using Java. We need to declare array arr[15] The…
Q: Write a Java program that creates an array data of size 8, representing a binary number of 8 bits.…
A: import java.util.Scanner;import java.lang.Math; public class Main{ public static void…
Q: Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a new…
A: The answer for the java program is
Q: You are provided the following numbers: 6, 8, 33, 87, 12, 17, 3 Write a Java program in NetBeans…
A: Java code :- import java.util.*;public class MyClass { public static void main(String args[]) {…
Q: Write a java program which: a. Create an array of length 10 b. Populate the array using method.…
A: The java program is given by public class Main{ public static void main(String[] args) { int[]…
Q: Write a Java program named Occurrence that asks the user to enter 10 integer numbers and store them…
A: Step-1: Start Step-2: Declare an array arr of size 10 Step-3: Declare two variable x and count…
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: Write a Java method that returns the index of the smallest element in an array of integers. If the…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Create a java program that generates elements (randomly from 10 - 75) of a 2-dimensional array (5x5)…
A: import java.util.Random;//to generate random numbers public class Main{ //method to check given…
Q: Write a Java program to implement the following by using class Arrays: Read 5 student marks and…
A: Given: Write a Java program to implement the following by using class Arrays: Read 5 student marks…
Q: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array (5x5)…
A: Java: Java is a general purpose high level programming language. It was developed by James Gosling…
Q: Using methods and arrays, write a program that Creates an array A of size 100 integers. Enter a set…
A: Lets see the solution.
Q: Write a Java program to do the following: • Create a two-dimensional array named "marks" and size…
A: The code has been given in step 2.
Q: You are given an array of integers below. Write a Java program to perform the following operation on…
A: Given: An array of integers is given. int []arr = {12, 7, 12, 53, 2, 5, 49, 5, 21, 0} Requirement:…
Q: Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a new…
A: Q: Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a…
Q: Write a Java program that creates an array data of size 8, representing a binary number of 8 bits.…
A: 1) Read the input into array a and initialize flag=0 2)check the input and if other than 0 or 1…
Q: Write a class AnalyzeNumbers which asks the user to enter the number of inputs and stores them in an…
A: import java.util.Scanner;class AnalyzeNumbers { public static void main(String args[]) { Scanner sc…
Q: Write an array java program asking the user how many integer numbers to read in and create a one…
A: Java does not have the inline function. When the program code located in a public class, the user…
Q: Write a Java program to do the following: Create a two-dimensional array named "marks" and size…
A: We will write the JAVA code for the requirement. We will write our logic into main method.
Q: Write a Java program to input a single dimensional integer array of size 8. Pass the array to a…
A: Java code: import java.util.Scanner;public class Test{ //main method public static void…
Q: in java (1) Prompt the user to enter five numbers, being five people's weights. Store the numbers…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: Write a Java program that will create a report to display the top three mobile device sales per…
A: Algorithm: Start Store the given data in arrays Iterate through the arrays and print the data in…
Q: Write a Java method that returns the location of the largest element in a two-dimensional array.…
A: Given:
Q: Write a Java program to do the following: • Create a two-dimensional array named "marks" and size…
A: Begin Enter number of student in variable n Declare 2-d array marks Enter assessment scores in marks…
Q: Write a Java program to input a single dimensional integer array of size 8. Pass the array to a…
A: Java code for above : import java.util.Scanner; class Prog{ public static void display(int []…
Q: Write a full Java program to do the following: 1. 2 3-1 1 Declare a one-dimensional array of type…
A: Here is the java code:
Q: hat creates an array data of size 8, representing a binary number of 8 bits. The user must…
A: Write a Java program that creates an array data of size 8, representing a binary number of 8 bits.…
Q: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array (5x5)…
A: The program is written in Java. Please find the source code and output in the following steps.
Q: Write a java program that: • Reads 10 integer numbers and store them in an array of size 10. •…
A: import java.util.*; public class Main { public static void main(String[] args) { int arr[]=new…
Q: Write an application program that could be used to find the numbers divisible by 30 stored in a…
A: Computer Programming: Programming is the procedure of forming a set of instructions that directs a…
Q: Write the following Java code: Create an array of size 10 with elements entered by the user. Print…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT---------
Q: Write a java program that reads the integers between 1 and 10 and counts the occurrences of each.…
A: CODE:- import java.util.Scanner;public class Main { public static void main(String[] args) {…
Q: Write a Java application to simulate the rolling of two dice. The application should use an object…
A: Class: DumDice.java //Code public class SumDice { public static void main(String[] args) {…
Q: Write a Java program to do the following task: Input n from user. Create an array to store n double…
A: Here I have created a function named sumOfArray(). In this function, I have created a for loop to…
Q: Write a Java program to input a single dimensional integer array of size 10. Pass the array to a…
A: Read the numbers in the array. Call the method changeNumber(). Check if the number in array is even…
Q: Write a Java program to do the following: - Create a two-dimensional array named "marks and size…
A: Step-1: StartStep-2: Declare variable n and take input from userStep-3: Declare two array…
Q: Write a Java program that inputs size of array N and N numbers in the array. It should use Insertion…
A: PROGRAM CODE: import java.util.*; // import utility package of javapublic class Main{…
Q: Write a Java program that will randomly generate ages for 20 students in CS161, and store them in an…
A: public class Main{ public static void main(String[] args) { int ages[] = new int[20]; int…
Q: Write Java program an application program that could be used to find the numbers divisible by 30…
A: ANSWER in step2
Q: Write a program Reverse.java that prompts the user to enter ten numbers, reverses an array by…
A: Start input 10 elements of T copy it in another array print it in reverse order stop
Q: Write a Java program that reads an integer N from the user and declares an integer array of size N.…
A: Code to copy : import java.util.*; import java.text.DecimalFormat; public class Main {…
Q: Write a Java program to find all triplets (three numbers whose sum equal a given sum (16) from an…
A: The main objective of the java program, TripletsMain.java is to open an input file called,…
Q: Write a Java program to generate random integer between 5 and 20 to fill a single dimensional…
A: below is the java code for given query
Q: Write a program that declares an array of 15 integers and reads the values from the user. Make sure…
A: Given: Write a program that declares an array of 15 integers and reads the values from the user.…
Q: Create a java program that generates elements (randomly from 10 – 50) of a 2-dimensional array (5x5)…
A: Program: import java.util.Random;// for random numbers public class Main { public static…
Step by step
Solved in 4 steps with 2 images
- Write a java program: Question 1 Write a program that allows the user to enter name and grade until "QUIT" is entered for name. The grade should be a number between 0 and 100. If the user input of a grade is not in this range, you should ask the user to re-input the grade. Store all the names in an array called names, and all the grades in an array called grades. Print out all the names and the corresponding grades. For Example, Input Enter name: Alice Enter grade: 90 Enter name: Bob Enter grade: 80 QUIT Expected output Name: Alice, Grade: 90 Name: Bob, Grade: 805. Write a Java program named Grade that asks the user to enter 5 marks of a student and store them in an array. Then it should compute and display the average mark. Then it should find and display the highest mark. Sample run of the program: Enter 5 marks (a mark is between 0 and 100): 85 40 69 39 70 The average mark is: 60.6 The highest mark is: 85.0 Page 3 6. Write a Java program named Occurrence that asks the user to enter 10 integer numbers and store them in an array. Then it should ask the user to enter an integer number (x) using an appropriate message. Then it should count and display the occurrences of the entered number (x) in the array. Enter 10 integer numbers: 27 3 1 76 17 12 76 19 1 Enter an integer number: 1 The number 1 occurs 3 times in the arrayQ1. Write a Java program that performs the following steps: Prompt the user to input two positive integers: firstNum and secondNum (firstNum must be less than secondNum). Output all odd numbers between firstNum and secondNum. Output the sum of all even numbers between firstNum and secondNum. Output the sum of the square of the odd numbers between firstNum and secondNum. Q2. write a Java program to encode a name by creating an array of integers. Write Java method called encodeName that takes a name as a string (without spacing and all lower case) and returns an array of integers of the same size as name whose elements are the number in the alphabet of the corresponding character in name (starting from zero). For example, calling this method with name = “aabed” it should return [0, 0, 1, 4, 3]. Write a printArray method that prints all the elements of an array of integers in one line. Write a main method that calls encodeName and printArray methods to print the array…
- 4. Given an integer array of size 10, write a Java program to prompt the user to enter an integer value num and in the output print all numbers in the array greater than num. If no such number is present then print the message "No Results Found." in the output. Given Array: {12,67,45,89,94,56,78, 34, 47, 63}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 20For Beginners Java: Write a program that ask the user to enter a list of positive scores until the user enters a negative score to terminate the input. You need to store these scores in an array. You can assume the maximum number of scores the user may enter is 50. However, you need to keep track of the actual number of scores entered. Write 2 methods: 1. calculateAverage(): this method takes the list of scores and return the average score. 2. countPerfectScores(): this method takes the list of scores and return the number of perfect scores (100). The main program reads the input and calls these methods and print the results. Please make sure you write a comment line to document what your method does.
- Write a Java program named Findletter that asks the user to enter 10 letters and store them in an array. Then it should ask the user to enter a letter (char value) to search for it. Then, if the entered letter is found, the program should display the message "The letter is in the array", otherwise it should display the message "The letter is not in the array".1. Write a program in a class EvensOddsAvg that counts the integers that are below the average. Read fifteen integers from the keyboard and place them in an array. Compute the sum and count of the evens and the odds separately. Find the average of the integers, and count and display the integers which are below average. Please Java CodeWrite a program that does the following: • Reads an integer from the user that represents the number of the students in a class. • Reads the scores of the students from the user and stores them in an array. • Calculates and prints the average of the students with a passing grade (above or equal to 60). Hints: Assume that the scores of the students are integers between 0 and 100 (inclusive) • Assume that there is at least one student in the class with a passing grade. Using java Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0
- Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a new price for each item in the Cart list 2: Print the price of a particular item 0: Exit Enter your choice: Define an array: ShoppingCart which stores prices of items. Define another array: ItemsNames of the same size that stores names of such items. Assume that there are 10 items. When the user presses 1, the program call a method that creates a new price for each item in the array using random numbers between 1 and 1000 AED [not inclusive]. If the user presses 2, the program call a method that prints the name of the requested item and its price. Use switch case statement for choosing among the menu options. Make a method to display the menu to give the user the possibility to use the menu as much as he/she wants.Write a java program to create prices of Shopping Cart items that provides a menu: 1: Create a new price for each item in the Cart list 2: Print the price of a particular item 0: Exit Enter your choice: Define an array: ShoppingCart which stores prices of items. Define another array: ItemsNames of the same size that stores names of such items. Assume that there are 10 items. When the user presses 1, the program call a method that creates a new price for each item in the array using random numbersbetween 1 and 1000 AED [not inclusive]. If the user presses 2, the program call a method that prints the name of the requested item and its price. Use switch case statement for choosing among the menu options. Make a method to display the menu to give the user the possibility to use the menu as much as he/she wants.Design a program that asks the user to enter a store’s sales for each day of a 7 day week. The amounts should be stored in an array. Use a loop to calculate the total sales for the week, the average sales per day, and also display the list of values. This is for java.