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
Which relation is created with the primary key associated with the relationship or associative entity, plus any non-key attribut
konstantin123 [22]

Answer:

- Transform binary or unary M:N relationship or associative entity with its own key.

Explanation:

Transform binary relation is described as the method through which a decimal can easily be converted into binary while the unary relationship is described as a relationship in which both the two participants occurs from the same entity.

In the given case, 'transform binary or unary M:N relationship' can be created using 'the primary key linked with the relationship plus any non-key aspects of the relationship and the primary keys of the related entities' as it displays the existence of a relationship between the occurrences of a similar set of the entity i.e. associative entity here.

5 0
3 years ago
write a simple assembly code using 8088 microprocessor instruction set to add two numbers ? please help me if you know :(​
Kay [80]

Answer:

sexxxxx chaaaaat insta id abhilash0351

3 0
3 years ago
HELP ME PLZZ FFFAAASSSTTTT
Dahasolnce [82]
The answer has to be A because we you get your licensed suspended you are un able to drive for a while Intel you take the test again and or pay a fine
6 0
3 years ago
Read 2 more answers
8.10 Code Practice Question 3
Alchen [17]

terms = ["Bandwidth", "Hierarchy", "IPv6", "Software", "Firewall", "Cybersecurity", "Lists", "Program", "Logic",

        "Reliability"]

def swap(arr, in1, in2):

   w = arr[in1]

   arr[in1] = arr[in2]

   arr[in2] = w

print(terms)

swap(terms, 5, 1)

swap(terms, 2, 4)

swap(terms, 3, 5)

swap(terms, 5, 6)

swap(terms, 6, 8)

swap(terms, 8, 9)

print(terms)

This is how I interpreted the question. If I need to make any changes, I'll do my best. Hope this helps though.

4 0
3 years ago
Rest or take a break every __ minutes when typing. Please help!
Talja [164]
Maybe like 3-5 I think im right
3 0
3 years ago
Read 2 more answers
Other questions:
  • What is the function of the capsid? it allows a virus to live independently. it is composed of genetic material. it destroys the
    12·2 answers
  • Which of the following is NOT true about RMI? RMI uses the socket connection, including opening and closing the socket. RMI allo
    8·1 answer
  • What is the difference between an internal and an external method call? In what situation would only internal calls be needed?
    11·1 answer
  • My speaker on my phone is not working, when I try and play music and videos the sound dosen't work. However my alarm works. Can
    9·2 answers
  • In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
    13·1 answer
  • What is the result of executing the following code? You can assume the code compiles and runs. #include using namespace std; voi
    6·1 answer
  • What happens when a dataset includes records with missing data?
    9·1 answer
  • What is a fire wall and how does it work
    6·1 answer
  • What is the value of six sigma ? How dose it relate to agile management
    11·1 answer
  • A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!