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:
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
Ans 1)cout<< setfill('*') << setw(35) << "*" << "\n";
Chegg allows us to answer only one question at a time.
1. Write a C++ statement that uses the manipulator setfill to output a line containing 35...
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 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 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...
i need help determining the output for these problems For ( int count = 1; count < 30; count+=9) Cout << (3 + count) << “ “ ; ________________ int I = 1; While ( I <= 10) { If ( I > 5 && i ! = 9) Cout << ‘x’ ; I++; } ____________________ double a [3] = {1.1, 2.2, 3.3}; cout << a [0] << “ “ << 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...
The Requirement (What you need to do) You are asked to write a program that takes as input a dollar amount, and then displays the dollar amount in English (similar to how you would write the amount in a check). Use case (Scenario) $PrintDollar Enter the dollar amount:$23.45 It's twenty three and 45/100 Try again(y/n):n Bye! Error handling: You are required to handle the following error inputs. If the input is any of the following case, your program should display...
1. Every C++ program must have: A. a cout statement B. function main C. a #include D. All of the above 2. main() is a method that is part of the ‘Standard Library’. T__ F__ 3. Inside a ‘Console Application’, a ‘Project’ may implement multiple ‘Solutions’. T__ F__ 4. The C++ source-code files are listed with the extension .sln. T__ F__ 5. It is recommended to start...
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 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 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...