Question

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1
D. 2; 4

Sample program for this is given below.

#include <iostream>
using namespace std;

main () {
bool x = false, y = true;
int n = 20;
cout << x << endl; // prints 0 for false
cout << y << endl; // prints 1 for true
cout << hex << n; // doesn't print base
}

/*
0
1
14
*/

Add a comment
Know the answer?
Add Answer to:
7. PS2-P7: Formatted output: Flags, Methods, and Line Manipulators Match the following with 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
  • 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

  • Using the following definition (List.h file) for a list, implement the member functions (methods) for the...

    Using the following definition (List.h file) for a list, implement the member functions (methods) for the List class and store the implementation in a List.cpp file. Use a doubly linked list to implement the list. Write the client code (the main method and other non-class methods) and put in file driver.cpp. file: List.h typedef int ElementType; class node{ ​ElementType data; ​node * next; node* prev; }; class List { public: List(); //Create an empty list bool Empty(); // return true...

  • 7. Five methods of measuring values of individual assets are listed below, followed by a series...

    7. Five methods of measuring values of individual assets are listed below, followed by a series of balance sheet accounts. a. Historical cost b. Present value c. Net realizable value d. Current replacement cost e. Fair value Match the appropriate method to each account. 1. Receivables net of allowance for doubtful accounts 2. Bonds Payable 3. Prepaid Expenses 4. Financial Instruments 5. Property, plant and equipment 6. Investment securities available for sale D E w b. Present value c. Net...

  • Create a class named Program10. Your program should have the following 4 methods (other helper methods...

    Create a class named Program10. Your program should have the following 4 methods (other helper methods are allowed, but these four methods must be implemented as specified). You need to define a global scanner object and only use it inside the main method and the getValues method, since other methods do not get any values from the input. getValues: This method does not have any input parameter and returns an array of integers. This method prompts the user with a...

  • 7. Five methods of measuring values of individual assets are listed below, followed by a series...

    7. Five methods of measuring values of individual assets are listed below, followed by a series of balance sheet accounts. (9 pts) a. b. C d. e. historical cost current replacement cost fair value net realizable value present value Required: Match each balance sheet account to the appropriate method for measuring its value by placing the appropriate letter in the space provided above. (9 pts.) 1. Receivables net of allowance for doubtful accounts 2. Prepaid expenses..... 3. Investment securities available...

  • Problem Description: Create a mathematics library with the following functionality.  calculate the absolute value of...

    Problem Description: Create a mathematics library with the following functionality.  calculate the absolute value of an integer number  calculate the power given an integer base and a positive integer exponent  calculate the square of an integer number  determine if an integer is an even  determine if an integer is prime Write a Java program to do the following: 1. Calculate the absolute value, square, cube (i.e., 3rd power) of the integers 2 through 7. 2....

  • Please code in MatLab or Octave Output should match Sample Output in the second picture Thank...

    Please code in MatLab or Octave Output should match Sample Output in the second picture Thank You 4. In this problem we will investigate using loops to calculate the product of two matrices. Given an mxn matrix A and an n x p matrix B, the matrix product C = AB is the m xp matrix with Cij = R=1 Qikbky. Write a program which calls a function get matrix.dimensions which should • print a description of the purpose of...

  • Question 1 The code used to output messages to the screen begins with run # print...

    Question 1 The code used to output messages to the screen begins with run # print output Flag this Question Question 2 The code used to begin a comment in the Python program source code is # Hello * Comment Flag this Question Question 3 A variable name is like a(n) input typed on a keyboard address in computer memory where values can be stored output to a computer screen value assigned to an address in computer memory Flag this...

  • QUESTION 1 What is the output of the following code snippet? int main() { bool attendance...

    QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...

  • Implement a StringHash class using python using open addressing and linear probing, it should contain the following methods: Using strings for the data 1. StringHash(size) — create a new hashTable wit...

    Implement a StringHash class using python using open addressing and linear probing, it should contain the following methods: Using strings for the data 1. StringHash(size) — create a new hashTable with a default size of 11 for your array, but allow the user to specify an alternate size if desired 2. addItem(string) — place value into the hashTable iv. bool PindItem(string value) — return true if the value is present, else false 3. findItem(string value) — return true if the...

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