BufferedReader input - new BufferedReader ( new InputStreamReader ( System.in ) ); String[] name - new String[25]; int[] grade = new int[25];; String temp - " "; int i - 0; while(true){ System.out.println("Enter name: "); temp - input.readLine(); if(temp.equals("QUIT")){ break; }else{ name[i] = temp; } System.out.print1n("Enter grade: "); grade[i]= Integer.parseInt(input.readLine()); i-i+1: }
Q: The symbol for the stream extraction operator is_______.
A: Given: The symbol for the stream extraction operator is_______.
Q: Word Separator Write a program that accepts as input a sentence in which all of the words are run…
A: The objective is to write a program code that accepts as input a sentence in which all of the words…
Q: (b) Person -name:String -address:String Person(name:String, address:String) getName ():String…
A: Solution: Given,
Q: public static void question(ArrayStack s1, ArrayStack s2) { if(s1.isEmpty()…
A: s2 will contain the alternate elements of s1 in the reverse order
Q: Problem Description: Write a telephone lookup program. Read a data set of 1,000 names and telephone…
A: Program code to copy Main.java Main.java import java.io.File;import java.util.*; public class Main{…
Q: What does this method do? public class StackTest { public static void question(ArrayStack s1,…
A: - The question wants to know what does this code does. - The code is using two arraystacks and the…
Q: sortLecNotes sortsearchassigncodeex1.java sort, search for a specific student package…
A: Answer: our instruction is answer the first three part from the first part and . I have done code in…
Q: A for construct is a loop that handles a list of items. So long as there are items to process, it…
A: A looping construct is basically considered to as a "for" construct. It may be used to process a…
Q: Language: JavaScript (Node.js) • Autocomplete Ready O 1. Loops and Arrays 1 let fruits =…
A: Answer in step2
Q: visual studio using assembly language ctt Write the program for the 7th exercise ( copy string…
A: Data segment: It is used to define the memory region where data elements are stored Code segment:…
Q: public class Facility implements Iterable { protected String name; } protected class StorageUnit {…
A: public class Facility implements Iterable { protected String name; protected class StorageUnit…
Q: Write the following method that merges two sorted listsinto a new sorted list:public static int[]…
A: Program: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: package Q2; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
A: import java.io.FileInputStream;import java.io.FileNotFoundException;import…
Q: subject: microprocesor and assembly language Write a program that displays a string in all possible…
A: Answer :- PROGRAM INCLUDE Irvine32.inc.datacount DWORD ?.codemain PROC mov eax, 0 + (0 * 16)…
Q: A label is a simple control which is used to display on the window: O An editable Text O A…
A: Given:
Q: Q2: Find the output: #include int main () { int *x; int *p,*q; int c=100,a; x-&c; p=x+2; x-2; a-p-q;…
A: The output of the given program is
Q: The code has to go to the next line when there is a semicolon. How should i do that. My code: int…
A: The given problem is solved in C++ using fstream header library to read the data from the file.…
Q: Lottery Ticket Challange- Python Coding I have coded... import…
A: Programming Instructions:Create a python program and declare the required counter variables ‘count3’…
Q: Task 1: Write a program that reads a text file which has a poem written in it. (Write down the poem…
A: Hey, We are allowed to answer only a single question if there are multiple independent questions…
Q: public static ArrayList getInvalidPasSwords (ArrayList passwords) { ArrayList invalid = new…
A: Here have to determine about pseudocode for given java code.
Q: Use for loop in Java language Write the method stringSplosion(). * * The method takes one…
A: method:- public static String stringSplosion(String s){ String temp="",ans=""; for(int…
Q: import java.io.File; import java.io.FileReader; import java.io.FileNotFoundException; import…
A: The error in the program is it cannot open the file for reading so you have to make sure that the…
Q: What does this method do? public class StackTest public static void question(ArrayStack s1,…
A: Dear Student, Based on your program, first the result of last element in s1 will be stored in s2…
Q: JAVA (Baby name popularity ranking) The popularity ranking of baby names from the years 1960s to…
A: import java.util.*;import java.io.*; public class Exercise { /**It is Main method */ public static…
Q: Aquarium Fish - length: double - width: double - height: double fishes: Fish [ ] - name: String -…
A: If you want to run the code you can run it on online GDB compiler. I have bolded out the code for…
Q: Write the function readSalesData. #include #include #include #include #include using…
A: check further steps for the answer :
Q: princludeciostream> includecfstream> includeciomanip> using namespace std; gint main() int n; cout «…
A: For first error Graph class or structure is not defined in the code, so compiler is not able to…
Q: 1. Complete read_date(): • Read an input string representing a date in the format yyyy-mm-dd. •…
A: The program is written in Python. Check the program screenshot for the correct indentation. Please…
Q: def get_words (filename: str) -> List [str]: Given the name of a file which contains many words (one…
A: TEXTFILE Content : ;efsf;gwe privacypepperabolishdesk;hkintroduce finish;quartercouragefabricateduck…
Q: detemine if the follow statement are true or False and why? screenshots show the ArrayBoundedStack…
A: Introduction: The ArrayBasedStack class is defined along with its attributes, constructors, and…
Q: static List findWinners(String pattern, int minLength, boolean even, Stream stream) This function…
A: Answer:
Q: a. Variables Trainer -> String i. Gym - >String Members ->arrayList of type pokemon ii. iii. iv.…
A: Program Approach: 1- First, create a class name as Pokemaon. 2- Inside the Pokemaon class, define…
Q: hen we use the new operator to produce a String, where does it go? a. Stack b. String storage…
A: Introduction: When we use the new operator to generate a String, the Java compiler will construct a…
Q: 4-20) (Process a string) Write a program that prompts the user to enter a string and displays its…
A: Ans: As per your output my output is different because your input is not totally visible. Code:…
Q: The symbol for the stream extraction operator is+__________________
A: Extraction operator is used to take the user input or from any output and assign it to some memory…
Q: Write a program that reads all words from a file and saves them in a data structure. Then, it prints…
A: The idea is to use the concept of File Handling and a text file(say file.txt) that contains all the…
Q: Person receives text (string) messages on his/her phone. Message memory of a phone is very limited.…
A: In the above problem statement, the messages arrive on the phone. These messages are moved from the…
Q: Declare a string array in PowershellI. Which loop statement is invalid? $names = @("Any", "Bob",…
A: Declare a string of array in Powershell. Which loop statement is invalid? Option C
Q: sortsearchassigncodeex1.java sort, search for a specific student package…
A: If the input array is not sorted, the results are undefined and negative. If there are duplicates,…
Q: JAVA (Baby name popularity ranking) The popularity ranking of baby names from the years 1960s to…
A: Data Provided: - baby names from the years the 1960s to 2010 are stored in files named…
Q: package datastructure; public class UseArrayList { public static void main(String[] args) { /* *…
A: Task : Create the array list. Show different array list functions. Use for loop to show array…
Q: in the coll
A: given - Define a collection “ArrayList” to store the students' names. Use a loop to take 5…
Q: package Q2; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
A: Code: package Q2; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
Q: Write a program findStr.c that finds the "smallest" and "largest" in a series of words. After the…
A: The Answer is
Q: This is a code in C, I need to change the code as much as possible, but on condition to perform the…
A: Given: According to your question, you asked just to change the variable names and loops. So this C…
Q: Given a string and an integer index, return a new string with the following transformations applied:…
A: We will take the empty string suppose demo = "" and target string is demo1 = "Robert" Now we will…
Q: package Q2; import java.io.FileInputStream; import java.io.FileNotFoundException; import…
A: package Q2;import java.io.FileInputStream;import java.io.FileNotFoundException;import…
Q: (True/False): In protected mode, each procedure call uses a minimum of 4 bytes of stackspace.
A: Protected mode is an operational method of x86-viable focal handling units. It permits framework…
Q: int main() int arr[] = {5,2,1,4,6,3}; cout<<lookup(arr,5,3)<<endl; cout<«lookup(arr,1,3)<«endl;…
A: The code is simpe lookup (arr, 5, 3) function called lookup(arr[], int num, int cnt) for loop will…
Hey, can u fix my code so that if the user doesnt enter a grade from 0 to 100, it will ask the user to re-enter a grade, everything else is correct, thanks
Step by step
Solved in 2 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: 80The Sports Department of an education institution collects students' names participating in various teams like cricket, football, hockey. A student is allowed to participate in only ONE team. Write a Java program that prompts the user to input names for the three teams and checks NO identical names are found in the arrays. i.e., while entering name for the second team, it should not appear in the first team and while entering name for the third team, it should not appear in first and second team.Part 1: 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 40 Low temp for each month: 10 -10 20 30 50 75 85 79 50 80 30 20
- 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 20A positive integer greater than 1 is said to be prime if it has no divisors other than 1 and itself. Write a program that asks the user to input an integer greater than 1, then display all of the prime numbers that less than or equal to the number entered. The program should work as follows: • Once the user has entered a number, the program should display an array with all of the integers from 2 up through the value entered. • The program should then use a loop to step through the array. The loop should pass each element to a method that displays the element whether it is prime number. Your result should look like, for example: Enter an integer greater than 1: 9 2, 3, 4, 5, 6, 7, 8, 9 2 is prime 3 is prime 4 is not prime 5 is prime 6 is not prime 7 is prime 8 is not prime 9 is not prime Using java programmingFor 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.
- A company has 5 stores {1, 2, 3, 4, 5}. The sales for each store is as follows: {200, 300, 400, 500, 600}. The tax rate is 6% Write a java program that: Prints the values in the 2-D array consisting of the store numbers and sales. Your print out should also include the sales tax for each company. In essence, you should have three columns: Store Number, Sales and Sales Taxin Java please 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, but this is NOT enforced by the program nor tested) and the player's rating (1 - 9, not enforced like jersey numbers). Store the jersey numbers in one int array and the ratings in another int array. Output these arrays (i.e., output the roster) as shown below after inputting the data. 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 a menu of options for a user to modify the roster. Each…JAVA PROGRAM Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson’s salary is truncated to an integer amount): $200–299 $300–399 $400–499 $500–599 $600–699 $700–799 $800–899 $900–999 $1000 and over Summarize the results in tabular format.
- JAVA PROGRAM Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson’s salary is truncated to an integer amount): $200–299 $300–399 $400–499 $500–599 $600–699 $700–799 $800–899 $900–999 $1000 and over Summarize the results in tabular format. Please Explain Step by Step the logic of this program. THANK YOU AND GODBLESS BARTLEBY EXPERTS !RetailItem Class Write a class named Retailltem that holds data about an item in a retail store. The class should have the following fields: • description. The description field references a String object that holds a brief description of the item. • unitsOnHand. The unitsOnHand field is an int variable that holds the number of units currently in inventory. • price. The price field is a double that holds the item's retail price. Write a constructor that accepts arguments for each field, appropriate mutator methods that store values in these fields, and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three RetailItem objects and stores the following data in them: Description Units on Hand Price Item #1 Jacket 12 59.95 Irem #2 Designer Jeans 34.95 [rem #3 Shirt 24.95Best Houses Company sells houses to their customers and needs a program to facilitate the selling process. Write a JAVA program that asks the user to enter house number (int), house size in square meters (double), and house price (double) and store them in three parallel arrays. The number of houses is 10. Then, the program should ask the user to enter the price range of the required house which is the start price and the last price in the range and should do the following: Print all the information of the houses within that range. Print the number of houses in the specified range.