76 951
Assignments Done
Successfully Done
In June 2019

Answer to Question #18063 in C++ for paul

Question #18063
Write a C++ code that prompt the user to enter their name, age, class status (freshman,sophomore,junior,and senior) and GPA. Can the program write this information to a disk file as one item oer line?
Im having serious problems with this...
Thank you for your time.
Expert's answer
#include <string>
#include <iostream>
#include <fstream>
using namespace std;

int main () {
stringname, status;
intage, GPA;
cout<< "Enter name: " << endl;
cin>> name;
cout<< "Enter age: " << endl;
cin>> age;
cout<< "Enter status: " << endl;
cin>> status;
cout<< "Enter GPA: " << endl;
cin>> GPA;

myfile<< name << "
myfile<< age << "
myfile<< status << "
myfile<< GPA << "

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions