473,396 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with C++

Hello to all is there anyone who could help me figure out why my program will not compile. This is my assignment but I have also included my work and I am getting a error that says (C1083)

Problem 1: Create a Student Class (worth all 100 points)
This problem will require you to create a Student class and a C++ main function to test it. The Student class will need variables for the student id, student name and an array for grades. Luckily, we know that each student will only have 10 grades, so an array with 10 elements will hold all the student’s grades.

The Student class will also need a mutator method to set the grades, and a method to calculate the average of the grades.

In the C++ main function, you will need to create two instances of the Student class for the two students, which I need averages for.

Here are the students’ grades (you can just hard code them if you want):
Student 1 95 78 26 92 27 46 89 83 78 90
Student 2 100 98 97 67 59 100 98 76 83 85


The file should be named so:

<Your User Name>A8P1.cpp

For this assignment you will only need to turn in the source file (i.e. the cpp file).

Submit the assignment in the Digital Drop Box. Please remember to label this assignment <your user name>A8P1.cpp in the Digital Drop Box.

BONUS 1: (this is optional but will give you 5pts to add to any exam or assignment grade)
Write methods that will return the student’s lowest grade and highest grade and then display them. For Example:

Student Lowest Highest
--------------------------------------------------
1 26 95
2 59 100


My Work

Expand|Select|Wrap|Line Numbers
  1. #include "stdafx.h"
  2. #include "employee.h"
  3.  
  4. Student::Student( )
  5.  
  6. {
  7.  
  8.       setStudentNumber( 0 );
  9.  
  10.       setStudentName( "Suzie Cue" );
  11.  
  12.       setStudentsgrades[ 10 ];
  13.  
  14. }
  15.  
  16. Student::Student( int StudentNumber, string StudentName)
  17.  
  18. {
  19.  
  20.       setStudentNumber( StudentNumber );
  21.  
  22.       setStudentName( StudentName );
  23.  
  24.       setStudentsgrades[ Testgrades ];
  25.  
  26. }
  27.  
  28. double Student::ComputeAverage( double testsTaken )
  29.  
  30. {
  31.  
  32.       double Testgrades = 0.0;
  33.  
  34.       for (int i = 0; i<testsTaken; i++)
  35.  
  36.       Testgrades += Testgrades[i];
  37.  
  38.       return Testgrades /= testsTaken;
  39.  
  40. }
  41.  
  42. double Student::getStudentNumber( )
  43.  
  44. {
  45.  
  46.       return iStudentNumber;
  47.  
  48. }
  49.  
  50. void Student::setStudentNumber( int StudentNumber )
  51.  
  52. {
  53.  
  54.       iStudentNumber = StudentNumber;
  55.  
  56. }
  57.  
  58.  
  59. string Student::getStudentName( )
  60.  
  61. {
  62.  
  63.       return this->sStudentName;
  64.  
  65. }
  66.  
  67. void Student::setStudentName( string StudentName )
  68.  
  69. {
  70.  
  71.       this->sStudentName = StudentName;
  72.  
  73. }
  74.  
  75. double Student::getTestgrades( )
  76.  
  77. {
  78.  
  79.       return this->dTestgrades; 
  80.  
  81. }
  82.  
  83. void Student::setStudentsgrades( double testsTaken )
  84.  
  85. {
  86.  
  87.       this->dTestgrades = Testgrades;
  88.  
  89. }
  90.  
  91. int _tmain(int argc, _TCHAR* argv[])
  92.  
  93. {
  94.  
  95.       Student student1;
  96.  
  97.       student1.setStudentNumber( 1 );
  98.  
  99.       student1.setStudentName( "Suzie Cue" );
  100.  
  101.       student1.setStudentsgrades[ 95, 78, 26, 92, 27, 46, 89, 83, 78, 90 ];
  102.  
  103.       Student student2;
  104.  
  105.       student2.setStudentNumber( 2 );
  106.  
  107.       student2.setStudentName( "Laura Ingalls" );
  108.  
  109.       student2.setStudentsgrades[ 100, 98, 97, 67, 59, 100, 98, 76, 83, 85 ];
  110.  
  111.       cout << setfill( '*' ) << setw(40) << "" << endl;
  112.  
  113.       cout << "Student Number " << Student1.getStudentNumber( ) << endl;
  114.  
  115.       cout << "\t\t" << student1.getStudentName( ) << endl;
  116.  
  117.       cout << "\t\tTest average is $ " << std::fixed << std::setprecision( 2 ) <<  student1.ComputeAverage[10] << endl;
  118.  
  119.       cout << setfill( '*' ) << setw(40) << "" << endl << endl;
  120.  
  121.       cout << setw(40) << setfill( '*' ) << "" << endl;
  122.  
  123.       cout << "Student Number " << std::setprecision( 0 ) << student2.getStudentNumber( ) 
  124.  
  125.       << endl;
  126.  
  127.       cout << "\t\t" << student2.getStudentName( ) << endl;
  128.  
  129.       cout << "\t\tTest average is $ " << std::fixed << setprecision( 2 ) <<  student2.Computeaverage [ 10 ] << endl;
  130.  
  131.       cout << setw(40) << setfill( '*' ) << "" << endl << endl;
  132.  
  133.       return 0;
  134.  
  135. }
  136.  
  137.  
  138. int _tmain(int argc, _TCHAR* argv[])
  139. {
  140.     return 0;
  141. }
  142.  
Nov 11 '06 #1
1 2728
Banfa
9,065 Expert Mod 8TB
Posting the error "(C1083)" is not enough. Without knowing the compiler the number means nothing, even it you post the compiler you are using the number will mean nothing to those people who do not use the same compiler.

As it happens I can see you have used the Microsoft barstardisation of main _tmain and I guess you are using MSVC++

Post the complete error message, highlight the line in your code that you are getting it on.
Nov 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.