Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

%3Cp%3EPlease%20discuss%20the%20various%20IO%20manipulators%20and%3C%2Fp%3E%0A%3

ID: 3552125 • Letter: #

Question

%3Cp%3EPlease%20discuss%20the%20various%20IO%20manipulators%20and%3C%2Fp%3E%0A%3Cp%3Edetermine%20how%20floating%20point%20numbers%20will%20be%20displayed.%3C%2Fp%3E%0A%3Cp%3Eprovide%20an%20example%20please%3C%2Fp%3E%0A%3Cp%3E%3Cbr%20%2F%3E%3C%2Fp%3E%0A%3Cp%3EEvery%20day%2C%20we%20all%20make%20thousands%20of%20decisions%2C%20ranging%20from%20the%0Amundane%20(%22Should%20I%20wear%20my%20blue%20or%20black%20socks%3F%22)%20to%20the%20major%0A(%22Should%20I%20do%20my%20homework%20or%20watch%20TV%3F%22).%20Programs%20can%20make%0Adecisions%2C%20too.%20Depending%20on%20certain%20conditions%2C%20a%20program%20can%20do%0Adifferent%20things%2C%20a%20concept%20known%20as%20branching.%20%20This%20week%2C%0Ayou'll%20learn%20how%20and%20when%20to%20use%20various%20decision%20making%0Aconstructs.%20You'll%20also%20hone%20your%20logic%20skills%20by%20determining%20the%0Aconditional%20statements%20your%20decisions%20depend%20on.%3C%2Fp%3E%0A%3Cp%3E%3Cbr%20%2F%3E%3C%2Fp%3E%0A%3Cp%3EIt%20is%20common%20to%20need%20to%20make%20choices%20between%20different%0Aalternatives%20when%20solving%20problems.%20Alternatives%20can%20take%20different%0Aforms.%20%26nbsp%3BFor%20instance%2C%20only%20do%20action%20X%20if%20condition%201%20is%20true%0Apresents%20an%20alternative%20of%20either%20doing%20or%20not%20doing%20action%20X.%0A%26nbsp%3BA%20different%20form%20of%20alternative%20occurs%20in%20the%20case%20where%20we%0Aneed%20to%20do%20action%20X%20if%20condition%202%20is%20true%2C%20otherwise%20do%20action%20Y.%0A%26nbsp%3BHere%20we%20have%20a%20choice%20between%202%20different%20actions%2C%20and%20we%0Awill%20always%20do%20X%20or%20Y%20depending%20on%20condition%202.%20%26nbsp%3BThis%20form%20can%0Abe%20extended%20to%20choosing%20between%203%2C%204%2C%20or%20any%20number%20of%20actions%0Awhere%20one%20action%20is%20always%20selected.%20%26nbsp%3B%3C%2Fp%3E%0A%3Cp%3ELet%E2%80%99s%20discuss%20some%20real%20examples%20where%20making%20these%20types%20of%0Achoices%20are%20needed.%26nbsp%3B%3C%2Fp%3E%0A%3Cp%3EIdentify%20the%20alternative%20actions%20and%20the%20condition%20that%20controls%0Athe%20choice.%3C%2Fp%3E%0A

Explanation / Answer

Manipulators are functions specifically designed to be used in conjunction with the insertion (<<) and extraction (>>) operators on stream objects, for example:



They are still regular functions and can also be called as any other function using a stream object as argument, for example:



Manipulators are used to change formatting parameters on streams and to insert or extract certain special characters.


See more here: http://www.cplusplus.com/reference/library/manipulators/

   
  cout << boolalpha;