

Java, please. Work based on the code above.
Code:
import java.util.Scanner;
public class Question1
{
static String oddOneOut(String s)
{
String evens = ""; //to store every
even index character.
for(int i=0; i<s.length(); i++)
//reading each character in string.
{
if(i%2==0) //if
index is even
evens = evens+s.charAt(i); //adding to
evens
}
return evens; //returning string
containing evey even index characters.
}
public static void main(String[] args)
{
//creating a scanner, reading
input
Scanner in = new
Scanner(System.in);
String s = in.nextLine();
//calling the oddOneOut()
method
System.out.println(oddOneOut(s));
}
}

Outputs:


Note: my friend if you have any questions or queries comment below. I am happy to answer your all questions. I will sort out your queries. Thank you my friend.
Java, please. Work based on the code above. DESCRIPTION: The purpose of this question is offload...
DESCRIPTION: The purpose of this question is offload processing from the main method to a static helper method. You will be given the main method. Do not alter this code. Your goal is to write a new method called oddOneOut, which will accept a String, and print it in out every other letter. For example, if the String was "abcdefghijk", the oddOneOut method will return "acegik" . METHOD INPUT: A string METHOD PROCESSING: Do not alter the main method. Complete the...
DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an unknown number of cells filled with data. As before, the array will already be filled with strings, some of which contain the string "Angela". You will create a method called countItUp which returns and integer array containing the number of times each of the letters in my name occur within the strings within this array. For example, if the input array was wordFun =...
DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an unknown number of cells filled with data. As before, the array will already be filled with strings, some of which contain the string "Angela". You will create a method called countItUp which returns and integer array containing the number of times each of the letters in my name occur within the strings within this array. For example, if the input array was wordFun =...
Java : Please help me correct my code: create a single class (Program11.java) with a main method and some auxiliary methods to input a 2-D array from a disk file, input some “transactions” to change the 2-D array and output the changed 2-D array to another file. Your main method will be minimal (see below). Most of the work will go on in your methods. In main, declare (but do not instantiate) 2-D array. Then call the three methods. The...
I need help with my Java code. A user enters a sentence and the program will tell you what words were duplicated and how many times. If the same word is in the sentence twice, but one is capitalized, it will not count it as a duplicate. How can I make the program read the same word as the same word, even if one is capitalized and the other is not? For example, "the" and "The" should be counted as...
in Java and with a code please!
num Presses = 2, print: Press the q key 2 times to quit. 1 import java.util.Scanner; 3 public class Quit Screen public static void main(String[] args) { Scanner senr - new Scanner(System.in); char letter ToQuit; int numPresses; letterToQuit - scnr.next().charAt(); numPresses - scnr.nextInt(); /* Your solution goes here */ 12 13 14 15 ) )
Below is the code from LE 6.2 that LE 7.1 is referring to.
import java.util.Scanner;
public class lastNameLE62 {
private static Scanner in = new Scanner(System.in);
private static int size;
public static void arraySize() {
System.out.printf("How many sports are you interested in? ");
size = Integer.parseInt(in.nextLine());
}
public static String[] setFavoriteSports() {
String []favSports = new String[size];
for(int i=1; i<=size; i++) {
System.out.printf("Enter sport #%d: ", i);
favSports[i-1] = in.nextLine();
}
return favSports;
}
public static String[] setFavoriteTeams(String[] sports) {...
Given java code is below, please use it!
import java.util.Scanner;
public class LA2a {
/**
* Number of digits in a valid value sequence
*/
public static final int SEQ_DIGITS = 10;
/**
* Error for an invalid sequence
* (not correct number of characters
* or not made only of digits)
*/
public static final String ERR_SEQ = "Invalid
sequence";
/**
* Error for...
DESCRIPTION: You will be given a 2-D string array, called matrix. The array has an unknown number of cells filled with data. Your goal is to iterate through the 2-D array and keep a count of how many cells contain the string "Angela". INPUT: All input has been handled for you: A filled 2-D string array. PROCESSING: Determine the number of rows in the array matrix Determine the number of columns in the array matrix Use nested loops to iterate...
IT Java code In Lab 8, we are going to re-write Lab 3 and add code to validate user input. The Body Mass Index (BMI) is a calculation used to categorize whether a person’s weight is at a healthy level for a given height. The formula is as follows: bmi = kilograms / (meters2) where kilograms = person’s weight in kilograms, meters = person’s height in meters BMI is then categorized as follows: Classification BMI Range Underweight Less...