帮助C ++ [英] Help with C++

查看:74
本文介绍了帮助C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,是否有人可以帮我弄清楚为什么我的程序无法编译。这是我的任务,但我也包括了我的工作,我收到的错误是(C1083)


问题1:创建一个学生班(价值全部为100分)

这个问题需要你创建一个Student类和一个C ++主函数来测试它。 Student课程将需要学生ID,学生姓名和成绩数组的变量。幸运的是,我们知道每个学生只有10个年级,所以一个包含10个元素的数组将保留所有学生的成绩。


学生班还需要一个mutator方法来设置成绩,以及计算成绩平均值的方法。


在C ++主函数中,您需要为两个学生创建两个Student类实例,我需要平均值。


以下是学生?成绩(如果你愿意,你可以硬编码):

学生1 95 78 26 92 27 46 89 83 78 90

学生2 100 98 97 67 59 100 98 76 83 85


该文件应如下命名:


<您的用户名> A8P1.cpp

对于此作业,您只需要输入源文件(即cpp文件)。


在数字投递箱中提交作业。请记得在数字投递箱中标记此作业<您的用户名> A8P1.cpp。


BONUS 1 :(这是可选的但会给你5分加入任何考试或分配等级)

编写方法,将返回学生的最低年级和最高年级,然后显示它们。例如:


学生最低学生最高

------------------------ --------------------------

1 26 95

2 59 100

展开 | 选择 | Wrap | 行号

解决方案

发布错误(C1083)是不足够的。在不知道编译器的情况下,这个数字没有任何意义,即使你发布编译器,你使用的数字对于那些不使用相同编译器的人来说也没什么意义。


碰巧我可以看到你使用了主_tmain的微软棒化,我想你正在使用MSVC ++


发布完整的错误信息,突出显示你的代码中的行。

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

解决方案

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.


这篇关于帮助C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆