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
s2008m [1.1K]
3 years ago
7

IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in

the string parameter is uppercase. Otherwise, the function returns "Bad".
Ex: FilterStr("sandwich") returns

Bad

Recall isupper() checks if the character passed is uppercase. Ex: isupper('A') returns a non-zero value. isupper('a') returns 0.

string's at() returns a character at the specified position in the string. Ex: myString.at(3)
)
#include
#include
#include
using namespace std;

/* Your code goes here */

int main() {
string input;
string output;

getline(cin, input);
output = FilterStr(input);
cout << output << endl;

return 0;
}
Computers and Technology
1 answer:
Ilia_Sergeevich [38]3 years ago
8 0

Answer:

Replace /*Your code goes here */ with

string FilterStr(string str){

   string retStr= "BAD";

   if(isupper(str.at(4)) != 0){

     retStr = "GOOD";

   }

   return retStr;

}

Explanation:

This defines the function

string FilterStr(string str){

This initializes the return string to BAD

   string retStr= "BAD";

This checks if the string at index 4 is uppercase;

   if(isupper(str.at(4)) != 0){

If yes the return string is updated to GOOD

     retStr = "GOOD";

   }

This returns the return string

   return retStr;

}

<em>See attachment for complete program</em>

Download cpp
You might be interested in
Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number fo
mrs_skeptik [129]

The formula used to convert the Fehrenheit to degree Celcius is given as

F = 1.8C + 32

<h3>What is temperature?</h3>

The term used for the measurement of the degree of hotness or coldness of any object is called as temperature.

This represents the temperature of F degrees Fahrenheit converted to degrees Celsius.

Remember that in order to change temperature we need to use the following formula:  from Fahrenheit to Celsius: first, subtract 32, then multiply by 100/180

To know more about temperature follow

brainly.com/question/24746268

#SPJ1

7 0
2 years ago
Sukhi needs to insert a container into her form to collect a particular type of information.
Hunter-Best [27]

Answer:

text box

Explanation:

on edge 2020

6 0
4 years ago
Write a function named "json_filter" that takes a JSON formatted string as a parameter in the format of an array of objects wher
7nadin3 [17]

Answer:

Check the explanation

Explanation:

kindly check the well written code below to get the solution to your question.

import json

def json_filter(input_string):

   jsonFormat = json.loads(input_string)

   result = []

   for obj in jsonFormat:

       if obj["temperature"] > 38.46:

           result.append(obj)

   return json.dumps(result)

7 0
3 years ago
File " ", line 1
lilavasa [31]

Answer:

i = 1

while i < 11:

 print("The Indian High School")

 i += 1

3 0
3 years ago
Messages that have been accessed or viewed in the Reading pane are automatically marked in Outlook and the message subject is no
vivado [14]

Answer:

Mark as Unread

Explanation:

I just know

5 0
3 years ago
Read 2 more answers
Other questions:
  • Using a wireless network without the network owner's permission is known as ________.
    15·1 answer
  • The width of a strand of fiber is 19.2 micrometers. if 1500 strands are adhered side by side, how wide would the resulting fabri
    9·1 answer
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • The Speed of Sound (Java Project. Please make it easy to understand. I'm a beginner at this. I believe we are supposed to use a
    5·1 answer
  • Which of these techniques will contribute to green computing?
    10·1 answer
  • Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shi
    15·1 answer
  • How can you ensure that your web pages are compliant with a w3c standard?
    9·1 answer
  • The term computer ________ is used to describe someone who is familiar enough with computers to understand their capabilities an
    12·1 answer
  • When text is used as a Hyperlink, it is usually underlined and appears as a different color.
    11·1 answer
  • Which step do you think is most useful from big data life cycle and why?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!