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
igomit [66]
3 years ago
7

JAVA

Computers and Technology
1 answer:
butalik [34]3 years ago
5 0

Answer:

import java.util.*;

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

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

       String userinput = input.nextLine();

       for(int i =0;i<userinput.length();i+=2) {

           System.out.print(userinput.charAt(i));

       }

   }

}

Explanation:

This line prompts user for input

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

This declares a string variable named userinput and also gets input from the user

       String userinput = input.nextLine();

The following iterates through every other character of userinput from the first using iteration variable i and i is incremented by 2

       for(int i =0;i<userinput.length();i+=2) {

This prints characters at i-th position

           System.out.print(userinput.charAt(i));

You might be interested in
To define constructors and member functions outside of a class's original scope, the operator can be used.
Artyom0805 [142]

Answer: Scope resolution operator(::)

Explanation: A member function and the constructor can be called within the function easily but for the execution of the these components outside the class , a special operator is required to call the functions. The scope resolution operator(::) preceding with the name of class is thus used for defining of the function outside class.This operator maintains the cope of the function and constructor outside the class.

8 0
3 years ago
A print server uses a print ________ as a software holding area for jobs waiting to be printed.
vichka [17]

Answer:

spooler

Explanation:

A print server uses a print spooler as a software holding area for jobs waiting to be printed.

8 0
2 years ago
Read 2 more answers
What are the steps to configure user information in a document?
chubhunter [2.5K]

Answer:

file, properties, options, general

Explanation:

4 0
3 years ago
Read 2 more answers
Page _____ refers to whether a page is laid out vertically or horizontally.
Nostrana [21]
Page orientation is the answer and can you please help me with my java questions
8 0
3 years ago
The cost of an items is Rs 200. what will be the cost of 50 such items. write a simple program​
alexandr402 [8]

Answer:

In Python:

Unit_Cost = 200

Cost50 = 50 * Unit_Cost

print("Cost of 50 items: Rs."+str(Cost50))

Explanation:

This initializes the unit cost to 200

Unit_Cost = 200

This calculates the cost of 50 of such items

Cost50 = 50 * Unit_Cost

This prints the calculated cost

print("Cost of 50 items: Rs."+str(Cost50))

4 0
2 years ago
Other questions:
  • Which of the following is a key component to your individual internet safety? government regulations
    13·1 answer
  • Which are the best examples of costs that should be considered when creating a project budget?
    11·1 answer
  • How can a user view the options for Junk E-mail?
    11·2 answers
  • How do you do these two questions? The first might have multiple answers and the second will have only one answer.
    14·1 answer
  • Presses the Schedulr app icon Selects the list item for CSCI 448 Presses the "View Classroom on Map" button While only performin
    11·1 answer
  • Write a WHILE loop that lets the user enter a number.
    14·1 answer
  • What critical-thinking tool is being used when asking the question, Is this information specific enough?
    9·1 answer
  • Which two components are configured via software in order for a PC to participate in a network environment
    5·1 answer
  • What is the name of the User-defined function that is mentioned in the code?
    6·1 answer
  • You have been trying all day to check your direct messages on social media. The site is really slow to load and sometimes you ca
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!