I am new to C++, and can not get this Student Class program to display "Name for student1 is unassigned and ssn is 9999999999." and "Name for student2 is John Doe and ssn is 123456789".
Ooops.... My Visual Studio report 18 errors... It may take a while to make this work. But for now:
-there`s no object in this class, without object it won`t work, if you need two results you must create two objects with different parameters;
-class Student has no member Student - line 34;
-line 19 - unassigned is undefined, should be "unassigned";
-line 17 and 18 - it should be Student;
-lines 22 and 23 - you can`t use void and type (char in this case) together, if function return value, then can`t be void (without returning value);
- in main() - as i mention, without object it has no sense;
To create object in class Student: Student object_name;
this will create one object using default constructor.
Now you can use only public components, private variables (and anything else in private) can be accessed ONLY by public methods.
...and many more, if i find some time i try to clean this mess...;-)
Write an interactive C++ program that inputs a series of 12 temperatures from the user. It should write out on file "tempdata.dat" each temperature and the difference between the current temperature and the one preceding it. The difference is not output for the first temperature that is input. At the end of the program, the average temperature should be displayed for the use via cout. For example, given the following input data:
34.5 38.6 42.4 46.8 51.3 63.1 60.2 55.9 60.3 56.7 50.3 42.2
Can someone help me with this C++ code. I am new to this .
Write an interactive C++ program that inputs a series of 12 temperatures from the user. It should write out on file "tempdata.dat" each temperature and the difference between the current temperature and the one preceding it. The difference is not output for the first temperature that is input. At the end of the program, the average temperature should be displayed for the use via cout. For example, given the following input data:
34.5 38.6 42.4 46.8 51.3 63.1 60.2 55.9 60.3 56.7 50.3 42.2