Student Report Card

I need some help with a student report card program for school. I am just a beginner and it is presently above my head. The program statements should be all written inside of main and be 100 lines long. Would someone with experience write some code for me and post it? I have the instructions and will upload them when I learn how.
1/27/2020 1:04pm
Thanks for the post!
My intention is not to copy and past the code. I want to use it to rewrite some code of my own. I just need the example.

To reply on my assignment for class is the following.
Assignment 2: Student report Card

Create a program that will read an input file and
create an output file for a student report card. The input file will contain basic student name information, grade information, and attendance. The program should print out the information in a specific spaced format, included. The program should calculate the attendance percentage. There will be 10 individual homework grades to average for a homework average. The homework average accounts for 55% of the final grade. The midterm accounts for 20% of the final grade. The final exam accounts for 25% of the final grade. The foundation of this assignment is based on assignment 1. You should use that program as a starting point.
Console
Processing Complete!!!

Specifications
• Included will be 4 input files. They will be labeled inData.txt, inData2.txt, inData3.txt, and inData4.txt.
• You will have individual variables to for each field in the input file, 17 in all.
• Fields will include: first name, last name, grade level, homework1, homework2, homework3, homework4, homework5, homework6, homework7, homework8, homework9, homework10, midterm exam, final exam, present and absence.
• The calculations for the final grade is:
Finalgrade = (homework * 55%) + (midterm * 20%) + (final * 25%)
• These are functions you will use: setw, left, right, fixed, showpoint, setprecision, static_cast
• The attendance fields should be fields without decimal places.
• The grades, averages, and percentages should have 2 decimal places.
• The width of the card should be 60 characters width.
• There are 3 lines with specific spacing:
• First line:
• |<---10---->|<--------21-------->|<----13----->|<---10---->|
• Second Line:
• |<---10---->|<------18------->|<---10---->|<------17------>|
• Remaining Lines:
• |<----------25----------->|<-------19-------->|<----12---->|
• Refer to Assignment 2 files, attached
• Assume the data in the input files is valid data.

ssignment 1: Student Grade Calculation
Create a program that allows an instructor the ability to enter student name and grade information. The program should calculate with the student will complete the course with. The homework average accounts for 55% of the final grade. The midterm accounts for 20% of the final grade. The final exam accounts for 25% of the final grade.
Console
Student Grade Calculation Form

First Name:
Last Name:
Homework Average: 95.5
Midterm Grade: 50
Final Exam Grade: 75

Student:
Completed the course with a final grade of: 81.275
Specifications
• The user’s full name consists of the user’s first name, a space, and the user’s last name.
• The program should accept decimal entries like 52.31 and 15.5.
• The program should have 3 CONST fields for the weight of each grade type; homework, midterm, and final grade.
• The calculations for the final grade is:
Finalgrade = (homework * 55%) + (midterm * 20%) + (final * 25%)
• Assume the user will enter valid data.
udent_Grade_Calculation_3.cpp : This file contains the 'main' function. Program execution begins and ends there.


//*************************************************
// This program calculates a student Final Grade. *
//*************************************************

#include<iostream> //header file for input/output
#include<string> //header file for string input/output

using namespace std;

const double AVG = 95.5; //constant declared and initialized
const double GRADE = 50; //constant declared and initialized
const double FINAL = 75;//constant declared and initialized





int main()
{
double finalGrade; //double variable declared
string firstName; //string declared
string lastName; //string declared
string student; //string declared
cout << " Student Grade Calculation Form" << endl;
cout << " Enter first name: ";
cin >> firstName;
cout << " Enter last name: ";
cin >> lastName;
cout << endl;

finalGrade = (AVG * .55) + (GRADE * .20) + (FINAL * .25);
student = firstName + " " + lastName;

system("CLS"); // clears the screen

cout << " First Name: " << firstName << endl;
cout << " Last Name: " << lastName << endl;
cout << " Homework Average: " << AVG << endl;
cout << " Midterm Grade: " << GRADE << endl;
cout << " Final Exam Grade: " << FINAL << endl;
cout << endl;
cout << " Student: " << student << endl;
cout << " Completed the course with "
<< "a final grade of: " << finalGrade << endl;

system("Pause"); // pauses the screen until a key from the keyboard is pressed

return 0;




}
Last edited on
Hello hcool3,

This is your school work, so you need to post the code that you have started with. From there you can ask questions and get help as needed.

When posting code;

PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code.

Along with the proper indenting it makes it easier to read your code and also easier to respond to your post.

http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/

Hint: You can edit your post, highlight your code and press the <> formatting button.

You can use the preview button at the bottom to see how it looks.

I found the second link to be the most help.




The program statements should be all written inside of main and be 100 lines long.


This says to me that some of the code that you write will have to be condensed into one line to save space. A good learning experience.


Would someone with experience write some code for me and post it?


Careful with a statement like that. You could get a response using code that is well beyond what you can use right now.


I have the instructions and will upload them when I learn how.


Until you post the instruction no one has any idea of what the program should do or how to write it.

Just like you did with your first post click on "reply" this time and start typing or copy and past the instructions. It is best if you post what you were give and not your idea of what you think they mean.

Andy
this is the best i got. I will say that anyone asking questions like this should definitely be doing the work themselves bc you ain't never going to learn just copying and pasting other peoples code. But I used this as a learning experience for myself so i figured i'd at least post the result. Obviously i can't promise this is what your teacher is looking for bc it was such a weak description but. this was my take on what you asked for.

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
#include <iostream>
#include <string>
using namespace std;
class ReportCard
{
public:
    string TeacherName; string StudentName; string Date; string GradingPeriod;
   struct Subject
   {
   public:
   string subject; string grade;
};
   Subject Math;
   Subject English;
   Subject Science;
   Subject Band;
   Subject Lunch;
   Subject Grabass;
   Subject Coding;
};


void Print(string arg) { cout << arg << endl; }

void PrintReportCard(ReportCard card)
{
    Print("Student Name: " + card.StudentName);
    Print("Teacher Name: " + card.TeacherName);
    Print("Grading Period: " + card.GradingPeriod);
    Print("Date: " + card.Date);
    Print("Science: " + card.Science.grade);
    Print("Math: " + card.Math.grade);
    Print("Lunch: " + card.Lunch.grade);
    Print("Coding: " + card.Coding.grade);
}

int main()
{  
ReportCard Mark_B; 
Mark_B.Date = "1/26/2020";
Mark_B.GradingPeriod = "4th";
Mark_B.StudentName = "Mark B.";
Mark_B.TeacherName = "Teach Name";
Mark_B.Math.grade = "B+";
Mark_B.Science.grade = "C-";
Mark_B.Lunch.grade = "D+";
Mark_B.Coding.grade = "F-";
PrintReportCard(Mark_B);
  
}


i'd like to add that a couple things like the date and grading period could be static members of the class. I couldn't get that to work without an error... also this isn't 100% complete. it does compile ect but it could be tweaked. like ReportCard.Subject.subject could be like a string definition to what they represent. Which would look like Mark_B.Math.subject="Math" then that could be used to print out or whatever. Or the Subject Struct could probably be eliminated entirely and just define a like 10 generic subject variables in the ReportCard class and then give that generic name a value equal to the string. Hence like Mark_B.subject1="Math" then obviously then to set the grade it would be Mark_B.subject1.grade. It just all depends on how they wanted it formatted. Having the name of the subject in the variable name i think makes it easier to deal with.

Would someone with experience write some code for me and post it?
@hcool3, No need to wait that long. I'm taking that class and set that exercise. If you send me your student ID I'll arrange for you to get the appropriate course credit.
Hello hcool3,


Create a program that will read an input file


So where is the input file and what does the information look like? Post the input file or at least a fair sample, 5 to 10 (records or lines), Enough so others know what to work with.


• Included will be 4 input files. They will be labeled inData.txt, inData2.txt, inData3.txt, and inData4.txt.


If these files contain the same format only one is needed. If the information is different, more or less fields or different order, then post all files that are different.


• Fields will include: first name, last name, grade level, homework1, homework2, homework3, homework4, homework5, homework6, homework7, homework8, homework9, homework10, midterm exam, final exam, present and absence.


This gives you an idea of what variables are needed for the program, but may not reflect the correct order that the file is in.

It is hard to write any program when you do not know what you are working with.

The code for the main file/function is a good start, but needs a lot of work to produce what you want.

Some tips for the future: Do not edit your OP, (original post) and sometimes to mean the original poster, This just confused people and is more likely to reduce the responses if someone see nothing wrong with the code that you have changed. In this case the additional information works. It is better to put anything new in a reply to the thread.

Refer back to my first response and PLEASE ALWAYS USE CODE TAGS. If you are having a problem understanding this say so and the issue can be addressed.

The program has these constant variables:
1
2
3
const double AVG = 95.5; //constant declared and initialized
const double GRADE = 50; //constant declared and initialized
const double FINAL = 75;//constant declared and initialized 

Not sure what they are for or why there are there, but I do not believe these art the constants the instructions are referring to.

Given this:

• Fields will include: first name, last name, grade level, homework1, homework2, homework3, homework4, homework5, homework6, homework7, homework8, homework9, homework10, midterm exam, final exam, present and absence.


I am think of creating a struct to hold the information since there are strings, doubles and ints in the file. Then store this in a vector, but I do not know if you know about vectors yet. I am also considering this to be the correct order of the file, but it could not be.

Instead of posting what you were given, although helpful, post what you have done so far so everyone knowaswhat you are working with.

Andy
Topic archived. No new replies allowed.