ite a program ogram must read the subject code, the assignment marks for two assignments an percentage that each assignment contributes towards the year mark, for eac bject that the student is registered for. ilculate a students year marks his subjects. eate an input file called assignments.dat that contains the following informatio a specific student: cos1511 30 66 70 49 cos1512 25 76 75 67 cos1521 10 58 90 62 cos1501 50 62 50 57 INF1501 40 82 60 78 INF1511 20 24 80 55 e first field in each line represents the subject code, followed by the percentage tha signment 1 contributes towards the year mark and the student's mark ( rcentage) for assignment 1. Then follow the percentage that assignment ntributes towards the year mark and the student's mark for assignment 2. Ya ould not count the number of entries in the file to determine how many times th -must be read.

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 3
(10)
Write a program that will calculate a student's year marks for all his subjects. The
program must read the subject code, the assignment marks for two assignments and
the percentage that each assignment contributes towards the year mark, for each
subject that the student is registered for.
Create an input file called assignments.dat that contains the following information
for a specific student:
cos1511 30 66 70 49
cos1512 25 76 75 67
cos1521 10 58 90 62
cos1501 50 62 50 57
INF1501 40 82 60 78
INF1511 20 24 80 55
The first field in each line represents the subject code, followed by the percentage that
assignment 1 contributes towards the year mark and the student's mark (a
percentage) for assignment 1. Then follow the percentage that assignment 2
contributes towards the year mark and the student's mark for assignment 2. You
should not count the number of entries in the file to determine how many times the
file must be read.
Your program must read the file line by line, calculate the student's year mark for the
subject as a perocentage and write the subject code and the year mark to an output
file yearmark.dat. If your program works correctly, the output file will look as follows:
cos1511 54.10%
cos1512 69.25%
cos1521 61.60%
cos1501 59.50%
INF1501 79.60%
INF1511 48.80%
NB: First plan your program on paper (using your computational thinking to do so).
You have to submit your plan for your program as well as the actual program
code, input and output. Planning your program can take the form of a flowchart,
pseudocode, or notes to guide you in the development of the program.
Transcribed Image Text:Question 3 (10) Write a program that will calculate a student's year marks for all his subjects. The program must read the subject code, the assignment marks for two assignments and the percentage that each assignment contributes towards the year mark, for each subject that the student is registered for. Create an input file called assignments.dat that contains the following information for a specific student: cos1511 30 66 70 49 cos1512 25 76 75 67 cos1521 10 58 90 62 cos1501 50 62 50 57 INF1501 40 82 60 78 INF1511 20 24 80 55 The first field in each line represents the subject code, followed by the percentage that assignment 1 contributes towards the year mark and the student's mark (a percentage) for assignment 1. Then follow the percentage that assignment 2 contributes towards the year mark and the student's mark for assignment 2. You should not count the number of entries in the file to determine how many times the file must be read. Your program must read the file line by line, calculate the student's year mark for the subject as a perocentage and write the subject code and the year mark to an output file yearmark.dat. If your program works correctly, the output file will look as follows: cos1511 54.10% cos1512 69.25% cos1521 61.60% cos1501 59.50% INF1501 79.60% INF1511 48.80% NB: First plan your program on paper (using your computational thinking to do so). You have to submit your plan for your program as well as the actual program code, input and output. Planning your program can take the form of a flowchart, pseudocode, or notes to guide you in the development of the program.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

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