Question

I USE NETBEANS. C++ PLEASE. COULD YOU PLEASE WRITE A CODE THAT ACTUALLY WORKS, PLEASE PLEASE PLEASE EXPLAIN WHAT EVERYTHING IS DOING. INCLUDE SCREENSHOTS OF OUTPUTS PLEASE. I REALLY APPRECIATE THE HELP. THANK YOU <3

100% RATING IF CORRECT AND IS UNDERSTANDABLE. PLEASE ONLY CODES THAT WORK AND DO THE TASK AT HAND.

2 Write code for these functions using the string API: A boolean function no_el1 that takes a string as parameter and returns

Comments
    0 0
    Add a comment Improve this question Transcribed image text
    Answer #1

    //C++ program

    #include <iostream>

    #include <iomanip>

    using namespace std;

    bool no_ell(string s)

    {

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

    {

    if(s[i] == 'l' || s[i] == 'L')

    return false;

    }

    return true;

    }

    string no_ells(string s)

    {

    string result = "";

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

    {

    if(s[i] != 'l' && s[i] != 'L')

    result += s[i];

    }

    return result;

    }

    void noel ( string & s){
       while ( s.find("noel") !=string::npos)
    s.replace(s.find("noel"), 4, "Christmas");
      
    while ( s.find("Noel") !=string::npos)
    s.replace(s.find("Noel"), 4, "Christmas");
    }

    int main() {

    string s = "Noel has a canoeload of ells ";

    if (no_ell(s))

    cout << "No ell" << endl;

    cout << no_ells(s) << endl;

    noel(s);
    cout << s << endl;

    }

    //sample output

    C: Users\IshuManish\Documents noell.exe oe has a canoeoad of es hristnas has a caChristmasoad of el1s 0.0495 seconds with roc

    Add a comment
    Know the answer?
    Add Answer to:
    I USE NETBEANS. C++ PLEASE. COULD YOU PLEASE WRITE A CODE THAT ACTUALLY WORKS, PLEASE PLEASE PLEA...
    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 write code in C++ and include all headers not bits/stdc: 17.10 (Occurrences of a specified...

      Please write code in C++ and include all headers not bits/stdc: 17.10 (Occurrences of a specified character in a string) Write a recursive function that finds the number of occurrences of a specified letter in a string using the following function header. int count(const string& s, char a) For example, count("Welcome", 'e') returns 2. Write a test program that prompts the user to enter a string and a character, and displays the number of occurrences for the character in the...

    • In C++ please! *Do not use any other library functions(like strlen) than the one posted(<cstddef>) in the code below!* /** CS 150 C-Strings Follow the instructions on your handout to complete t...

      In C++ please! *Do not use any other library functions(like strlen) than the one posted(<cstddef>) in the code below!* /** CS 150 C-Strings Follow the instructions on your handout to complete the requested function. You may not use ANY library functions or include any headers, except for <cstddef> for size_t. */ #include <cstddef> // size_t for sizes and indexes ///////////////// WRITE YOUR FUNCTION BELOW THIS LINE /////////////////////// ///////////////// WRITE YOUR FUNCTION ABOVE THIS LINE /////////////////////// // These are OK after...

    • In C++: You are to write two functions, printString() and testString(), which are called from the...

      In C++: You are to write two functions, printString() and testString(), which are called from the main function. printString (string) prints every character in the string to std::cout with a space after every character and a newline at the end. testString (string) returns true if the string contains characters that are in sorted order, false otherwise. You may assume that all characters are lowercase and only alphabetical characters are present. See the main() to see how the two functions are...

    • You are to write two functions, printString() and testString(), which are called from the main function....

      You are to write two functions, printString() and testString(), which are called from the main function. printString (string) prints characters to std::cout with a space after every character and a newline at the end. testString (string) returns true if the string contains two consecutive characters that are the same, false otherwise. See the main() to see how the two functions are called. Some sample runs are given below: string: “hello” printString prints: h e l l o testString returns: true...

    • C++ programming question, please help! Thank you so much in advance!!! In this exercise, you will...

      C++ programming question, please help! Thank you so much in advance!!! In this exercise, you will work with 2 classes to be used in a RPG videogame. The first class is the class Character. The Character class has two string type properties: name and race. The Character class also has the following methods: a constructor Character(string Name, string Race), that will set the values for the name and the race variables set/get functions for the two attributes a function print(),...

    • The code should be written in C++. I included the Class used for this function. Also,...

      The code should be written in C++. I included the Class used for this function. Also, please fix the main function if necessary. Description: This function de-allocates all memory allocated to INV. This will be the last function to be called (automatically by the compiler) //before the program is exited. This function also erased all data in the data file. There are other functions that add, process and alter the file; the file printed after those functions will have new...

    • so i have my c++ code and ive been working on this for hours but i...

      so i have my c++ code and ive been working on this for hours but i cant get it to run im not allowed to use arrays. im not sure how to fix it thank you for the help our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses...

    • Please use my Lab 3.2 code for this assignment Lab 4.2 instruction Using the code from...

      Please use my Lab 3.2 code for this assignment Lab 4.2 instruction Using the code from lab 4.1, add the ability to read from a file. Modify the input function:       * Move the input function out of the Cargo class to just below the end of the Cargo class       * At the bottom of the input function, declare a Cargo object named         temp using the constructor that takes the six parameters.       * Use the Cargo output...

    • using the source code at the bottom of this page, use the following instructions to make...

      using the source code at the bottom of this page, use the following instructions to make the appropriate modifications to the source code. Serendipity Booksellers Software Development Project— Part 7: A Problem-Solving Exercise For this chapter’s assignment, you are to add a series of arrays to the program. For the time being, these arrays will be used to hold the data in the inventory database. The functions that allow the user to add, change, and delete books in the store’s...

    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
    ADVERTISEMENT