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
IRQ 0 interrupt have _______________ priority<br> ? low<br> ? medium<br> ? highest<br> ? lowest
tekilochka [14]

Answer:

Highest

Explanation:

A interrupt request / IRQ is in which instructions are sent to Cpu and uses an interrupt handler to run distinct program . Hardware interrupts are used to manage occurrences such as obtaining modem or network card information, important presses, or mouse motions.

  • Interrupt request 0. – it is a system timer (can not be altered)
  • Interrupt request 1 – keyboard controller (can not be changed)
  • Interrupt request 2 – cascaded IRQ 8–15 signals (any device configured to use IRQ 2 will genuinely use IRQ 9)
  • Interrupt request 3 – serial port 2 controller
  • Interrupt request 4 –  serial port 1 controller
  • Interrupt request 5 –parallel port 2 and 3
  •  Interrupt request 6 - floppy disk controller
  •  Interrupt request 7 –parallel port 1. If a printer is not present, it is used for printers or for any parallel port. It can also possibly be shared with a secondary sound card with cautious port management.

As interrupt number increases priority level decreases, Priority level 0 is the highest priority level .

4 0
3 years ago
One random part of Chess is whether the white side or the black side moves first? A. True B. False
ohaa [14]
The correct answer is B. false.
Determining which color goes first is not random at all - it is a rule in chess that the White player will always start the game first, and will then be followed by the Black player. 
5 0
3 years ago
Read 2 more answers
A cathedral hull allows the boat to do what
Hoochie [10]
It allows power boats to have stability while cruising. The cathedral hull  is like a trimaran in terehat it has one main  and two side hulls stuck together so that has a somewhat square to rectangular shape and therefore exhibits greater stability than a single hulled boat. It became more popular with the advent of fibreglass boats in the 1960's and '70s.
5 0
3 years ago
Use the drop down menus to describe how adman can add shapes to his presentation
alina1380 [7]

Answer:

✔ Illustrations

✔ a crosshair

✔ left-click and drag

Explanation:

6 0
3 years ago
Why do designers use tonal shading?
Simora [160]

Designers use tonal shading because tonal shading gives a drawling dimension.


Hopefully this will help you out! :)

4 0
2 years ago
Read 2 more answers
Other questions:
  • Clicking the _____ box completes an entry. cancel formula enter tab
    15·1 answer
  • Which features would work well for text entered into cells? Check all that apply.
    5·2 answers
  • You need to access the registry on your windows 10 computer how do you do this
    9·1 answer
  • write a program that reads in the length and the width of a rectangular yard . your program should compute the time required ( i
    5·1 answer
  • Molly, an end-user, connects an external monitor, external keyboard and mouse, and a wired network cable to her laptop while wor
    5·2 answers
  • Consider a Games Expo for Children. Six competitions are laid out for the expo. Tickets are sold according to the age and gender
    11·1 answer
  • Create the tables and appropriate constraints based on the following ER diagram. Use appropriate data types. Note that the size
    7·1 answer
  • #Write a function called hide_and_seek. The function should #have no parameters and return no value; instead, when #called, it s
    7·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • Which of these statements correctly describe aspects of testing code? Check all of the boxes that apply.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!