Ask coding questions

← Back to all posts
Should I make a report card generator?
h
HahaYes (1861)

Well... Schools about to start, well at least not for me, but for some people. Should I make a Report Card maker in C++? What libraries to include? Has someone else already made one? (and no copied code hehe)
Thanks,
HahaYes

Answered by Coder100 (18192) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18192)

EDIT: A hashmap is wayy better:

#include <map>

int main() {
  std::map<std::string, std::array<std::string, 2>> report_cards = {
    { "coder100", { "A+", "A-" } },
    { "coder100", { "A+", "A-" } },
    { "coder100", { "A+", "A-" } },
  };
}
HahaYes (1861)

@Coder100 er hashmap? why not classes?

DynamicSquid (4921)

@Coder100 why not both?

struct Grade
{
  int math;
  int science;
  int english;
  int comp_sci;
};

std::map<std::string, Grade> reportCards = {
    { "squid",  Grade{99, 88, 82, 100} }
}
HahaYes (1861)

@Coder100 I think ima wing it and do a bits/stdc++.h

HahaYes (1861)

@DynamicSquid

don't it's bad no one in the c++ comunity likes it
er... competitive programmers?

DynamicSquid (4921)

@HahaYes nope, not even them. cause that's actually not part of the C++ standard, and might not be supported on many of the competitive websites' compilers

it's just not good to use in general

HahaYes (1861)

@DynamicSquid well... in regular day to day use. no. but competitive programming? Yes. its all about SPEEEEEEED

DynamicSquid (4921)

@HahaYes NEED FOR SPEEEEEEEEEEEEEEEEEEEEEEEEEEED

no, but it's not C++ standard. another other than gcc won't accept it.

xxpertHacker (930)

@DynamicSquid Clang supports it, I tried it once, I didn't actually stick with it. Hopefully C++20 modules will make it redundant anyways.

xxpertHacker (930)

It's already been done, don't waste your time.

Bookie0 (6286)

Yes you should make one. you could also include some ascii art for like A+, A-, etc. Also since this is a generator (and not real), you can make fake names for the teachers, and their appreciation comments. Also remember to round up all the report card grades for each subject, and put the total average.

Happy coding and hope this helps! =)

HahaYes (1861)

@Bookie0 well no. I'm trying to make a report card maker, so like a spreadsheet like thing.

Bookie0 (6286)

Oh ok well I thought it was gonna be random and stuff with several different grades possible because you said generator in the title lol @HahaYes

Coder100 (18192)

Hello! You probably will want to have #include <vector> for a dynamic array.

Otherwise, you will just need iostream and you are good to go!

#include <iostream>

int main() {
  string cards[] = { "a" };
}
Coder100 (18192)

i mean you could also use struct but classes are a bit overkill @HahaYes

HahaYes (1861)

@Coder100 er why? C++ was made for classes

xxpertHacker (930)

@Coder100 In C++ struct == class, the only difference is public / private by default.

xxpertHacker (930)

@Coder100 What is that, a C array!? In C++!?