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
makvit [3.9K]
4 years ago
10

Write a function "doubleChar(" str) which returns a string where for every character in the original string, there are two chara

cters.

Computers and Technology
1 answer:
Dmitry [639]4 years ago
7 0

Answer:

//Begin class definition

public class DoubleCharTest{

   

   //Begin the main method

    public static void main(String [ ] args){

       //Call the doubleChar method and pass some argument

       System.out.println(doubleChar("There"));

    }

   

    //Method doubleChar

    //Receives the original string as parameter

    //Returns a new string where for every character in

    //the original string, there are two characters

    public static String doubleChar(String str){

        //Initialize the new string to empty string

       String newString = "";

       

        //loop through each character in the original string

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

            //At each cycle, get the character at that cycle

            //and concatenate it with the new string twice

           newString += str.charAt(i) + "" + str.charAt(i);

        }

        //End the for loop

       

        //Return the new string

       return newString;

       

    } //End of the method

   

} // End of class declaration

<h3>Sample Output:</h3>

TThheerree

<h3>Explanation:</h3>

The code above has been written in Java and it contains comments explaining each line of the code. Kindly go through the comments. The actual lines of executable codes have been written in bold-face to differentiate them from comments.

A sample output has also been given.

Snapshots of the program and sample output have also been attached.

You might be interested in
An excel worksheet can have a maximum of ____ columns in a worksheet.
Marina CMI [18]

It can have only 16,384 number of columns

6 0
3 years ago
Write a program that prints the question " Do youwant to continue? " and reads a user input. if the userinput is " Y ", " OK", o
Nataly_w [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

   string in;//string in for taking input...

   cout<<"Do you want to continue ?"<<endl;

   getline(cin,in);//taking input from the user...

   if(in=="y"||in=="Y"||in=="yes"||in=="OK"||in=="Why not?")//conditions..

   cout<<"OK"<<endl;

   else if(in=="No")

   cout<<"terminating"<<endl;

   else

   cout<<"Bad input"<<endl;

return 0;

}

Explanation:

I have taken a string in.

Then taking input from user.

Checking the conditions using if else if ladder.

7 0
3 years ago
The most common size for a brochure is _____.
Juli2301 [7.4K]
3.5X2 cannot be the answer as it too small and not enough information can be put into it. The common size for tri-fold brochures is 8.5X11 or letter size even when 8.5X14 is also a size used it is not the most common size.
6 0
4 years ago
Which of the following is used to keep track of website content?
Alja [10]

Complete Question:

Which of the following is used to keep track of website content?

Group of answer choices.

A. Antivirus software.

B. File management system.

C. Disk management.

D. Control panel.

Answer:

B. File management system.

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations of a web page to be displayed.

When a website has been created, it is important and necessary to manage and monitor the content or resources contained in the web site so as to improve and enhance its performance. In order to achieve this, a file management software or system such as LogicalDoc, Goo-gle drive, DocuWare, Alfresco, etc.

Hence, a file management system which is typically a cloud-based service can be used to keep track of website content.

6 0
3 years ago
The information that a program requires in order to accomplish its objective is called the.
ivolga24 [154]

The information that a program requires in order to accomplish its objective is called input.

<h3>What is a program?</h3>

A program is a set of instructions by which the computer performs various tasks. The program is a sequence of instructions that are followed by the computer to run. An example is Microsoft Word.

A computer program comes under software. The sequence code of a program that is readable by humans is called source code. The program is run by information that is called input.

Thus, the data that a program needs in order to achieve its goal is referred to as input.

To learn more about the program, refer to the below link:

brainly.com/question/14368396

#SPJ4

8 0
2 years ago
Other questions:
  • In a relational database model, a(n) _____ operation pares down a table by eliminating columns according to certain criteria. in
    8·1 answer
  • A laptop computer has two internal signals: An unplugged signal, which is '1' if the laptop's power supply is connected, and '0'
    5·1 answer
  • What is the oldest malware victor
    6·1 answer
  • What daily life problems does the algorithm quicksort solve?
    14·1 answer
  • Computer program allowing the computer to communicate<br> with a hardware device
    13·1 answer
  • Which option can be used to access more settings than are available in the Backstage view?
    5·1 answer
  • Write a function named change() that has an integer parameter and six integers reference parameters named hundreds, fifties, twe
    7·1 answer
  • Which icons allows you to add a style to a chart
    13·1 answer
  • What are some direct access devices
    15·1 answer
  • What is a primary risk to the Workstation Domain, the Local Area Network (LAN) Domain, and the System/Application Domain
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!