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
Kaylis [27]
1 year ago
4

Write a code segment to change the name of the Thing object, something, such that the new name consists of the old name with one

character removed at random. For example, if something has name "ABCD", its new name could be set to "ACD". Write the code segment below. Can you help me by writing it in java?
Computers and Technology
1 answer:
ryzh [129]1 year ago
7 0

A code segment to change the name of the Thing object, something, such that the new name consists of the old name with one character removed at random is given below:

<h3>The Code Segment</h3>

// C++ program to check whether two strings are anagrams

// of each other

#include <bits/stdc++.h>

using namespace std;

/* function to check whether two strings are anagram of

each other */

bool areAnagram(string str1, string str2)

{

// Get lengths of both strings

int n1 = str1.length();

int n2 = str2.length();

// If length of both strings is not same, then they

// cannot be anagram

if (n1 != n2)

 return false;

// Sort both the strings

sort(str1.begin(), str1.end());

sort(str2.begin(), str2.end());

// Compare sorted strings

for (int i = 0; i < n1; i++)

 if (str1[i] != str2[i])

  return false;

return true;

}

// Driver code

int main()

{

string str1 = "gram";

string str2 = "arm";

// Function Call

if (areAnagram(str1, str2))

 cout << "The two strings are anagram of each other";

else

 cout << "The two strings are not anagram of each "

   "other";

return 0;

}

Read more about programming here:

brainly.com/question/23275071

#SPJ1

You might be interested in
What is the missing If condition in the following code fragment? The program is supposed to halt if the input file does not exis
nikklg [1K]

Answer:

The missing part is

if ( !inFile )

Explanation:

The full codes are as follows:

  1.    ifstream inFile;
  2.    inFile.open("myfile.dat");
  3.    if ( !inFile )
  4.    {
  5.        cout << "Cannot open input file." << endl;
  6.        return 1;
  7.    }
  8.    return 0;

Given that inFile is an ifstream object. When inFile is used to open "myfile.data", there will be possibility where myfile.dat is not available. If so, !inFile will be interpolated as true in the if condition and generate the message "Cannot open input file". This is one very simple way to check if the file exist when we try to read it from our program.

8 0
4 years ago
How do i get my laptop to connect to wifi?​
Rina8888 [55]

Answer:

open your laptop go to the wifi or service icon. Look for your wifi and put in the password

4 0
3 years ago
Read 2 more answers
The front surface of the CCD is called the _________
Bogdan [553]
Fiber optics. Hope this helps


5 0
4 years ago
Which of the following is NOT a team based technique? 1. Joint application development 2. Rapid application development 3. Agile
Aleonysh [2.5K]

Answer: Option (4) is correct.

Explanation:

Object-oriented analysis is referred to as an approach in technical world which is popular for analyzing and also designing an app, system, or organization by applying OOPs or object-oriented programming, also making use of visual modeling in order to cater better stakeholder communication and commodity quality.

7 0
3 years ago
Why is the Physical Link at Layer 1 of the OSI?
nata0808 [166]
Data is checked to make sure it is complete

<span>Layer 1, provides physical connections for transmission and performs the electrical encoding of data. This layer transforms bits to electrical signals.
The lowest, or first, layer of the OSI model. Protocols in the physical layer generate and detect signals so as to transmit and receive data over a network medium. These protocols also set the data transmission rate and monitor data error rates, but do not provide error correction.</span>


3 0
4 years ago
Other questions:
  • Marie can now edit her photos, send them in emails, print them on a printer, and use them as wallpaper on her computer. This is
    9·2 answers
  • What were the first microblogs known as
    12·2 answers
  • What are some programs that you have used that have condition-controlled loops and count-controlled loops?
    10·1 answer
  • How long would it take a 8 bit computer to calculate π to the thousandth place?
    8·1 answer
  • Describe an algorithm that, given n integers in range 0 to k, preprocesses its input and then answers any query about how many o
    15·1 answer
  • 50 POINTS<br><br>Question linked in file below.
    5·1 answer
  • First person to answer gets free brainlist
    15·2 answers
  • Which Windows feature allows secure printing over the Internet?​
    11·1 answer
  • The advancement of technology in our daily lives has changed how we interact with the world.
    10·1 answer
  • Clickstream tracking tools collect data on customer activities at web sites (true/false)?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!