Question

5. PS2-P5: Formatted output: Flags, Methods, and Line Manipulators Match the following to the listed descriptions:...

5. PS2-P5: Formatted output: Flags, Methods, and Line Manipulators
Match the following to the listed descriptions:
a- setfill(*);
b- setprecision(n);
c- setisosflags(flag);
d- setw(n)
DESCRIPTIONS:
1- set the format flags
2- set the fill character to a character
3- set field width to n
4- set floating point precision to n places

?

A. 1, 3, 2, 4

B. 2, 3, 1, 4

C. 4, 2, 1, 3

D. 2, 4, 3, 1

E. 2, 4, 1, 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

==================================================================
5. PS2-P5: Formatted output: Flags, Methods, and Line Manipulators
   Match the following to the listed descriptions:

       a- setfill(*);
       b- setprecision(n);
       c- setisosflags(flag);
       d- setw(n)
   DESCRIPTIONS:
       1- set the format flags
       2- set the fill character to a character
       3- set field width to n
       4- set floating point precision to n places ?
   A. 1, 3, 2, 4
   B. 2, 3, 1, 4
   C. 4, 2, 1, 3
   D. 2, 4, 3, 1
   E. 2, 4, 1, 3

-------------
Answer:
-------------

   E. 2, 4, 1, 3
--------------------
Explanation:
--------------------

   a- setfill(*) -> 2- set the fill character to a character
       sets the fill character by the specified character in this case it is *
  
   b- setprecision(n); -> 4- set floating point precision to n places ?
       sets the floating point precision by n digits, for example 3.126 if precision is 2 then
       value is 3.13 after precision set.
      
   c- setisosflags(flag); -> 1- set the format flags
       sets the format flags, used to represent for hexadecimal values
  
   d- setw(n) -> 3- set field width to n
       set the width to n positions, For example if you specify
       setw(3) and cout<<"7";
       It will print 3 spaces followed by 7 on console.
==================================================================

Add a comment
Know the answer?
Add Answer to:
5. PS2-P5: Formatted output: Flags, Methods, and Line Manipulators Match the following to the listed descriptions:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 7. PS2-P7: Formatted output: Flags, Methods, and Line Manipulators Match the following with the listed descriptions:...

    7. PS2-P7: Formatted output: Flags, Methods, and Line Manipulators Match the following with the listed descriptions: a- boolalpha/noboolalpha; b- showbase/noshowbase; OPTIONS: 1- By default, bool-variable-values are printed as: True/False 2- By default, bool-variable-values are printed as: 1/0 3- By default, base of number is: Displayed 4- By default, base of number is: not displayed ? A. 1; 3 B. 1; 4 C. 2; 3 D. 2; 4

  • In this project you will write a C++ program that simulates the purchase of a single...

    In this project you will write a C++ program that simulates the purchase of a single item in an online store. What to do Write a C++ program that: 1. Prints out a welcome message. 2. Prompts the user for the following information: (a) Their first name (example: Roger) (b) Their last name (example: Waters) (c) The name of the product (example: Brick) (d) The unit price of the product (example: 1.99) (e) The quantity to buy (example: 200) (f)...

  • 4) What is the output if the input istom - Sawyer? #include <iostream> using namespace std;...

    4) What is the output if the input istom - Sawyer? #include <iostream> using namespace std; int main() { string playerName; cout << "Enter name"; cin >> playerName; cout << endl « playerName; return 0; } a. Tom - Sawyer b. Tom Sawyer c. Tom d. Sawyer 5) Which XXX generates "Adam is 30 years old." as the output? #include <iostream> using namespace std; int main() { string name = "Adam"; int age = 30; XXX return 0; } a....

  • using the source code at the bottom of this page, use the following instructions to make...

    using the source code at the bottom of this page, use the following instructions to make the appropriate modifications to the source code. Serendipity Booksellers Software Development Project— Part 7: A Problem-Solving Exercise For this chapter’s assignment, you are to add a series of arrays to the program. For the time being, these arrays will be used to hold the data in the inventory database. The functions that allow the user to add, change, and delete books in the store’s...

  • Zybooks 11.12 LAB*: Program: Online shopping cart (continued) Python 3 is the code needed and this...

    Zybooks 11.12 LAB*: Program: Online shopping cart (continued) Python 3 is the code needed and this is in Zybooks Existing Code # Type code for classes here class ItemToPurchase: def __init__(self, item_name="none", item_price=0, item_quantity=0): self.item_name = item_name self.item_price = item_price self.item_quantity = item_quantity # def __mul__(self): # print_item_cost = (self.item_quantity * self.item_price) # return '{} {} @ ${} = ${}' .format(self_item_name, self.item_quantity, self.item_price, print_item_cost) def print_item_cost(self): self.print_cost = (self.item_quantity * self.item_price) print(('{} {} @ ${} = ${}') .format(self.item_name, self.item_quantity, self.item_price,...

  • KEY TERMS to hog ho MATCHING Match the definition with the correct term from the following...

    KEY TERMS to hog ho MATCHING Match the definition with the correct term from the following word list. A. administrative code set B. billing provider C. carrier block D. claim attachment E claim control number claim filing indicator code G. claim frequency code (claim submission eason code) H. claim soruhter I clean claims Q. HIPAA XI2 837 Healh Care Claim Professional (R37P) R. line item conl nember S. National Uniform Claim Committee (NUCC) T. other ID nunber U. ostside lahoratory...

  • #include <iostream> #include <iomanip> #include <vector> using namespace std; Part 1. [30 points] In this part,...

    #include <iostream> #include <iomanip> #include <vector> using namespace std; Part 1. [30 points] In this part, your program loads a vending machine serving cold drinks. You start with many foods, some are drinks. Your code loads a vending machine from foods, or, it uses water as a default drink. Create class Drink, make an array of drinks, load it and display it. Part 1 steps: [5 points] Create a class called Drink that contains information about a single drink. Provide...

  • QUESTION 7 Which of the following is a valid C++ assignment statement? (assume each letter is...

    QUESTION 7 Which of the following is a valid C++ assignment statement? (assume each letter is a different variable) A.y=b-c B.y +z = x C.x = a bi D.x = -(y*z): Ex = (x + (y z): QUESTION 8 Which of the following is a valid variable name according to C++ naming rules? A 2ndName B.%Last_Name C@Month D#55 Eyear03 QUESTION 9 Which library must be included to enable keyboard input? A kbdin B. cstdlib C input Diostream E lomanip QUESTION...

  • InventoryManagement

    Problem:A small electronics company has hired you to write an application to manage their inventory. The company requested a role-based access control (RBAC) to increase the security around using the new application. The company also requested that the application menu must be flexible enough to allow adding new menu items to the menu with minimal changes. This includes re-ordering the menu items and making changes to the description of a menu item without having to change the code.Security:The company has...

  • Assignment Overview In Part 1 of this assignment, you will write a main program and several...

    Assignment Overview In Part 1 of this assignment, you will write a main program and several classes to create and print a small database of baseball player data. The assignment has been split into two parts to encourage you to code your program in an incremental fashion, a technique that will be increasingly important as the semester goes on. Purpose This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT