HELP PLEASE!

Write your question here.
Being very new to C++ i cant seem to figure out why these errors keep happening.
i have been working on this project for 12 hours now. anybody have some advice i can use?

the error says____ "=": truncation of constant value
and also ________ "=": truncation from "int" to "char"

i don't really know what to do

here is the assignment.
Here is an example output.
///////////////////////////


How many students are in class: 5


Enter the name of the student 1:S0001

Let us get the score of the student 1 for COSC1: 90

Let us get the score of the student 1 for COSC2: 98

Let us get the score of the student 1 for COSC3: 97

Let us get the score of the student 1 for COSC4: 87

Let us get the score of the student 1 for COSC5: 99



Enter the name of the student 2:S0002

Let us get the score of the student 2 for COSC1: 88

Let us get the score of the student 2 for COSC2: 80

Let us get the score of the student 2 for COSC3: 87

Let us get the score of the student 2 for COSC4: 80

Let us get the score of the student 2 for COSC5: 85



Enter the name of the student 3:S0003

Let us get the score of the student 3 for COSC1: 78

Let us get the score of the student 3 for COSC2: 79

Let us get the score of the student 3 for COSC3: 78

Let us get the score of the student 3 for COSC4: 80

Let us get the score of the student 3 for COSC5: 78



Enter the name of the student 4:S0004

Let us get the score of the student 4 for COSC1: 69

Let us get the score of the student 4 for COSC2: 68

Let us get the score of the student 4 for COSC3: 65

Let us get the score of the student 4 for COSC4: 64

Let us get the score of the student 4 for COSC5: 59



Enter the name of the student 5:S0005

Let us get the score of the student 5 for COSC1: 78

Let us get the score of the student 5 for COSC2: 35

Let us get the score of the student 5 for COSC3: 40

Let us get the score of the student 5 for COSC4: 32

Let us get the score of the student 5 for COSC5: 41





ID COSC1 COSC2 COSC3 COSC4 COSC5 Total Percent Grade

S0001 90 98 97 87 99 471 94 A

S0002 88 80 87 80 85 420 84 B+

S0003 78 79 78 80 78 393 79 C+

S0004 69 68 65 64 59 325 65 D

S0005 78 35 40 32 41 226 45 F




The student final grade will be decided according to the following matrix:



1. If the student's average score is more than 90 and student's score is 90 or greater in each subject he gets an A+.

2. If the student's average score is more than 90 and student's score is less than 90 in any subject he gets an A.

3. If the student's average score is more than 80 and student's score is 80 or greater in each subject he gets a B+.

4. If the student's average score is more than 80 and student's score is less than 80 in any subject he gets a B.

5. If the student's average score is more than 70 and student's score is 70 or greater in each subject he gets a C+.

6. If the student's average score is more than 70 and students score is less than 70 in any subject he gets a C.

7. If the student's average score is more than 60 and student's score is 60 or greater in each subject he gets a D+.

8. If the student's average score is more than 60 and students score is less than 60 in any subject he gets a D.

9. If the student's average score is less than 60 he gets a F.



While writing the code you must do the following:

1. Create a structure which holds the following information:

i. student_id should be able to store 5 characters;

ii. cosc1_marks should be able to store int;

iii. cosc2_marks should be able to store int;

iv. cosc3_marks should be able to store int;

v. cosc4_marks should be able to store int;

vi. cosc5_marks should be able to store int;

vii. StudentotalScore should be able to store int and is sum of all the marks in 5 subjects.



viii. percentage for the total marks obtained;

ix. grade should be able to store 3 characters;

2. Create an array to store the information about the number of students which user inputs. This should be done dynamically using ‘new’ operator.

3. Prompt the user and get the user input for the student id and marks. Make sure the student ID is 5 characters long, starts with ‘S’ following by 4 numbers. Make sure that marks entered are between 0 and 100.

4. Store all the information in the array of structure declared in step 1 and 2.

5. Display the information stored in the array.

6. All the information when displayed should be right aligned





HERE IS WHAT I HAVE SO FAR....


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

#include<iostream>
#include<cmath>
#include<cstring>

using namespace std;

int main()
{

	int students = 10, studentScores = 5;
	char studentID[5];

	cout << "How many students are in class: ";
	cin >> students;
	while (students >= 3 && students <= 10)
	{
		cout << "The number of students should be from 3 to 10. \nPlease Re-Enter: ";
		cin >> students;
	}
	int S = 0;

	cout << "Enter the name of the student 1:  ";
	cin >> studentID;

	while (studentID[5])
	{
		cout << "The students ID should be 00001 to 99999. \nPlease Re-Enter: ";
		cin >> students;
	}

	int cosc1_marks;
	char Grade0;
	char Grade1;
	char Grade2;
	char Grade3;
	char Grade4;

	cout << "Let us get the score of the student 1 for COSC1: ";
	cin >> cosc1_marks;
	while (cosc1_marks >= 0 && cosc1_marks <= 100);
	{ cout << "The number for COSC1 should be from 0 to 100. \nPlease Re-Enter: ";
	cin >> cosc1_marks;
	cout << "\n\n\n";

	if (cosc1_marks >= 90 && cosc1_marks <= 100)
	{
		Grade0 = 'A';
	}

	if (Grade0 = "A" && Grade0, Grade1, Grade2, Grade3, Grade4 >= 90)
	{
		cosc1_0 = 'A+';
	}

	else if (cosc1_marks > 79 && cosc1_marks < 91)
	{
		Grade0 = 'B';
	}

	if (Grade0 = "B" && Grade0, Grade1, Grade2, Grade3, Grade4 >= 80)
	{
		Grade0 = 'B+';
	}

	else if (cosc1_marks > 69 && cosc1_marks < 81)
	{
		Grade0 = 'C';
	}

	if (Grade0 = "C" && Grade0, Grade1, Grade2, Grade3, Grade4 >= 70)
	{
		Grade0 = 'C+';
	}
	else if (cosc1_marks > 59 && cosc1_marks < 71)
	{
		Grade0 = 'D';
	}

	if (Grade0 = "D" && Grade0, Grade1, Grade2, Grade3, Grade4 >= 60)
	{
		Grade0 = 'D+';
	}
	else if (cosc1_marks > -1 && cosc1_marks < 61)
	{
		Grade0 = 'F';
	}
	return 0;
	}
}
Seems like a problem on line 53
Topic archived. No new replies allowed.