Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Aotto

Write a program that will allow you to enter any number of students with five grades for each student. Calculate each student's average and store the student's name, grades and average to a data file.

  • one year ago
  • one year ago

  • This Question is Open
  1. pottersheep
    Best Response
    You've already chosen the best response.
    Medals 0

    You want us to write you the program?

    • one year ago
  2. pottersheep
    Best Response
    You've already chosen the best response.
    Medals 0

    What's your plan?

    • one year ago
  3. harsimran_hs4
    Best Response
    You've already chosen the best response.
    Medals 0

    Do write something about what you have done so far if any psuedocode you have written post it here or any algorithm you have in mind

    • one year ago
  4. goodz
    Best Response
    You've already chosen the best response.
    Medals 0

    int students; int temp; int total = 0; // get the number of students // loop it that many times // for one student for(int i=0; i < 5; i++){ cout << "Enter score" << endl; cin >> temp; total += temp; } cout << total / 5 << endl;

    • one year ago
  5. harsimran_hs4
    Best Response
    You've already chosen the best response.
    Medals 0

    well don`t know cpp but still this should work and put total/5 inside the for loop`s body

    • one year ago
  6. Meepi
    Best Response
    You've already chosen the best response.
    Medals 1

    struct student_data { string name; double grades[5]; double average; }; student_data getStudentData(); void writeStudentData(student_data); int main() { int students = 1; cin >> students; for(int i = 0; i < students; i++) { student_data s = getStudentData(); writeStudentData(s); } } student_data getStudentData() { get input for the name and the grades here, and calculate the average (store the data in a Student struct, and return it) } void writeStudentData(student_data s) { write the data to a file using fstream library, you could also take an extra string argument to specify file location } My C++ is a bit rusty, but I hope this helps :) I left the two methods blank since you should try to do them yourself first

    • one year ago
  7. poopsiedoodle
    Best Response
    You've already chosen the best response.
    Medals 0

    it doesn't even specify a language.

    • one year ago
  8. poopsiedoodle
    Best Response
    You've already chosen the best response.
    Medals 0

    can I write it in gibberish? I'm gonna write it in gibberish. RHAUGK WWJHBJCVHJ KBCAW. There's your program :D good luck.

    • one year ago
  9. poopsiedoodle
    Best Response
    You've already chosen the best response.
    Medals 0

    but really, if you're taking the class, you should know this. It's not even that hard from what I've read up there.

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.