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)
- Function Description: Given a structure array with fields 'names', 'ASCI and 'points", return the name whose ASCII value is closest to its points (which is the coolest name). Notes: . There will never be a tie for the coolest name. . Do not compute the ASCII value of the names: it is given to you by the ASCII field. . Only the absolute value of the difference between ASCII value and points is considered. Hint: • You can index multiple char values from a structure using (struct.field) Examples: struct1= struct('names". ("Dwayne', 'Justin', "Peters), 'ASCI, (616, 637, 627). "points". (639, 651, 655)); ASCII 2 3 names Dwayne Justin' Peters coolestname = coolestName(struct1) coolestname "Justin' 616 637 627 points 639 651 655arrow_forwardc++ programming need code for the sample run/output on the attached images there are no restrictions with coding as long as it is under c++ you may use array and OOP and other structures if needed but make the code as simple and basic as it can get whenever possible also please insert pseudocodes for better understanding Thank you! *If you are the person who previously answered this question, the code you provided does not work. I cannot choose either registration or records, it instead outputs "invalid choice". Please fix this.arrow_forward01 (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_forward
- What are the primary distinctions between structures and arrays?arrow_forwardComputer Science Please make an object-oriented python code for this assignment. Include screenshots of the Output and explanation section, please. The explanation section is very important and screenshots in python of the whole code. you register to the hospital with your name, and surname.. - you need to go to the hospital so you need to enter how far you live from it - you need to enter personal info (age, gender, ...) and salary information - the system accepts these inputs and calculates how much it costs you (because the more you earn, the more you'll pay for health services..) - the system pays you back your traveling time and miles - you have an overview of the costs and can accept or not - if you accept, you can select a date for the shot.arrow_forwardcreate a one dimensional array of baseballplayers with size of 100add three baseball players to the array in C#arrow_forward
- {JAVA programing} Declare and initialize an integer variable named num with the value 10.Declare and initialize a double variable named pi with the value 3.14159.Declare and initialize a boolean variable named isTrue with the value true.Declare and initialize a string array variable named colors with the values "red", "green", and "blue".Print the value of num, pi, and isTrue to the console.Use a for loop to iterate over the colors array and print each color to the console.arrow_forwardUpper, Dis-upper Code in C languagearrow_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_forward
- JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National Heart, Lung, and Blood Institute of the National Institutes of Health, body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. It is used to monitor one's health by determining whether one is underweight, overweight, has normal weight or is obese. It is computed based as follows (when using standard weight in pounds and height in inches): BMI = 703 x (weight/(height2)) Furthermore, people with BMI scores that are less than 18.5 are said to be underweight. Those with scores between 18.5–24.9 (inclusive) are of normal weight. Those with scores between 25–29.9 (inclusive) are said to be overweight. And those with scores 30 or higher are obese. Input The input is composed of two positive integers representing the weight in pounds and the height in inches. 140·65 Output A single line containing two values: the computed…arrow_forwardProgramming Language Pragmatics, 4th Editionarrow_forwardNeed this written in C# to run in Visual Studio!arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr