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 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".Make a JAVA PROGRAM that asks the user to enter an ACCOUNT NUMBER and PIN. (All account numbers and pins must be in the array list and 6 digits only) If the user enters a correct account number and pin (it must be in the list of array) then print WELCOME TO OUR BANK. or if the user enters a wrong account number and pin (not in the list of array) then ask again the user to enter the account number and pin.For beginning 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."
- IN JAVA Given an array, write a program to print the array elements one by one in a new line. If the array element is divisible by 4, print Four. If it is divisible by 6, print Six. If it is divisible by both 4 and 6, print Four Six. Use the following input array Int[] input_array = {2, 5, 10, 8, 18, 24, 3, 48, 30, 9, 12} Output should be 2 5 10 Four Six Four Six 3 Four Six Six 9 Four SixWrite a Java program (BasicStatistics.java) that prompts the user to enter 10 numbers as double values, computes the mean and standard deviation of those numbers, and prints the result. To earn full credit for this problem, you must use an array and separate methods for computing mean and standard deviation. Here is a sample run of a correct program (user input indicated by orange text):Enter 10 numbers: 1.9 2.5 3.7 2 1 6 3 4 5 2The mean is 3.11The standard deviation is 1.55738Write a program in Java that reads integers, one per line, and displays their sum. Also, display all the numbers read, each with an annotation giving its percentage contribution to the sum. Use a method that takes the entire array as one argument and returns the sum of the numbers in the array. (Hint: Ask the user for the number of integers to be entered, create an array of that length, and then fill the array with the integers read.
- Write a java program that stores these integers 10, 20, 30, 40, 20 in an array named nums. Write the code to count all the occurrences of 20 and then display the count. Add the code to create a new integer array that has twice the number of elements as nums and assign the values in nums to the new array. Display the new array. Try to think of a way for the program to calculate twice the number of elements for the new array.Write a program that declares an array of 15 integers and reads the values from the user. Make sure that the user doesn’t enter a value greater than 10 (if the user enters a value not in the allowed range, discard that value and read another to put into the array). Now tell the number that occur maximum number of times in the array. For example for the following 7 has maximum occurrence. 4,7,3,3,2,7,1,5,7,9,9,9,7,8,10 Use both linear and binary search.Create a java program that reads elements (randomly from 0 – 9) of a 2-dimensional array (5x5) using the Random Class then perform the following: 1) Output the array elements 2) Output the sum of each row. 3) Output the sum of each column. 4) Output the sum of all the elements. 5) Output the sum of prime numbers in the array 6) Output the sum of the elements in the main diagonal. 7) Output the sum of the elements below the diagonal. 8) Output the sum of the elements above diagonal. 9) Output the sum of odd numbers below the diagonal. 10) Output the sum of even numbers above the diagonal
- write a java program: You have been given two random integer arrays as arr1 and arr2 of size n and m respectively. Boththe arrays contain numbers from 0 to 9 (i.e. single digit integer is present at every index). The ideahere is to represent each array as an integer in itself of digits n and m.You need to find the sum of both the input arrays treating them as two integers and put the result inanother array i.e. output array will also contain only single digit at every index.Input Format:Line 1: Size of first arrayLine 2: Elements of first arrayLine 3: Size of second arrayLine 4: Elements of second arrayOutput Format:The resultant arraySample Input 1:36 2 437 5 6Sample Output 1:1 3 8 0Sample Input 2:49 7 6 134 5 9Sample Output 2:1 0 2 2 0In Java, create a program that gets user input to create an array of books. The length of the array should be determined by how many books the user enters. You may ask the user how many books they will enter. After all books have been entered by the user, invoke a method to display the contents of the array in a table. Each book will have a title, author, cover, pages, copyright (year), read time (float).Write a program that prompts the user for an integer, then asks user to enter that many integer value. Store these values in an integer array and print the array. Reverse the array elements so that first element become the last element, the second element become the second to last element, and so on, with the old last element now first. Do not just reverse the order in which they are printed; actually, change the way they are stored in the array. Try not to create a second array; just rearrange the elements within the array you have. (Hints; Swap elements that need to change place.) When the elements have been reversed, Print the array again.