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

DHASHNI

can any one help me to write an algorithm for my program (c++) ?

  • 2 years ago
  • 2 years ago

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

    pls

    • 2 years ago
  2. KingGeorge
    Best Response
    You've already chosen the best response.
    Medals 1

    This would be better in the Computer Science area, but I can try.

    • 2 years ago
  3. DHASHNI
    Best Response
    You've already chosen the best response.
    Medals 0

    #include<fstream.h> #include<iostream.h> #include<conio.h> class student { char name [25]; char grade; float marks; public: void getdata(void); void display(void); }; void student :: getdata(void) { char ch; cin.get(ch); cout<<"Enter name : "; cin.getline(name,25); cout<<"Enter grade : "; cin>>grade; cout<<"Enter marks : "; cin>>marks; cout<<"\n"; } void student :: display(void) { cout<<"NAME : ";puts(name); cout<<"MARKS : "<<marks; cout<<"GRADE : "<<grade; cout<<"\n"; } int main() { clrscr(); student arts[3]; fstream finlin; finlin.open("stu.dat",ios::in|ios :: out); if(!finlin) { cout<<"file cannot be opened !!!!!"; return 1; } cout<<"Enter details for 3 students "; for(int i=0;i<3;i++) { arts[i].getdata(); finlin.write((char *)&arts[i],size(arts[i])); } filin.seekg(0); file.close; return 0 }

    • 2 years ago
  4. KingGeorge
    Best Response
    You've already chosen the best response.
    Medals 1

    What exactly are you trying to write here?

    • 2 years ago
  5. DHASHNI
    Best Response
    You've already chosen the best response.
    Medals 0

    i am using a file program to input and display 3 student details

    • 2 years ago
  6. KingGeorge
    Best Response
    You've already chosen the best response.
    Medals 1

    And what's going wrong for you?

    • 2 years ago
  7. DHASHNI
    Best Response
    You've already chosen the best response.
    Medals 0

    i want to write the algoritm for this program

    • 2 years ago
  8. KingGeorge
    Best Response
    You've already chosen the best response.
    Medals 1

    As far as I can tell, the algorithm is correct, you just have some errors you need to fix. At least, as far as inputting the student details. I can't see any part that displays the details.

    • 2 years ago
  9. DHASHNI
    Best Response
    You've already chosen the best response.
    Medals 0

    k

    • 2 years ago
  10. DHASHNI
    Best Response
    You've already chosen the best response.
    Medals 0

    i'll check it out thanks

    • 2 years ago
  11. KingGeorge
    Best Response
    You've already chosen the best response.
    Medals 1

    To display them, it should be almost the same, but you use the display function in the class instead of the getdata

    • 2 years 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.