nment:Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the header file. You must also display the floating-point result up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by a space. In addition, you must print to the console “Excellent” if the grade is greater than or equal to 90, “Well Done” if the grade is less than 90 and greater than or equal to 80, “Good” if the grade is less than 80 and greater than or equal to 70, “Need Improvement” if the grade is less than 70 and greater than or equal to 60, and “Fail” if the grade is less than 60

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Question: I screenshot my work, but do not if i put extra in that does not need to be there or if i am missing something to not be able to get rid of the errors listed at the bottom. theyre both in relation to line 1 and i dont even see a probelm with the line. 

Assignment:Write a C++ program that computes a student’s grade for an assignment as a percentage given the student’s score and total points. The final score must be rounded up to the nearest whole value using the ceil function in the header file. You must also display the floating-point result up to 5 decimal places. The input to the program must come from a file containing a single line with the score and total separated by a space. In addition, you must print to the console “Excellent” if the grade is greater than or equal to 90, “Well Done” if the grade is less than 90 and greater than or equal to 80, “Good” if the grade is less than 80 and greater than or equal to 70, “Need Improvement” if the grade is less than 70 and greater than or equal to 60, and “Fail” if the grade is less than 60. 

//CSIS 111-<D01> ADD YOUR SECTION NUMBER
//<Sources if necessary>
| //Include statements
E#include <iostream>
#include <string>
7
#include <cmath>
8.
#include <fstream>
using namespace std;
B//Global declarations: Constants and type definitions only -- no variables
|//Function prototypes
Bint main()
{
//In cout statement below SUBSTITUTE your name and lab number
9.
10
11
12
13
14
15
cout <« "Julianna Brown -- Lab Number 3" << endl << endl;
16
//Variable declarations
double score[20], total[20], value, grade;
int totalValue = 0;
17
18
//create an object of the input stream
ifstream fromFile;
19
20
//opening the file
fromFile.open("input.txt");
21
22
//get student score from the file
fromFile >> value;
23
24
25
//add student score in the array
score[totalValue] = value;
//get the total from the file
fromFile >> value;
26
27
28
29
//add total in the array
total[totalValue] = value;
//increment the counter
30
31
32
totalValue++;
33
34
35
36
for (int i = 0; i < totaivalue; i++)
37
38
//calculate percentage
grade = score[i]/total[i];
//display percentage in floating-point with the five decimal places
cout <« fixed << ceil(grade * 100) « "%" << fixed << grade;
//when percentage is greater than or equal to 90
if (ceil(grade * 100) >= 90)
{
//display grade
39
40
41
42
43
44
45
46
cout << "Excellent" << endl;
47
//when percentage is less than 90 and greater than or equal to 80
else if (ceil(grade * 100) >= 80)
48
{
//display grade
50
51
No issues found
Ln: 78
Ch: 23
For List
X 2 Errors
A o Warnings
O O Messages
ntire Solution
Build + IntelliSense
Search Error List
Code
Description
Project
File
Line Suppressi
LNK2005 _main already defined in ConsoleApplication3.obj
ConsoleApplication3
Source.obj
1
LNK1169 one or more multiply defined symbols found
ConsoleApplication3
ConsoleApplication3.exe
1
ror List Output
Transcribed Image Text://CSIS 111-<D01> ADD YOUR SECTION NUMBER //<Sources if necessary> | //Include statements E#include <iostream> #include <string> 7 #include <cmath> 8. #include <fstream> using namespace std; B//Global declarations: Constants and type definitions only -- no variables |//Function prototypes Bint main() { //In cout statement below SUBSTITUTE your name and lab number 9. 10 11 12 13 14 15 cout <« "Julianna Brown -- Lab Number 3" << endl << endl; 16 //Variable declarations double score[20], total[20], value, grade; int totalValue = 0; 17 18 //create an object of the input stream ifstream fromFile; 19 20 //opening the file fromFile.open("input.txt"); 21 22 //get student score from the file fromFile >> value; 23 24 25 //add student score in the array score[totalValue] = value; //get the total from the file fromFile >> value; 26 27 28 29 //add total in the array total[totalValue] = value; //increment the counter 30 31 32 totalValue++; 33 34 35 36 for (int i = 0; i < totaivalue; i++) 37 38 //calculate percentage grade = score[i]/total[i]; //display percentage in floating-point with the five decimal places cout <« fixed << ceil(grade * 100) « "%" << fixed << grade; //when percentage is greater than or equal to 90 if (ceil(grade * 100) >= 90) { //display grade 39 40 41 42 43 44 45 46 cout << "Excellent" << endl; 47 //when percentage is less than 90 and greater than or equal to 80 else if (ceil(grade * 100) >= 80) 48 { //display grade 50 51 No issues found Ln: 78 Ch: 23 For List X 2 Errors A o Warnings O O Messages ntire Solution Build + IntelliSense Search Error List Code Description Project File Line Suppressi LNK2005 _main already defined in ConsoleApplication3.obj ConsoleApplication3 Source.obj 1 LNK1169 one or more multiply defined symbols found ConsoleApplication3 ConsoleApplication3.exe 1 ror List Output
28
fromFile >> value;
29
//add total in the array
total[totalValue] = value;
//increment the counter
30
31
32
totalValue++;
33
34
35
36
for (int i = 0; i < totaivalue; i++)
37
//calculate percentage
grade = score[i]/total[i];
//display percentage in floating-point with the five decimal places
cout <« fixed << ceil(grade * 100) « "%" << fixed << grade;
38
39
40
41
//when percentage is greater than or equal to 90
if (ceil(grade * 100) >= 90)
42
43
{
//display grade
44
45
46
cout <« "Excellent" << endl;
}
//when percentage is less than 90 and greater than or equal to 80
else if (cei1(grade * 100) >= 80)
47
48
49
{
//display grade
50
51
52
cout <« "Well-Done" << endl;
}
//when percentage is less than 80 and greater than or equal to 70
else if (ceil(grade * 100) >= 70)
53
54
55
56
57
//display grade
58
cout <« "Good" << endl;
}
//when percentage is less than 70 and greater than or equal to 60
else if (ceil(grade * 100) >= 60)
59
60
61
{
//display grade
62
63
64
cout <« "Need Improvement" << endl;
65
66
//when the percentage is less than 60
67
else
{
//display grade
cout << "Fail" << endl;
68
69
70
71
72
//Program logic
//Closing program statements
system("pause");
73
74
75
76
return 0;
77
78
//Function definitions
No issues found
Ln: 78
Ch: 23
TABS
CRLF
ror List
X 2 Errors
A o Warnings
O O Messages
Entire Solution
Build + IntelliSense
Search Error List
Code
Description
Project
File
Line Suppression State
LNK2005_main already defined in ConsoleApplication3.obj
ConsoleApplication3
Source.obj
1
LNK1169 one or more multiply defined symbols found
ConsoleApplication3
ConsoleApplication3.exe
1
ror List Output
Transcribed Image Text:28 fromFile >> value; 29 //add total in the array total[totalValue] = value; //increment the counter 30 31 32 totalValue++; 33 34 35 36 for (int i = 0; i < totaivalue; i++) 37 //calculate percentage grade = score[i]/total[i]; //display percentage in floating-point with the five decimal places cout <« fixed << ceil(grade * 100) « "%" << fixed << grade; 38 39 40 41 //when percentage is greater than or equal to 90 if (ceil(grade * 100) >= 90) 42 43 { //display grade 44 45 46 cout <« "Excellent" << endl; } //when percentage is less than 90 and greater than or equal to 80 else if (cei1(grade * 100) >= 80) 47 48 49 { //display grade 50 51 52 cout <« "Well-Done" << endl; } //when percentage is less than 80 and greater than or equal to 70 else if (ceil(grade * 100) >= 70) 53 54 55 56 57 //display grade 58 cout <« "Good" << endl; } //when percentage is less than 70 and greater than or equal to 60 else if (ceil(grade * 100) >= 60) 59 60 61 { //display grade 62 63 64 cout <« "Need Improvement" << endl; 65 66 //when the percentage is less than 60 67 else { //display grade cout << "Fail" << endl; 68 69 70 71 72 //Program logic //Closing program statements system("pause"); 73 74 75 76 return 0; 77 78 //Function definitions No issues found Ln: 78 Ch: 23 TABS CRLF ror List X 2 Errors A o Warnings O O Messages Entire Solution Build + IntelliSense Search Error List Code Description Project File Line Suppression State LNK2005_main already defined in ConsoleApplication3.obj ConsoleApplication3 Source.obj 1 LNK1169 one or more multiply defined symbols found ConsoleApplication3 ConsoleApplication3.exe 1 ror List Output
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY