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
Stels [109]
3 years ago
15

Please help explain this calculator code.

Computers and Technology
1 answer:
Tom [10]3 years ago
7 0

Answer:

that looks really complicated. Try going to khan academy to get an explanation, they almost always have great explanations for things.

Explanation:

You might be interested in
Assign a pointer to any instance of searchChar in personName to searchResult.#include #include using namespace std;int main() {c
Firlakuza [10]

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.

8 0
4 years ago
A Color class has three public, integer-returning accessor methods: getRed, getGreen, and getBlue, and three protected, void-ret
jek_recluse [69]

Answer:

The following code are:

public void dissolve() {

setRed(getRed()+1);

setGreen(getGreen()+1);

setBlue(getBlue()+1);

alpha+=1;

}

Explanation:

Here, we define the void type function "dissolve()" inside it, we set three function i.e, "setRed()", "setGreen()", "setBlue()" and then we increment the variable "alpha" by 1.

Inside those three mutators method we set three accessor methods i.e, "getRed()", "getGreen()" , "getBlue()" and increment these accessor by 1.

The values will not be returned by the mutator functions, the accessor will be returned the values.

6 0
3 years ago
When a pitcher is holding a baseball, the ball has ______energy.
MA_775_DIABLO [31]
Answer would be D)potential
3 0
3 years ago
Read 2 more answers
"during the ________ stage of system development, system specifications that were prepared during the design stage are translate
Paraphin [41]
The correct answer is programming
Hope this helps! :)
5 0
4 years ago
What are the actions performed by copy cells?​
REY [17]

Answer:

Specifies that no mathematical operation will be applied to the copied data. Adds the copied data to the data in the destination cell or range of cells. Subtracts the copied data from the data in the destination cell or range of cells.

...

7 0
3 years ago
Other questions:
  • Will give brainliest and good amount of points, no false answers.
    5·1 answer
  • Uugurfofyhjfsjvrdjctstghfjddd
    13·1 answer
  • You have four 2.5ʺ hard drives on hand and need a replacement drive for a desktop system. The documentation for the motherboard
    9·1 answer
  • Which event most led to a reduction in the size and cost of computers? a. invention of the Bessemer converter b. development of
    8·2 answers
  • The scope of a variable declared inside of a function is:
    8·1 answer
  • Which best describes the Help feature of Word?
    13·2 answers
  • Programs are normally stored in ________ and loaded into main memory as needed. the input device the output device secondary sto
    15·1 answer
  • The following program is run. Then the user clicks the "bottomButton" TWO TIMES. What will be displayed in the console?
    6·2 answers
  • Can i get any information on this website i'd like to know what its for ?
    11·1 answer
  • What do you mean by computer ethics?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!