{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

program5 - Includes almost all course labs and 4 projects

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
/ *********************************************************************** *******/ //Item Points Actual // Possible Points //Pasting this table in your writeup 1 //Your name 1 //Description 1 //Function Comments 5 //(parameters, pre/post conditions, //descriptions) //Variable comments 2 //Use of functions 4 //Display menu 4 //Read in from File 7 //Write to File 7 //Search 7 //Add 4 //Delete 4 //3 test cases 3 / *********************************************************************** *******/ // Tom Nanke // CIS 150-001 // 12-11-07 // Program 5 // This is a computer rolodex program. It stores the information of people on // cards. This information includes their last name, followed by their first // name, then their phone number, and lastly their email address. The program
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
// allows you to read in the card info from a file, write that info to another // file, add a card to the list, delete a card, and search for a card by last // name. Expected input would be the user's decision of which action to take, // followed by any information he/she is prompted for. Expected output would be // for the computer to perform whichever action the user wants performed. When // the user chooses to print the rolodex onto the screen, the computer should // successfully output the card information. #include<iostream> #include<string> #include<fstream> using namespace std; struct person //this structure contains the information of a person { //that will be stored on each card int cardCount; //a count of how many cards there are string lastName; //variable represents the last name of the person string firstName; //variable represents the first name of the person string phone; //variable represents the phone # of the person string email; //variable represents the email address of the person }; class Cards //a class named Cards will be used { public: int cardCount; //a count of how many cards there are Cards(); //constructor void Add(person card[], person newCard); //function prototype void Delete(person card[], person newCard); //function prototype void Search(person card[], person newCard); //function prototype }; Cards::Cards()//this constructor initializes the cardCount to 0 { cardCount=0; } void Cards::Add(person card[], person newCard) {//adds a new card to the list //parameters are an array of structs, which are the cards, and a single //struct, which is the card the user wants to add //pre-cond:array not full //post-cond:cardCount is incremented by 1 because a new card was added cardCount=card[24].cardCount; //an explanation of using 24 here is card[cardCount].lastName=newCard.lastName; //given in my main
Image of page 2
card[cardCount].firstName=newCard.firstName;
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern