Question

Question 29 (1 point) What is the value in the variable result? You do not need to put around your answer. String message
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:--------------
Sna udy

public class Main
{
   public static void main(String[] args)
   {
   String message = "Sunday Funday";
   String result = "";
   int n = message.length();
   for(int i=0; i<n; i = i+2)
   {
   char ch = message.charAt(i);
   result = result + ch;
}
       System.out.println(result);
}
}

Output :-
Sna udy

Add a comment
Know the answer?
Add Answer to:
Question 29 (1 point) What is the value in the variable result? You do not need...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please answer both questions. Thanks Question 24 (1 point) What value would be returned if the...

    Please answer both questions. Thanks Question 24 (1 point) What value would be returned if the method mystery were called and passed the array values (1, 15, 37, 12) as its parameter? public static int mystery (int[] list) int x = 0; for (int i = 1; i < list.length; i++) { int y = list[i] - list [0]; if (y > x) x = Y } } return x; 29 35 1 36 Question 25 (1 point) What is...

  • I need help answering a question in JAVA. Also could you explain exactly what is be...

    I need help answering a question in JAVA. Also could you explain exactly what is be asked from this question. I will be including the driver class and one function that needs to be answered. import java.util.Arrays; public class A2Driver {    public static void main(String[] args) {        for(int i = 10; i <= 50; i+=10)        {            System.out.println("N = "+i);            System.out.println("Sum1:"+A2Work.sum1(i));            System.out.println("Sum2:"+A2Work.sum2(i));            System.out.println("Sum3:"+A2Work.sum3(i));   ...

  • Please answer both questions thank you. Question 49 (1 point) What is wrong with the following...

    Please answer both questions thank you. Question 49 (1 point) What is wrong with the following code snippet? for (int i 1; i <= 5; i++) { int squared = i + i; System.out.println(i + IT "! squared = + squared); } System.out.println("Last square = " + squared); calculation error variable scope error O nothing incorrect use of for loop Question 47 (1 point) What are the values of num1 and num2 and result after the execution of mystery (num1,...

  • I'm also having trouble on dividing the code into methods. This is my work done so...

    I'm also having trouble on dividing the code into methods. This is my work done so far and net beans give me a lot of errors. Help! package caesarcipher; import textio.TextIO; /** * * @author */ public class CaesarCipher { enum code {encodeText, decodeText }; /** * @param args the command line arguments */ public static void main(String[] args) {    String code; char x;    int totalcount = 0;    while(true){ TextIO.put("Type in an E to encode a message...

  • Please answer both questions thank you. Question 52 (1 point) What is the output of the...

    Please answer both questions thank you. Question 52 (1 point) What is the output of the code snippet given below? String s = "abcde"; int i = 1; while (i < 5) { System.out.print(s.substring(i, i + 1)); i++; Question 50 (1 point) How many times will the output line be printed in the following code snippet? Please enter your answer as an integer. for (int i = 0; i < 3; i++) { for (int j = 1; j <...

  • Change the factorial method to return a BigInteger. You can leave the parameter value alone (ie,...

    Change the factorial method to return a BigInteger. You can leave the parameter value alone (ie, the parameter will remain an integer). You'll need to modify the method to use BigInteger objects and instance methods. Hint: remember that you can easily form Strings from numerical values by concatenating the numerical value with the empty String "". For Example: String s = 5 + ""; •What happens when you rerun your loop in main? Do you get the correct answers? import...

  • hey dear i just need help with update my code i have the hangman program i...

    hey dear i just need help with update my code i have the hangman program i just want to draw the body of hang man when the player lose every attempt program is going to draw the body of hang man until the player lose all his/her all attempts and hangman be hanged and show in the display you can write the program in java language: this is the code bellow: import java.util.Random; import java.util.Scanner; public class Hangmann { //...

  • textbook question:A method returning an array of letters with their highest point value in any country...

    textbook question:A method returning an array of letters with their highest point value in any country My question: I am trying to make a new method return an array of letters with the highest point value in any country. i have already made one method that finds out if the country has a letter with a value of ten. But I cant figure out how to make one that will print out the letter that is the highest value in...

  • hi I need to understand how the out put become -4 in first question and out...

    hi I need to understand how the out put become -4 in first question and out put 310 for the second question please can you explain to me thanks a lot 1.(ch12. Sc16. P. 820. loop) Consider the following code: import java.util.*; public class MyLoopOneSGTest{    public static void main(String[] args){      int w = 3;      System.out.println(myLoop(w));    }    public static int myLoop(int n){       int x = 1;       for (int i = 1; i < n; i++){          x = x - i;       }...

  • Hello! I have a problem in my code please I need help, I don't know How I can wright precondition, so I need help about assertion of pre_condition of peek. Java OOP Task is! Improve the circular a...

    Hello! I have a problem in my code please I need help, I don't know How I can wright precondition, so I need help about assertion of pre_condition of peek. Java OOP Task is! Improve the circular array implementation of the bounded queue by growing the elements array when the queue is full. Add assertions to check all preconditions of the methods of the bounded queue implementation. My code is! public class MessageQueue{ public MessageQueue(int capacity){ elements = new Message[capacity];...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT