Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PV PVF Stuc in cou a ix M Inbo in Cou Seci Cen Cen Area Pro Shel The New Tab Tha Get G hon PC

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

PV PVF Stuc in cou a ix M Inbo in Cou Seci Cen Cen Area Pro Shel The New Tab Tha Get G hon PC Hov + E C https://ecourses.pvamu.edu/pluginfile.php/2347428/mod_resource/content/3/Chapter%204-Written%20Worksheet%202.pdf Chapter 4-Written Worksheet 2.pdf 1/4 Chapter 4 - Worksheet #2 1. Program Input/Output. a) Given the input data May 25, 2020 and the input statement cin >> string1 >> string2 >> string3; What will be the values in the string variables after the statement is executed? string1 = string2 = string3 = b) Given the input data May 25, 2020 and the input statement getline(cin, string4); What will be the values in the string variable after the statement is executed? string4 = 6 i 10:20 PV PVI Stuc in cou a ix M Inboth cou Seci Cen Cen Area Pro Shel The New Tab 4 Tha Get Ghov PC Hov + - E C https://ecourses.pvamu.edu/pluginfile.php/2347428/mod_resource/content/3/Chapter%204-Written%20Worksheet%202.pdf executed? string4 = c) Given the input data May 25, 2020 What will be the values in the string variable string5 and the char variable ch1 when the following statements are executed? cin.ignore (8, ' '); cin >> string5; cin.get(chi); string5 = ch1 = d) What will be the output after the following statement is executed? string string6; int index: | 10:21 PV PVI Stuc in cou a ix M Inboth cou Seci Cen Cen Area Pro Shel The New Tab 4 Tha Get Ghov PC Hov + - F + C https://ecourses.pvamu.edu/pluginfile.php/2347428/mod_resource/content/3/Chapter%204-Written%20Worksheet%202.pdf d) What will be the output after the following statement is executed? string string6; int index; string6 = "May 25, 2020"; index = string.find("25"); cout #include using namespace std; in File; //declare an input file stream variable outFile; //declare an output file stream variable const float PI = 3.14159; float radius; float height; float volume; int main() ("indata.txt"); //open the input file ("outdata.txt"); //open the output file 6 i 10:21 PV P VF Stuc | Th cou Dix M Inbo in County Seci i cen i cen i Area Pro Shel The New Tab 4 Tha Get G hon PC Hov + - * E C https://ecourses.pvamu.edu/pluginfile.php/2347428/mod_resource/content/3/Chapter%204-Written%20Worksheet%202.pdf 3. Write a C++ program doing the following things: (CH4Q3.cpp) a. Prompt for user to input a name in the following format: last, first middle age Read the above information (from keyboard). b. The program should then output the name in the following format: first middle last age (The program will have to use string operations to remove the comma from the end of the last name.) c. Save the result to an output file, myOutdata.txt | 10:21 PV P VF Stuc | Th cou Dix M Inbo in County Seci i cen i cen i Area Pro Shel The New Tab 4 Tha Get G hon PC Hov + - * E C https://ecourses.pvamu.edu/pluginfile.php/2347428/mod_resource/content/3/Chapter%204-Written%20Worksheet%202.pdf 4. Write a C++ program to read four float grades from the disk file, grades.txt, then calculate the average, and display the four values and the average on screen, with one value in one line, right-justified, and each value has two digits. (CH4Q4.cpp) 78 | 10:22

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions