Question

In: Computer Science

Build a C program project about Personal diary which will have daily note add, remove ,...

Build a C program project about Personal diary which will have daily note add, remove , edit , search, and view notes system. Write the appropriate comment in your code. Comment writing is mandatory. describe your logic, purpose of a function, purpose of the variable etc need to be described in the comment.

Solutions

Expert Solution

//You have not mentioned what are the attributes of diary product. Hence I am assuming it by myself.

//Name, id, address

struct PersonalDiary

{

char name[50];

int id;

char address[100];
};

void add(struct PersonalDiary diary);

void remove(struct PersonalDiary diary);

void edit(struct PersonalDiary diary);

void search(struct PersonalDiary diary, int myId);

void view(struct PersonalDiary diary);

int main(){

struct PersonalDiary diary;

int res=0;

printf("Please select from following 1. add 2. remove 3. edit 4. seach 5.view ");

int choice;

scanf("%d",&choice);

switch(choice){

case 1: add(diary);

break;

case 2: remove(diary);

break;

case 3: edit(diary);

break;

case 4:

int myid;

scanf("%d",&myid);

search(diary,myid);

break;

case 5: view(diary);

break;

}

return 0;

}

void add(struct PersonalDiary diary){

//You can make this user specific by using scanf()

strcpy(diary.name,"2020 diary");

strcpy(diary.id,12904);

strcpy(diary.address,"German Bakery,Pune");

}

void remove(struct PersonalDiary diary){

diary.name=null;

diary.id=0;

diary.address=null;

}

int search(struct PersonalDiary diary, int id){

if(diary.id==id) return "found";

else return "not found";

}

void edit(struct PersonalDiary diary){

//It must be user manual;

char[50] myname;

scanf("%s",&myname)

strcpr(diary.name,myname);

}

void view(struct PersonalDiary diary){

printf("Name ",&diary.name);

printf("id ",&diary.id);

printf("address ",&diary.address);

}


Related Solutions

(C++ program) ***User Interface Write a program that offers an easy way to add items, remove...
(C++ program) ***User Interface Write a program that offers an easy way to add items, remove the last item, look at the last item put in the list. You will write all of the code for processing the stack - do not use any predefined objects in C++.  You decide how the interface will look. A menu driven program is always a good choice. ***Rules for program*** NEVER use break, exit, return, pass, continue or anything to leave a loop (or...
Write a Java Program that can:​ Remove a particular element from an array.​ Add a new...
Write a Java Program that can:​ Remove a particular element from an array.​ Add a new element to an array.​ Change an element with the new one.​ Search for a particular element in the array.​ ​The code must have four separate methods for each task stated above.​ Do not use any pre-defined Java functions.​ You are free to use int or String data-type for the array.​
How can the use of a personal spending diary assist you in achieving financial goals? Which...
How can the use of a personal spending diary assist you in achieving financial goals? Which categories did you include for your spending diary? Also, indicate why you did or did not choose to track additional items on a separate basis. What did your spending diary reveal about your spending habits during the time period covering this first installment? What areas of spending would you consider changing? How can your spending diary assist you with career planning activities? How can...
Description In C# Further enhance the registration program for Continental University. Add more attributes about a...
Description In C# Further enhance the registration program for Continental University. Add more attributes about a student, including gender, residency (in-state or out-state), and entrance date. Allow the user to repeatedly enter student information until the user wants to quit. When the user enters an invalid value, ask the user to repeatedly enter the value until a valid value has been entered. Gender must be ‘M’ or ‘F’. Residency must be ‘I’ or ‘O’. Display a short summary after each...
C++ PROGRAMMING In the linked-list based bag implementation, we demonstrated the functionalities, such as, add, remove,...
C++ PROGRAMMING In the linked-list based bag implementation, we demonstrated the functionalities, such as, add, remove, and list. This assignment is to extend the functionalities of the bag with other operations average, min, and max, You need to extend the Bag class (under Wk 2, BagLinked_List.cpp) with the following methods: -int Bag::min( ), is to find minimum of items of the bag. -int Bag::max( ), is to find maximum of items of the bag -float Bag::ave( ), is to find...
problem 3-1 You are going to build a C++ program which runs a single game of...
problem 3-1 You are going to build a C++ program which runs a single game of Rock, Paper, Scissors. Two players (a human player and a computer player) will compete and individually choose Rock, Paper, or Scissors. They will then simultaneously declare their choices and the winner is determined by comparing the players’ choices. Rock beats Scissors. Scissors beats Paper. Paper beats Rock. The learning objectives of this task is to help develop your understanding of abstract classes, inheritance, and...
bus reservation system code using c language in this system we can add seat and remove....
bus reservation system code using c language in this system we can add seat and remove. this code will be in c language using 2 d aray
Add an item to a Text File / C++ the program will prompt for a filename...
Add an item to a Text File / C++ the program will prompt for a filename AND then prompt for a text file item. text file items always contain an unknown amount of spaces, (see getline). Allow the user to put both the filename and the extensions, like groceries.txt or retirementToDo.clist Don't add any directory information to the filenames, use them as typed. If the file does exist, the item will be APPENDED to the end of the file. If...
Design a simple calculator program using C++ which is able to: 1. ADD two decimal numbers...
Design a simple calculator program using C++ which is able to: 1. ADD two decimal numbers 2. MULTIPLY two decimal numbers. The following features must be incorporated in your program. 1. Must have an interface for the user to be able to either select the ADD option or MULTIPLY option or to EXIT the program. NOTE: If the user makes a wrong selection, a display must be shown to inform the user and the user must be given a choice...
hi,I have this C++ program,can someone add few comments with explanation what is the logic and...
hi,I have this C++ program,can someone add few comments with explanation what is the logic and what is what?thank you I m total beginner #include <iostream> using namespace std; int ArraySum(int MyArray[], int size){ int* p = MyArray; int sum = 0; while(p<MyArray+size){ sum += *p; p++; } return sum; } int main() { int MyArray[10] = {4, 0, 453, 1029, 44, 67, 111, 887, 4003, 1002}; cout<<ArraySum(MyArray,10); return 0; }
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT