Question

1. Write a C++ statement that uses the manipulator setfill to output a line containing 35...

1. Write a C++ statement that uses the manipulator setfill to output a line containing 35 stars, as in the following line:

***********************************

2. Suppose that x and y are int variables, z is a double variable, and ch is a char variable. Supposed the input statement is:
cin >>x >>y >>ch >>z;

What values, if any are stored in x, y, z, and ch if the input is:

  1. 35 62.78
  2. 86 32A 92.6
  3. 12 .45A 32

3. Supposed x and y are int variables and symbol is a char variable. Assume the following input data:
38 36 * 67
24 $ 55 # 34
# & 63 85

What value (if any) is assigned to the variables x, y and symbol after each of the following statements are executed (Use the same input from above for each statement

  1. cin >> x >> y;
    cin.ignore(100, ‘\n’)
    cin >> symbol;
  2. cin >>x;
    cin.ignore(100,’*’);
    cin >> y;
    cin.get(symbol);
  3. cin >> y;
    cin.ignore(100,’\n’);
    cin >> x >> symbol;
  4. cin.get(symbol);
    cin >> x;
    cin.ignore(100,’*’);
    cin >> y;
  5. cin.ignore(100,’\n’);
    cin >> x>>symbol;
    cin.ignore(100, ‘&’);
    cin >> y;
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans 1)cout<< setfill('*') << setw(35) << "*" << "\n";

Chegg allows us to answer only one question at a time.

Add a comment
Know the answer?
Add Answer to:
1. Write a C++ statement that uses the manipulator setfill to output a line containing 35...
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
  • Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal...

    Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal '2', a string literal "2", and the numeric literal 2 are identical and stored the same way though they are different types. 3 Since comments do not affect the program execution, you don't need to have it at all. 4. After the following statements are executed, the value of the variable rem is 3. 1. A preprocessor directive line starts with a pound sign...

  • C++ problem where should I do overflow part? in this code do not write a new...

    C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...

  • Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to...

    Problems 9-35 odd numbers only(9,11,13,15 …35) k newNum numi (int) (4.6/2)1 . Do a walk-through to find the value assigned to e. Assume that all variables are properly declared. a -31 es" (a%b) * 6; e-(a b+ d)/ 4 10. Which of the following variable declarations are correct? If'a variable declaration is not correct, give the reasoníy) and provide the correct variable declaration. n = 12; char letter int one = 5, two; //Line 3 double x, Y zi //tine...

  • Write a C++ program that uses a structure to store the following inventory information in a...

    Write a C++ program that uses a structure to store the following inventory information in a file: ⦁   Item description, Quantity on hand, Wholesale cost, Retail cost, and Date added to inventory. ⦁   Use a char array for item description and date. ⦁   The program should have a menu that allows the user to perform the following tasks: i.   Add a new record at the end of the file. ii.   Display any record in the file. iii.   Change any record...

  • Can someone help with this multiple choice question for C++ Suppose that x and y are...

    Can someone help with this multiple choice question for C++ Suppose that x and y are int variables, z is a double variable, and the input is: 28 32.6 12 Choose the values of x, y, and z after the following statement executes: cin >> x >> y >> z; a. x = 28, y = 12, z = 32.6 b. x = 28, y = 12, z = 0.6 c. x = 28, y = 32, z = 12.0...

  • Code in C++: Please help me fix the error in function: void write_account(); //function to write...

    Code in C++: Please help me fix the error in function: void write_account(); //function to write record in binary file (NOTE: I able to store data to a txt file but however the data get error when I try to add on data the second time) void display_all(); //function to display all account details (NOTE: This function is to display all the info that save account.txt which is ID, Name, and Type) void modify_account(int); //function to modify record of file...

  • c++ Write the following 2 functions and test them. Both of them need to be recursive...

    c++ Write the following 2 functions and test them. Both of them need to be recursive functions. int sum(int n); // recursive version to calculate the sum of 1 + 2 + ..... + n int str_length(char s[]; // Returns length of the string s[] and the null character, '0\', is not counted in the length). Example of program execution; Enter a positive integer: 10 (user input) The sum of 1+ 2+....+10 is: 55 Enter a sentence: Hello World! (user...

  • Need help with these questions in C programming: 9. What is the output of the following...

    Need help with these questions in C programming: 9. What is the output of the following code? int X[10]={0}; int N=4; for(int k=0; k<N:k++) X[k] = k*2: printf("%d", X[N/2]; 10. Write a single statement to accomplish each of the following. Assume that each of these statements applies to the same program. a. Write a statement that opens file "oldmast.dat" for reading and assigns the returned file pointer to ofPtr. b. Write a statement that opens file "trans.dat" for writing and...

  • (Coding done in c++, Virtual Studio) Having a problem with the line trying to compare the...

    (Coding done in c++, Virtual Studio) Having a problem with the line trying to compare the date of birth.            **fall.sort(compare_DOB); //Here lies your error** #include <fstream> #include <iostream> #include <string> #include <list> #include <cctype> using namespace std; const char THIS_TERM[] = "fall.txt"; const string HEADER = "\nWhat do you want to do ?\n\n" "\t. Add a new friend name and DOB ? \n" "\t. Edit/Erase a friend record ? \n" "\t. Sort a Friend's record ? \n"...

  • Hello, I am working on my final and I am stuck right near the end of...

    Hello, I am working on my final and I am stuck right near the end of the the program. I am making a Tic-Tac-Toe game and I can't seem to figure out how to make the program ask if you would like to play again, and keep the same names for the players that just played, keep track of the player that wins, and display the number of wins said player has, after accepting to keep playing. I am wanting...

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