In this project, you are required to build a system that helps users explore new books from their favorite genres while maintaining their purchasing budget requirements. The system tracks users that want to ensure that their chosen books do not exceed their budget. To perform this tracking, the system creates user profiles by storing personal and financial information in a file. This allows users to load their information and use it to generate books. The system should generate for the users (5 – 10) random book recommendations from a file. Based on the user budget and genre-specific requirements, the system can calculate and display statistics about the spending’s of each recommendation session and the overall user progress in terms of keeping up with their budget goal.
The program should be menu driven to allow the users to choose one of the following tasks:
- Create or load a user profile
- Edit or delete a user profile
- View user profile
- Generate book recommendations for the user
- View user books and generate budget information
- Exit the program
Here are the details of each choice that the user will be able to perform in the program:
- Create or load a user profile
When the user chooses 1, the program should perform the following tasks:
a. Check if the file ‘userInformation.txt’ exists, if it does not exist (i.e., you are running the program for the first time ever), create a new user profile by asking the user to enter the following fields to the userInformation.txt file in append mode, like the following sample input:
Join Date (string) Name (string) Year of birth (integer) Age (integer) Gender (string) Budget (float) Medium (string) Genres
(list of strings)
05:38:26 Maryam 1992 28 Female 67.0 Physical books Family,
• From the year of birth, calculate the user age. Asking the user to enter their date of birth and calculating the exact age in years is a bonus.
• The gender should be a string that corresponds to either female or male only.
• Ask the user to enter their estimated budget per book in Qatari Riyal. The entered budget cannot be less than 12 QR. If the user enters a budget below 12, ask them to enter another budget value.
• Show the user the following list of possible reading mediums to choose from:
1) Printed (i.e., physical books)
2) Digital (i.e., E-books)
3) Both digital and physical books
• The user should enter the number that corresponds to the medium that they prefer. Use a dictionary to map the number to the medium description.
• Read the file genres.csv, which contains a table of all the genres from all the books in this project and show this table to the user as follows: Number\tGenre. Number here corresponds to the line number in which the genre appears in the file, it should also be the number that the user can enter to select a particular genre.
• Ask the user to enter the number of the genre that they are interested in. The user should keep entering the number of the genre or enter -1 to stop entering genres. If the user is not interested in any specific genre, they can just enter -1 and the field Genres will be empty (empty genres are allowed).
• Once you get all the user information, store it in the userInformationFile.txt in append mode using the following order (with \t as a separator):
Join_date\tName\tYearofBirth(or DOB for bonus)\tAge\tGender\tBudget\tMedium\tGenres\tEditDate
• Get the current date and time as a variable, called Joindate and convert it to string, then write it to the userInformation.txt file.
• For now, keep the field EditDate empty, you will fill it later.
b. If the file ‘userInformation.txt’ exists, ask the user if they created a profile before. If the user answers no (n or N), show the user all the steps in (a). However, if the user answers with yes (Y or y) (i.e., they did create a profile before and the information exists in the file userInformation.txt), perform the following:
• Ask the user to enter the name that they used to register their profile.
• Open the file userInformation.txt in read mode, and search for the user information using the name that the user provided.
• If the user makes a spelling mistake, keep asking the user to enter their name until it is found in the file.
• If the user name is found successfully in the userInformation.txt file, load it in the program (i.e., return the information to the user).
- Edit or delete a user profile
When the user chooses 2, the first thing that it should do is to check whether the user information is loaded in the program (i.e., check if the user information is passed to the function that generates recipe recommendations). If the user information is passed to the function (i.e., the user chose option 1 before choosing option 2), the program should show the user the following menu:
Hello (user name)
You can perform one of the following operations:
1) Delete your profile
2) Edit your profile
a. If the user chooses 1, perform the following subtasks to delete a user profile:
1- Search for the user profile in the file userInformation.txt using the user name in read mode; once you find the user profile (i.e., the line that contains all the user information), pass it to a function that deletes the user information.
2- The function should create a temporary file called temp.txt in write mode and search the file userInformation.txt in read mode for the user that you want to delete (the user returned by the previous step). Write all the content of the file userInformation.txt in the file temp.txt so long as the user is not there, in other words, do not write (delete) the user. The end of this process should yield a file called temp.txt that does not include the user.
3- Use the os module to delete the file userInformation.txt, then use it to rename the file temp.txt as userInformation.txt.
4- Print to the user a message stating that the record was deleted successfully.
5- If the file userInformation.txt contains just one user profile and you chose to delete this user, delete the file.
6- Make sure you also delete or clear the contents of the variable userInformation when you return to the main menu after successfully deleting the user profile.
b. If the user chooses 2, perform the following subtasks to edit a user profile:
Show the user the following menu, which displays the records that they can edit:
Hello (user name)
These are the fields that you can edit in your profile:
2) Year of birth (or Date of Birth for bonus)
6) Favorite genres
1- If the user enters the number 1, perform the following:
1) Ask the user to enter their new user name.
2) Create a new record of user information that replaces the old name with the new name but keeps all the other fields the same (use string concatenation to do this).
3) Add the edit date to the end of the new user information record, this date corresponds to the date and time in which the user edited their profile.
4) Then, call a function that takes the old user information and the new user information.
5) The function should read the contents of the file userInformation.txt and write it to the file temp.txt, at the same time, search for the old user information, if found, replace it with the new user information and write it to the file temp.txt.
6) Just like what you did in deleting a file, delete the file userInformation.txt, then rename the file temp.txt to userInformation.txt.
7) Make sure you also delete or clear the contents of the variable userInformation when you return to the main menu after successfully deleting the user profile.
2- If the user selects the number 2, perform the following:
1) Ask the user to enter their new year or date of birth, using this information, re-calculate the user age.
2) Create a new record of user information that replaces the old year of birth or date of birth with the new information, replace the age with the new age, keep the other fields the same (use string concatenation to do this).
3) Repeat steps 3) to 7) from (a).
3- If the user selects the number 3, perform the following:
1) Ask the user to enter their new gender..
2) Create a new record of user information that replaces the old gender with the new gender. The other fields should remain the same (use string concatenation to do this).
4- If the user selects the number 4, perform the following:
4) Ask the user to enter their new budget.
5) Create a new record of user information that replaces the old budget with the new budget, keep the other fields the same (use string concatenation to do this).
6) Repeat steps 3) to 7) from (a).
5- If the user selects the number 5, perform the following:
7) Ask the user to enter their new favorite medium.
8) Create a new record of user information that replaces the old medium with the new medium, keep the other fields the same (use string concatenation to do this).
9) Repeat steps 3) to 7) from (a).
6- If the user selects the number 6, perform the following:
1) Ask the user to enter the new list of genres, just like the way you did when the user creates anew profile.
2) Create a new record of user information that replaces the old genres with the new genres but keeps all the other fields the same (use string concatenation to do this).
3) Repeat steps 3) to 7) from (a).
- View user profile
When the user chooses 3, the first thing that it should do is to check whether the user information is loaded in the program (i.e., check if the user information is passed to the function that generates book recommendations). If the user information is not passed to the function (i.e., the user did not chose option 1 before choosing option 3), call the function that allows the user to either load or create a user profile (option 1 from the main menu). Otherwise, perform the following tasks:
• Open the file userInformation.txt in read mode and retrieve (i.e., read) and print the following user information:
o Join date
o Edit date (if available, don’t show it if it doesn’t exist)
o User name.
o Year of birth or date of birth as bonus.
o Budget per book.
o Favorite medium.
o Favorite genre(s).
Text review of this paper: This page of the article has 2111 words. Download the full form above. The United States is home to the absolute generally famous and productive chronic executioners ever. Names, for example, Ted Bundy, Gary Ridgeway, and the Zodiac Killer have become commonly recognized names because of the horrendous idea of their wrongdoings. One of the most productive chronic executioners in American history is John Wayne Gacy. Nicknamed the Killer Clown due to his calling, Gacy assaulted and killed in any event 33 adolescent young men and youngsters somewhere in the range of 1972 and 1978, which is one of the most elevated realized casualty checks. Gacy's story has become so notable that his violations have been included in mainstream society and TV shows, for example, American Horror Story: Hotel and Criminal Minds. Legal science has, and keeps on playing, a significant part in the comprehending of the case and distinguishing proof of the people in question. John Wayne Gacy's set of experiences of sexual and psychological mistreatment was instrumental in provoking agent's curiosity of him as a suspect. John Wayne Gacy was conceived on March 17, 1942, in Chicago, Illinois. Being the main child out of three kids, Gacy had a stressed relationship with his dad, who drank intensely and was regularly oppressive towards the whole family (Sullivan and Maiken 48). In 1949, a contractual worker, who was a family companion, would stroke Gacy during rides in his truck; in any case, Gacy never uncovered these experiences to his folks inspired by a paranoid fear of reprisal from his dad (Foreman 54). His dad's mental maltreatment proceeded into his young grown-up years, and Gacy moved to Las Vegas where he worked quickly in the rescue vehicle administration prior to turning into a morgue specialist (Sullivan and Maiken 50). As a morgue specialist, Gacy was intensely associated with the preserving cycle and conceded that one night, he moved into the casket of a perished young kid and touched the body (Cahill and Ewing 46). Stunned at himself, Gacy re-visitations of Chicago to live with his family and graduates from Northwestern Business College in 1963, and acknowledges an administration learner position with Nunn-Bush Shoe Company. In 1964, Gacy is moved to Springfield and meets his future spouse, Marlynn Myers. In Springfield, Gacy has his subsequent gay experience when an associate shakily performed oral sex on him (London 11:7). Gacy moves to Waterloo, Iowa, and starts a family with Myers. Nonetheless, after consistently undermining his better half with whores, Gacy submits his originally known rape in 1967 upon Donald Vorhees. In the coming months, Gacy explicitly mishandles a few different adolescents and is captured and accused of oral homosexuality (Sullivan and Maiken 60). On December 3, 1968, Gacy is indicted and condemned to ten years at the Anamosa State Penitentiary. Gacy turns into a model detainee at Anamosa and is allowed parole in June of 1970, an only a brief time after his condemning. He had to move to Chicago and live with his mom and watch a 10:00PM check in time. Not exactly a year later, Gacy is accused again of explicitly attacking a high school kid however the young didn't show up in court, so the charges were dropped. Gacy was known by numerous individuals in his locale to be an enthusiastic volunteer and being dynamic in network governmental issues. His part as "Pogo the Clown" the jokester started in 1975 when Gacy joined a neighborhood "Carefree Joker" comedian club that consistently performed at raising support functions. On January 3, 1972, Gacy submits his first homicide of Timothy McCoy, a 16-year old kid going from Michigan to Omaha. Asserting that McCoy went into his room employing a kitchen blade, Gacy gets into an actual fight with McCoy prior to cutting him over and over in the chest. Subsequent to understanding that McCoy had absentmindedly strolled into the stay with the blade while attempting to get ready breakfast, Gacy covers the body in his slither space. Gacy conceded in the meetings following his capture that executing McCoy gave him a "mind-desensitizing climax", expressing that this homicide was the point at which he "understood passing was a definitive rush" (Cahill and Ewing 349). Just about 2 years after the fact, Gacy submits his second homicide of a unidentified adolescent. Gacy choked the kid prior to stuffing the body in his storeroom prior to covering him (Cahill 349). In 1975, Gacy's business was developing rapidly and his hunger for youngsters developed with it. Gacy frequently attracted youngsters under his work to his home, persuading them to place themselves in binds, and assaulting and tormenting them prior to choking them (Cahill 169-170). A large portion of Gacy's homicides occurred somewhere in the range of 1976 and 1978, the first of this time occurring in April 1976. A significant number of the adolescents that were killed during this time were covered in a creep space under Gacy's home. For the rest of the killings, Gacy confessed to throwing five bodies off the I-55 extension into the Des Plaines River; nonetheless, just four of the bodies were ever recouped (Linedecker 152). In December 1978, Gacy meets Robert Jerome Piest, a 15-year old kid working at a drug store and extends to him an employment opportunity at Gacy's firm. Piest advises his mom regarding this and neglects to restore that night. The Piest family documents a missing individual's report and the drug specialist illuminates police that Gacy would undoubtedly be the man that Jerome addressed about a work. When addressed by the police, Gacy denied any inclusion in Piest's vanishing. In any case, the police were not persuaded, and Gacy's set of experiences of sexual maltreatment and battery provoked the police to look through his home. Among the things found at Gacy's home were a 1975 secondary school class ring with the initials J.A.S., different driver's licenses, binds, attire that was excessively little for Gacy, and a receipt for the drug store that Piest had worked at. Throughout the following scarcely any days, examiners got different calls and tips about Gacy's rapes and the secretive vanishings of Gacy's workers. The class ring was inevitably followed back to John A. Szyc, one of Gacy's casualties in 1977. Futhermore, after inspecting Gacy's vehicle, examiners found a little bunch of strands looking like human hair, which were shipped off the labs for additional investigation. That very night, search canines were utilized to identify any hint of Piest in Gacy's vehicle, and one of the canines demonstrated that Piest had, indeed, been available in the vehicle. On December 20, 1977, under the pressure of steady police reconnaissance and examination, Gacy admits to more than 30 killings and illuminates his legal counselor and companion where the bodies were covered, both in the slither space and the stream. 26 casualties were found in the creep space and 4 in the stream. Gacy is captured, indicted for 33 killings, and condemned to death by deadly infusion. He endeavored a madness request yet was denied, and was executed on May 10, 1994. There were a few scientific pointers that examiners used to attach Gacy to the homicides. A portion of these include fiber investigation, dental and radiology records, utilizing the deterioration cycle of the human body, and facial recreation in distinguishing the people in question. Agents discovered strands that looked like human hair in both Gacy's vehicle and close to the creep space where the bodies were covered. Notwithstanding these hair tests, specialists additionally discovered filaments that contained hints of Gacy's blood and semen in a similar territory. Blood having a place with the casualties was found on a portion of the strands, which would later legitimately attach Gacy to the wrongdoings. The filaments in Gacy's vehicle were examined by legal researchers and coordinated Piest's hair tests. Besides, the hunt canines that verified that Piest had been in Gacy's vehicle showed this by a "passing response", which told specialists that Piest's dead body had been within Gacy's vehicle. Out of Gacy's 33 known casualties, just 25 were ever indisputably distinguished. A considerable lot of Gacy's casualties had comparative actual depictions and were thusly difficult to recognize by absolutely asking the general population. To distinguish the people in question, examiners went to Betty Pat Gatliff, a pioneer in criminological science and facial reproduction. Facial remaking is the way toward reproducing the facial highlights of a person by utilizing their remaining parts. Certain facial highlights, for example, facial structures, nasal structure, and in general face shape can be valuable in recognizing a casualty even long in the afterlife. By utilizing these highlights, and with the assistance of program, criminological specialists can make a picture of an individual's face, which is instrumental in recognizing casualties after their bodies have rotted. Facial reproduction should be possible in a few measurements. Two-dimensional facial recreations is utilized with skull radiographs and depend on pre-passing photos and data. Notwithstanding, this isn't really ideal on the grounds that cranial highlights are not generally noticeable or at the correct scale (Downing). So as to get a practical and more precise portrayal of the casualty's face, a craftsman and a legal anthropologist are typically essential (Downing). Three-dimensional facial remaking is finished by models or high goal, three-dimensional pictures. PC programs can make facial reproductions by controlling examined photos of the remaining parts and use approximations to reproduce facial highlights. These will in general deliver results that don't look fake (Reichs and Craig 491). In some cases, specialists will utilize a strategy called superimposition as a method for facial recreation. Sadly, it's anything but a usually utilized technique, as it expects examiners to have some information about the character of the remaining parts they are managing. By superimposing a photo of a person over the skeletal remaining parts, specialists can check whether the facial highlights line up with the anatomical highlights, permitting them to distinguish a casualty. On account of John Wayne Gacy's casualties, specialists had the option to utilize facial recreation to recognize nine of the bodies found in the creep space. The accompanying realistic shows the facial recon>GET ANSWER