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
erica [24]
4 years ago
5

Assign a pointer to any instance of searchChar in personName to searchResult.#include #include using namespace std;int main() {c

har personName[100];char searchChar;char* searchResult = nullptr;cin.getline(personName, 100);cin >> searchChar;/* Your solution goes here */if (searchResult != nullptr) {cout << "Character found." << endl;}else {cout << "Character not found." << endl;}return 0;}

Computers and Technology
1 answer:
Firlakuza [10]4 years ago
8 0

Answer:

Here it the solution statement:

searchResult = strchr(personName, searchChar);

This statement uses strchr function which is used to find the occurrence of a character (searchChar) in a string (personName). The result is assigned to searchResult.

Headerfile cstring is included in order to use this method.

Explanation:

Here is the complete program

#include<iostream> //to use input output functions

#include <cstring> //to use strchr function

using namespace std; //to access objects like cin cout

int main() { // start of main() function body

   char personName[100]; //char type array that holds person name

   char searchChar; //stores character to be searched in personName

   char* searchResult = nullptr; // pointer. This statement is same as searchResult  = NULL  

   cin.getline(personName, 100); //reads the input string i.e. person name

   cin >> searchChar;    // reads the value of searchChar which is the character to be searched in personNa,e

   /* Your solution goes here */

   searchResult = strchr(personName, searchChar); //find the first occurrence of a searchChar in personName

   if (searchResult != nullptr) //if searchResult is not equal to nullptr

   {cout << "Character found." << endl;} //displays character found

   else //if searchResult is equal to null

   {cout << "Character not found." << endl;} // displays Character not found

   return 0;}

For example the user enters the following string as personName

Albert Johnson

and user enters the searchChar as:

J

Then the strchr() searches the first occurrence of J in AlbertJohnson.

The above program gives the following output:

Character found.

You might be interested in
Where are options to add a border around the outside of a chart found?
enyata [817]

Answer:

Format tab in the Shape Styles group

Explanation:

The border can be added around the chart which could be of various types including dashed, dotted or plane line.

The border can be added around the chart by moving the cursor over the shape styles section of the ribbon. This gives instant border around the chart and for customization, you can click the format tab below chart tools tab. Now click the Shape outline button. We can also select the style and size of the border.

Thus, the selected option is the correct answer.

8 0
4 years ago
Read 2 more answers
Brian is a computer engineer who writes security software for a banking system. The
pashok25 [27]

Answer:

Programming & Software Development

Explanation:

Software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

Some of the models used in the software development life cycle (SDLC) are;

I. A waterfall model.

II. An incremental model.

III. A spiral model.

Also, programming refers to a software development process which typically involves writing the sets of instructions (codes) that are responsible for the proper functioning of a software.

In this scenario, Brian is a computer engineer who writes security software for a banking system.

Thus, the pathway in the Information Technology career cluster that Brian's job falls into is Programming & Software Development.

7 0
3 years ago
Place the steps in order for creating a Custom Search Folder in Outlook 2016.
TEA [102]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct order for creating Custom Search Folder in Outlook 2016 is given below:

  1. Click the Folder tab
  2. Click the New Search  Folder
  3. Open the Custom Search
  4. Choose your criteria and  
  5. Select folder in pane to
  6. Click ok to execute the search.

5 0
3 years ago
Read 2 more answers
Consider rolling a 6-sided die. The outcome of interest is the number of dots that appears on the topside when the die stops rol
damaskus [11]

Answer:

s

Explanation:

5 0
3 years ago
A U.S. social security number consists of a string of 9 digits, such as "444422333". Assume that input consists of a sequence of
harkovskaia [24]

Answer:

767745089

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • An ARP broadcast is sent to the special MAC address _______.
    9·1 answer
  • Can anyone help with this graded assignment for computer fundamentals
    10·1 answer
  • Another name for the office button menu is the toolbar. true or false.
    7·2 answers
  • A set of parentheses that contain zero or more arguments
    12·1 answer
  • Consider an allocator on a 32-bit system that uses an implicit free list. Each memory block, either allocated or free, has a siz
    11·1 answer
  • Which of the following describes an iteration in a computer program?
    8·1 answer
  • What is the purpose of indexing?
    15·2 answers
  • Which items in the list below are viruses. Click in the box to select your answer(s).
    8·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
  • Founder of television and Radio​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!