Concept explainers
Discuss the meaning of each of the following objects:
a) std: :cin
b) std: : cout
(a)
To discuss the meaning of std::cin.
Explanation of Solution
cin is an object which is used to read the data from input devices in a C++ program. Here, std is the standard I/O reader. It needs “iostream” header file to be included with preprocessor as #include<iostream>.std::cin is normally connected to the keyboard to input data. Data is inputted by a concatenating stream extraction operator (>gt;).
So, std::cin is used to read input from the user.
(b)
To discuss the meaning of std::cout.
Explanation of Solution
cout is an object which is used to write the output to the console in a C++ program. Here, std is the standard I/O reader. It needs “iostream” header file to be included with preprocessor as #include<iostream>.std::cout is normally connected to screen to output the data.std::cout indicates that the cout is used from “namespace ” std. Data is outputted by a concatenating stream insertion operator (<<).
So,std::cout will send the stream of characters to the standard output stream object.
Want to see more full solutions like this?
Chapter 2 Solutions
C++ How to Program (10th Edition)
- 01 (B):- By using array named STD. Write a program in C++ LANGUAGE to calculate student appreciation based on the following criteria's. When the average in the range from 50 to 59 → print ACCEPT When the average in the range from 60 to 69 → print MEDIUM When the average in the range from 70 to 79 → print GOOD When the average in the range from 80 to 89 → print VERY GOOD When the average in the range from 90 to 99 → print EXCELLENT Otherwise print FAILarrow_forwardQ- Many languages internally treat strings as character arrays, but somehow conceal this fact from the programmer. Character arrays or strings are used by programming languages to manipulate text such as words and sentences. Explain this statement with the help of a program. Subject: C++arrow_forwardJAVA CODE PLS Rectangle by CodeChum Admin A rectangle can be formed given two points, the top left point and the bottom right point. Assuming that the top left corner of the console is point (0,0), the bottom right corner of the console is point (MAX, MAX) and given two points (all "x" and "y" coordinates are positive), you should be able to draw the rectangle in the correct location, determine if it is a square or a rectangle, and compute for its area, perimeter and center point. To be able to do this, you should create a class for a point (that has an x-coordinate and a y-coordinate). Also, create another class called Rectangle. The Rectangle should have 2 points, the top left and the bottom right. You should also implement the following methods for the Rectangle: display() - draws the rectangle on the console based on the sample area() - computes and returns the area of a given rectangle perimeter() - computes and returns the perimeter of a given rectangle centerPoint() -…arrow_forward
- (Data processing) Construct a three-dimensional weather array for a two-week time period. Include this array in a C++ program that displays the temperatures correctly in response to any of the following user requests: • Any day’s high and low temperatures • Average high and low temperatures for a given month • Month and day with the highest temperature • Month and day with the lowest temperaturearrow_forwardNeed this written in C# to run in Visual Studio!arrow_forwardPYTHON/ JUPYTER NOTEBOOKS a) Import the following reaction mechanism for acetaldehyde pyrolysis , keep the order of the reactions the same, and display the reactions. # # Pyrolysis of acetaldehyde sensitized by iodine # I2 <=> 2 I I + CH3CHO <=> HI + CH3CO CH3CO <=> CH3 + CO CH3 + I2 <=> CH3I + I CH3 + HI <=> CH4 + I b) Make an organized output of the species and stoichiometric data matrix shape = (5, 9)arrow_forward
- Hi pleas help me i need the solv by uesing online java compiler Create the principal program, which will complete the following tasks :a. Create a new Student object by reading the required details and by applying at least one type of data validation of your choice on the input.b. Read and save the list of module names and the list of module marks awarded to the student in the two assignments. c. Display the transcript of the student by calling the adequate method.d. Repeating the previous tasks until the user decides to exit.arrow_forwardC++ format please, thanks Write a function named "FriendsWithPets" that takes a const reference to a std::map of my friends names (std::string) to the number of pets they own (int) and returns the number of friends (int) that have at least one pet. You should be using the STL algorithms to achieve this and no looping (no "while" or "for" keywords anywhere in the solution). #include<map> #include<algorithm> #include<iostream> #include<regex>arrow_forwardix) Define a function named arrayCount that takes an array and a number as the parameters and the function should return the count of number in the array. Pythonarrow_forward
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr