Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Videos

Question
Book Icon
Chapter 12, Problem 3PE
Program Plan Intro

Tracking conference attendees

Program plan:

  • Import the package.
  • Create a class “Conference_Manager”,
    • Define the “_init_()” function,
      • Create empty list.
      • Open the input file in read mode.
      • Read all the characters from the file using “read()”.
      • Parse the json string using “json_loads()”.
      • Create a “for” loop to iterate all the keys which are obtained from “json_object”.
        • Assign initial values by invoking “_init_()”.
        • Append the value at the end of the list.
      • Close the input file.
    • Define the getter method “get_JSON()”,
      • Return the key, value pairs get from “json_object”.
    • Define the getter method “get_Attendee()”,
      • Create “for” loop to iterate over elements of list.
        • Check whether the value return from “get_Name()” is equal to the value stored in “name,
          • Return the list.
    • Define the getter method “find_ByState()”,
      • Create a list.
      • Create “for” loop to iterate over elements of list.
        • Check whether the value return from “get_State()” is equal to the value stored in “state”,
          • If it is true, append the value to the end of the list.
      • Return the list.
    • Define the getter method “make_Attendee()”,
      • Assign the value to the list return from “_init_ ()” method from Attendee class.
      • Append the value to the end of the list.
    • Define the method “del_Attendee()”,
      • Create for loop,
        • Check whether the name is return from “get_name()”,
          • If it is true, remove the element using “pop()”.
    • Define the method “update_Conference()”,
      • Create a list.
      • Create for loop,
        • Check whether the name is return from “get_name()”,
          • Append the value to the end of the list.
            • Open the output file in write mode,
              • Serialize the object as a JSON formatted stream using “json_dump()”.
  • Create a class “Attendee”,
    • Define the function “_init_()”,
      • Assign the initial values for the variables.
    • Define the getter method “get_Name()” to return the value stored in “name”.
    • Define the getter method “get_Company()” to return the value stored in “company”.
    • Define the getter method “get_State()” to return the value stored in “state”.
    • Define the getter method “get_Email()” to return the value stored in “email”.
    • Define the method “display_Info()” to print the formatted output.
  • Define the “main()” function,
    • Call the constructor to initialize the values.
    • Call “make_Attendee()” function.
    • Assign the value return from “get_Attendee()”.
    • Assign the value return from “find_ByState()”.
    • Print the value return from “get_Company()”.
    • Print the value return from “get_Name()”.
    • Print the value return from “get_Sate()”.
    • Print the value return from “get_Email()”.
    • Call the function “display_Info()”.
    • Create for loop,
      • Print the value return from “get_Name()”.
  • Call the “main()” function.

Blurred answer
Students have asked these similar questions
Create a datafile that contains the first name, last name, gender, age, height, smoking preference, eye color and phone number. Add a variety of records to the file. A sample file looks like:  Write a program that opens the file and reads the records one by one. The program will skip any records where the gender preference is not a match. Of those records that match the gender preference, check to see if the age and height are between the maximum and minum preferences. Then check to see if the smoking preference and eye color are also a match. If at least 3 of the remaining fields match, consider the record a partial match, and print it in the report. If all 4 of the remaining fields match, the record is a perfect match and print it in the report with an asterisk next to it. At the end of the program, close the file and report how many total records there were of the specified gender, how many were a partial match, and how many were a perfect match.
A temperature file consists of five records, each containing a temperature in degrees Fahrenheit. A program is to be written that will read the input temperature, convert it from degrees Fahrenheit to degrees Celsius and print both temperatures in two columns on a report. Column headings, which read ‘Degrees F’ and ‘Degrees C’, are to be printed at the top of the page. What ist he best solution algorithm to successfully implement the above question?
Write an application  that allows a user to input customer records (ID number, first & last name, and balance owed) and save each record to a file
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Files & File Systems: Crash Course Computer Science #20; Author: CrashCourse;https://www.youtube.com/watch?v=KN8YgJnShPM;License: Standard YouTube License, CC-BY
UNIX Programming (Part - 10) The File System (Directories and Files Names); Author: ITUTEES;https://www.youtube.com/watch?v=K35faWBhzrw;License: Standard Youtube License