I need help finding out what to put in the: encryptedArray[index] = encrypt(messageArray);//pass something to encrypt from the array System.out.print(messageArray);//print encrypted version
Q: This code prints 'in_' incrementing by one, once it reaches the size, it resets to increment by one…
A: The solution to the given problem is below.
Q: Write a method called wordLengths that accepts a Scanner for an input file as its parameter. Your…
A: Please find the answer below :
Q: Write a method countNegatives that uses stream operations to count how many numbers in a given array…
A: PROGRAM CODE: import java.util.Arrays;import java.util.function.IntPredicate; public class Main {…
Q: How do I import a image file, for example a flower.png with the image of a sunflower, to a java…
A: How do I import a image file, for example a flower.png with the image of a sunflower, to a java…
Q: ONLY IN JAVA PLS Make as simple as possible Modify the attached program to read in the contents of…
A: Below is the complete solution for the given question in detail with sample Program and Output…
Q: implementation of the Caesar cipher (Section 5.3 in the textbook), which we discussed in class.…
A: Java code for Caesar Cipher import java.util.Scanner; public class CaesarCipher{ public static…
Q: Given a HashMap pre-filled with student names as keys and grades as values, complete main() by…
A: Here we have given complete code for the asked program. you can find the solution in step 2.
Q: In Java Write a method called swaplntArrayEnds that is passed the address of an array and swaps the…
A: Writing the java program below
Q: Write a FileIo02 class witha method named writeArrayTOFile () that takes an array of strings and a…
A: File Name is same as Public class to get the compile.
Q: The code is almost done but I still need to figure out how can I delete en element in Addressbook…
A: deleting any element in an array A simple program to delete 2nd position value of array (2 means…
Q: After modify the following code please split which part will be main.java file and which part will…
A: import java.util.*; // Modify the given programs by adding two methods in HashTableClass: Show Full…
Q: an ArrayList of ArrayLists
A: Given :- An ArrayList of ArrayLists is given in the above mention question and each inner ArrayList…
Q: If you wanted to find if a particular number was present in an array of one million integers, which…
A: Given: If you wanted to find if a particular number was present in an array of one million integers,…
Q: Write a program that replaces all occurrences of a word with anew word in all the files under a…
A: Program: //include the required header files import java.io.*; import java.util.Scanner;…
Q: Write a method called oddSum which will return the sum of all values stored in the odd indices of a…
A: We will call the method oddSum from the main method. We will use an array that is already…
Q: (a) What will be the output of the following method calls? Set s = new HashSet(); s.add("hello");…
A: This is java program where we have used the hashset to add the values to hast set and compare both…
Q: xes in both strings that contain vowels [a, e, i, o, u, y, A, E, I, O, U, Y] and should output the…
A: The content is not clear let us consider with our own example //Source code in java import…
Q: Write a Python program to print a hollow square pattern of stars (") with a hash (#) symbol at the…
A: #this loop will run until user enter valid inputwhile(True): #ask user to enter data…
Q: Write a task that returns the top 3 very long words in a newspaper article as well convert them into…
A: Algorithm: Firstly we call the function that will holds the value of string then the function runs…
Q: Consider the following array: [curabdm]. What is the array, after calling the buildHeap method ? O…
A: Introduction: Here we are required to explain what will be the output array after calling the build…
Q: Need help writing the following method: getWaitlistedStudents() – returns an array of Students in…
A: From the sample code given, it can be seen that waitlist is a linked list of type students. To…
Q: Write a program to produce the first 100 Fibonacci numbers. A Fibonacci number is one that is the…
A: Here I have first of all taken a for loop to iterate for the next 100 times. Inside the loop, first…
Q: Write a static method named "compareLines" that accepts one parameter (a Scanner attached to an…
A: The required Java code is: import java.util.*;import java.io.*;public class MatchIndex{ public…
Q: How do I SUM a list of float? as the output of the previous script, I have this…
A: As you have mention that list of many floats, all in separate rows. so it better to pass this list…
Q: How many objects are ready to be garbage-collected after executing the following code? Rectangu nip…
A: garbage means unreferenced objects. Garbage Collection is process of reclaiming the runtime unused…
Q: You are given two arrays. The objects in arr1 formed a party and began to come together. However,…
A: Providing the Solution in Java ScriptCode function missing(arr1, arr2){ const count = (arr,n)=>{…
Q: How many hashes ( # ) will the following snippet send to the console? var = while var < 10: print…
A: var = 1 while var < 10: print("#") var = var << 1 The code snippet prints 4 hashes (#)…
Q: Write a bash program wizard.sh to generate a random wizard name from the given list of first and…
A: Bash program to generate a random wizard name from the given list: first=(Uzohr Ozor Adixon Zeshan…
Q: create a public static method named manipulateString that asks the user for a sentence using the…
A: Iterate over the array of words and then we have to update the case on original array and then we…
Q: write a method called swap2end. given any strong length, return a new string where the last 2 chars,…
A: 1.Start 2.Take input from user as string 3.Pass that string to method swap2end(). 4.Store the result…
Q: In JAVA, write a program in a single file that: Main: Creates 10 random doubles, all between 1 and…
A: Programming instructions: In the main method, create an array of size 10, and then store 10 random…
Q: HELP WITH EXAMPLES OF THE METHODS, IN THE TODO package integerarraylist; import static…
A: ANSWER: Empty Custom Integer ArrayList: Output:
Q: Given the following Java functions, transcribe it into a Python 3 program. /** * Rehashes the…
A: Python3 Source Code: def resize(self, newCapacity): oldTable = table oldCapacity =…
Q: I made this code and it works but I get one error, it doesn't give the exact output I need. I get…
A: problem is this line res = res + "{:2d}".format(self.list1[i][j]) + " " here you are adding "…
Q: Write a program to produce the first 100 Fibonacci numbers. A Fibonacci number is one that is the…
A: Program Approach: Include the necessary header files for standard I/O. Declare a main function().…
Q: Write a python class/method that will: 1. Load a npy file into ndarray, assert that the loaded array…
A: Question:
Q: I am trying to read a CSV file and then store it into an ArrayList. For each row, I'm trying to…
A: As we know that all the classes in java inherit the Object class, and also there are some methods of…
Q: my problem is I want to add tho the method an error message in case the user inter a wrong ID
A: public static void main(String args[]) { //adding try block where error can occur try() {…
Q: create a script that prompts the user for a number. then create a loop to generate that number of…
A: According to the information given:- we have to create script in powershell to prompt user to enter…
Q: public static CS150 getInstance(){ //TODO implement a single return null; }
A: public static CS150 getInstance(){ return (new CS150()); }
Q: Assume you have a folders of (images and videos) in your computer which contain some random mix…
A: Actually, program is a executable software that runs on a computer.
Q: Given the following Java functions, transcribe it into a Python 3 program. /** * Add a new entry…
A: ''' * Add a new entry with the specified key, value and hash code to * the specified bucket. It is…
Q: Please help me code in java: Write a program that reads two files “Data1.txt”, “Data2.txt”; adding…
A: Let's say you have a file, data.txt, which contains the following ASCII text: apples oranges pears…
Q: write a batch file which make a backup for this file. if we take that table for exempel The…
A: Generate a backup file with timestamp in an automated fashion
Q: ng For this exercise, we will be working with a text file that holds students' course averages. Each…
A: Dear Student, the code walkthrough has been marked as comments Dim jagNumber As String Dim //…
Q: (a) What will be the output of the following method calls? Set s = new HashSet(); s.add ("hello");…
A: The Java.util.HashSet.contains() method is used to check whether a specific element is present in…
I need help finding out what to put in the:
encryptedArray[index] = encrypt(messageArray);//pass something to encrypt from the array
System.out.print(messageArray);//print encrypted version
portion of the coding as well as how to call the "encryptAll" method
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Please help me with my homework on my Java coding on line 84 for public static void main(String[] args)} I am sending you my coding in Java and I can't seem to pull up the dialog box for it. import javax.swing.JOptionPane;public class Quiz {/*** the function isValid accepts a string and checks to see if it is A,B,C,D* and returns a boolean value of true or false if it matches*/private static boolean isValid(Sting a){a=a.toLowerCase();if(a.equals("a")||a.equals("b")||a.equals("c")||a.equals("d")){return true;}else{JOptionPane.showMessageDialog(null,"Please pick A,B,C,D");return false;}}/*** askQuestion function receives an array containing the question and all the * answers. The function return the user input as a String */private static String askQuestion(String[]q){String fmtQuestion ="";//String to hold the formatted questionString answer = ""; for (int i = 0; i <q.length;i++)fmtQuestion+=q[i]+"\n"; do{answer=JOptionPane.showInputDialog(null,fmtQuestion);if(answer==null){int…Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Your program must contain at least the following functions: A function to read the students’ data into the array. A function to assign the relevant grade to each student. A function to find the highest test score. A function to print the names of the students having the highest test score. Your program must output each student’s name in this form: last name followed by a comma, followed by a…Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and 100), and grade of type char. Suppose that the class has 20 students. Use an array of 20 components of type studentType. Your program must contain at least the following functions: A function to read the students’ data into the array. A function to assign the relevant grade to each student. A function to find the highest test score. A function to print the names of the students having the highest test score. Your program must output each student’s name in this form: last name followed by a comma, followed by a…
- Write a Java program correctly that generates a report of proof of vaccination against COVID-19 for the peoplewho received their dose of vaccination. Write a program which:1. Display a welcome message.2. Then prompts the user to enter the following:• First name, with first letter uppercase, which is then stores in a variable of type String.• Last name, with first letter uppercase which is then stores in a variable of type String.• Day of birth, set as a number between 1 and 31, which is then stores in a variable of typeint.• Month of birth, set as a number between 1 and 12, which is then stores in a variable of typeint.• Year of birth, set as a number between 1920 and 2006, which is then stores in a variable oftype int.• Day of vaccination, set as a number between 1 and 31, which is then stores in a variable oftype int.• Month of vaccination. set as a number between 1 and 12, which is then stores in a variableof type int.• Year of vaccination, set as a number between 2020 and 2021,…IN JAVA Write a function that takes in user input as a string. For all characters which are numeric, double its value and, if it is two digits, then replace it with the sum of its digits (e.g., 6 → 12 → 3 whereas 3 → 6). For all characters which are in uppercase, replace it with lowercase. For all characters which are in lowercase, replace it with uppercase (e.g., m → M and N → n). The program should keep asking the user to enter strings until they either enter ‘q’ or ‘Q’.In java: Develop a void function that takes two parameters, an integer and a string. The function should print the string as many times as given by the integer. For example, with arguments 4 and “Hello” the function would print “Hello” four times. Call the function twice with different arguments. What happens when the argument is negative?
- Please explain Common String Mistake in the code below/question in Bold: public class StringMistakeDemo{public static void main(String[] args) {String a = "Roux";String b = "Roux";String c = new String("Roux"); /** Number 1* Consider the output from the this block of code. * Which line causes the "false"?* Why are the last two lines different?*/System.out.println();System.out.println("Roux" == "Roux"); //comparing two stringsSystem.out.println(a == b); //comparing two string variablesSystem.out.println(a == c); //comparing two other string variablesSystem.out.println(a.equals(c));//using the string class method "equals"/** Number 2* "identityHashCode" provides a numeric signature that includes the * memory location for the variable. * What does the following output tell you about how Java stores…IN Java: Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the substring() method to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3-1-1990. Ex: If the input is: March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1 then the output is: 3-1-1990 12-13-2003 Use the provided getMonthAsInt() method to convert a month string to an integer. If the month string is valid, an integer in the range 1 to 12 inclusive is returned, otherwise 0 is returned. Ex: getMonthAsInt("February") returns 2 and getMonthAsInt("7/15/20") returns 0. provided code: import java.util.Scanner; public class DateParser { public static int getMonthAsInt(String monthString) { int monthInt; // Java switch/case statement switch…basic java please Write a method starTheString that accepts a string of any size/length and a number. It should then return a new string that is two copies of the string with a set of stars between them equal to the number. For example, the call of starTheString("Hello", 5) o would return "*****Hello*****" 5 stars - Hello - 5 Stars starTheString ("Goodbye", 3) o would return "***Goodbye***" 3 stars – Goodbye - 3 Stars
- Write a program that prompts the user to enter adecimal number and displays the number in a fraction. (Hint: read the decimalnumber as a string, extract the integer part and fractional part from the string,and use the BigInteger implementation of the Rational class in Programming to obtain a rational number for the decimal number.) Here are somesample runs: Enter a decimal number: 3.25 ↵EnterThe fraction number is 13/4 Enter a decimal number: –0.45452 ↵EnterThe fraction number is –11363/25000In Java, Write an application that reads a line of text, tokenizes the line using space characters as delimiters and outputs only those words beginning with the letter "b". JavaWrite the following programs in Java: In the Converter class write the static method, bin2decimal(String bin). The parameter for this method is an unsigned (nonnegative) binary number represented by a string. The method returns the decimal equivalent for the binary parameter, as an integer.If the binary string is invalid (contains characters other than ‘0’ and ‘1’), the method returns -1. Convert from a binary (b) string with up to 16 digits to decimal (d) using the following formula:? = ?0 + ?1 × 2 + ?2 × 22 +⋯+ ?7 × 215where b0, b1, ?2, … ?7 are the binary digits in order of increasing significance. For example, 1101 is: 1 + 0×2 + 1×22 + 1×23 = 13 in decimal. Side note: You may NOT use the decode method of the Long wrapper class instead of this formula. In the Converter class write another static method, english2encrypted(String english). The parameter for this method is a word or sentence represented by a string. The word or sentence should only contain letters (no digits,…