1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hoa [83]
3 years ago
7

Language Java

Computers and Technology
1 answer:
galina1969 [7]3 years ago
4 0

import java.util.Scanner;

public class U4_L1_Activity_Three {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Input a word:");

       String word = scan.nextLine();

       int index = 0;

       while (index < word.length()){

           if (index%2 == 0){

               System.out.print(word.substring(index, index+1));

           }

           index+=1;

       }

       System.out.println("");

   }

   

}

I hope this helps!

You might be interested in
how to write a function "void funct()" which will accept a string from the user as input and will then display the string backwa
Mariulka [41]

Answer:

#include <bits/stdc++.h>

using namespace std;

void funct(){

   string name;

   cout<<"enter the string: ";

   cin>>name;

   

    reverse(name.begin(), name.end());

    cout<<"The string is : "<<name<<endl;

   

}

int main()

{

   funct();

 

  return 0;

}

Explanation:

create the function funct() with return type void and declare the variable type string and print a message for asking to used enter the string.  

The string enter by user is store in the variable using cin instruction.

after that, we use a inbuilt function reverse() which takes two argument.

firs argument tell the starting point and second index tell the ending point. then, the reverse function reverse the string.

name.begin() it is a function which return the pointer of first character of string.

name.end()  it is a function which return the pointer of last character of the string.

finally, print the reverse string.

for calling the function, we have to create the main function and then call the function.

5 0
3 years ago
An IT specialist is consulted about setting up a peer-to-peer network. What would the specialist say about security risk in this
ohaa [14]

I just did this, its A

6 0
4 years ago
Read 2 more answers
What the repeal of online privacy protections means for you?
kvv77 [185]
Online Privacy is well, our privacy while on the internet. If they have repealed that, then we have no privacy while on the internet. I feel like now a days there is no privacy at all anywhere. Everywhere you go, there are cameras watching you. So for them to take away online privacy is pretty messed up.
7 0
4 years ago
Brian drives a car that uses voice commands for navigation. Which field did researchers use to develop a car-based AI that under
pickupchik [31]

Answer:

A, Computer Engineering

4 0
4 years ago
Which of these inventions was necessary to permit magnetic recording?
eimsori [14]
It’s C vinyl records permit magnetic fields
4 0
3 years ago
Read 2 more answers
Other questions:
  • A customer service representative for an Internet provider uses various techniques to help a frustrated customer with a slow Int
    13·1 answer
  • The TabIndex value assigned to a text box's identifying label must be _______________ for the text box's access key to work corr
    14·1 answer
  • Belvedere Street is parallel to St. Anthony Street. Davidson Street is perpendicular to River Street. River Street is parallel t
    11·1 answer
  • Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values
    13·1 answer
  • You are an IT technician at your company. The company has two small offices in different cities. The company's head office conta
    5·1 answer
  • Pleas help 99 points and get brainliest
    9·2 answers
  • Find the basic period and basic frequency of the function g(t)=8cos(10πt)+sin(15πt)
    9·1 answer
  • What year did the first hovercraft sail on water
    15·1 answer
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and phone needs. Gr
    8·1 answer
  • Html is a markup language that lets you identify common sections of a web page
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!