Concept explainers
Employee Management System
This exercise assumes you have created the Employee class for
■ Look up an employee in the dictionary
■ Add a new employee to the dictionary
■ Change an existing employee's name, department, and job title in the dictionary
■ Delete an employee from the dictionary
■ Quit the program
When the program ends, it should pickle the dictionary and save it to a file. Each time the program starts, it should try to load the pickled dictionary from the file. If the file does not exist, the program should start with an empty dictionary.
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Starting Out with Python (4th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Problem Solving with C++ (10th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
- Write a class Movie. It should have attributes for the following data: The movie’s name. A dictionary initialized with 5 key/value pairs: The keys should be the numbers 1 through 5, and each value should be initialized to 0. The values signify how many reviews the movie has received with that many stars. i.e., If key 1 is paired with the value 3, that means 3 users have given the movie 1 star. An int variable num_reviews, which tracks how many reviews the film has received. A constructor that accepts the movie’s name as an argument, sets num_reviews to 0, and initializes the dictionary. It should have the following methods: A property setter and getter for the movie’s name. add_review, which can only be passed the values 1 through 5. As an example, if ‘2’ is passed, that means a review of 2 stars is being added: increment the value associated with the key ‘2’ by one. __str__: Print the movie’s name and its reviews, nicely formatted. For example, something like this: My Movie Name…arrow_forwardEmployee Management System Write a python class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. Once you have written the class, write a PYTHON program that creates three Employee objects to hold the following data: Name ID Number Department Job Title Susan Meyers 47899 Accounting Vice President Mark Jones 39119 IT Programmer Joy Rogers 81774 Manufacturing Engineer The program should store this data in the three objects, then display the data for each employee on the screen.Using the Employee class, create a program that stores Employee objects in a dictionary. Use the employee ID number as the key. The program should present a menu that lets the user perform the following actions: • Look up an employee in the dictionary• Add a new employee to the dictionary• Change an existing employee’s name, department, and job title in the dictionary• Delete an employee from the dictionary• Print all…arrow_forwardComputer Science Write the code to define a class called student. The student class should contain a data attribute called name and another attribute called gpa. Write the Student class to include an initializer method __init__ and a __str__ method. Create two different objects of the student class and call print on each object to display the output in the __str__method.arrow_forward
- Pointer variable stores the address where another object resides and system will automatically do garbage collection. Group of answer choices True Falsearrow_forwardIN C++ Lab #6: Shapes Create a class named Point. private attributes x and y of integer type. Create a class named Shape. private attributes: Point points[6] int howManyPoints; Create a Main Menu: Add a Triangle shape Add a Rectangle shape Add a Pentagon shape Add a Hexagon shape Exit All class functions should be well defined in the scope of this lab. Use operator overloading for the array in Shape class. Once you ask the points of any shape it will display in the terminal the points added.arrow_forwardPointer and classImplement a class called Team as specified:data members:name - the name of the Team (defined as a dynamic variable)members - a dynamic array of stringsize - number of members in the team.functions:Course(): default constructor set name to “TBD”, and size to 0, members toempty listCourse(string): one argument constructor set name, and size to 0, members toempty listaccessor - an accessor for the name and size variablemutator - an mutator for the name variableUse following main() to test your class.int main() {Team a,b("Mets");cout<<a.getName()<<endl; // print TBDa.setName("Yankee");cout<<a.getName()<<endl; // print Yankeecout<<b.getName()<<endl; // print Metscout<<a.getSize()<<endl; // print 0return 0;}arrow_forward
- Create a class named Student that has three member variables: name – A string that stores the name of the student numClasses – An integer that tracks how many courses the student is currently enrolled in classList – A dynamic array of strings used to store the names of theclasses that the student is enrolled in Write appropriate constructor(s), mutator, and accessor functions for the classalong with the following: • A function that inputs all values from the user, including the list of class names.This function will have to support input for an arbitrary number of classes. • A function that outputs the name and list of all courses. • A function that resets the number of classes to 0 and the classList to anempty list. • An overloaded assignment operator that correctly makes a new copy of the listof courses. • A destructor that releases all memory that has been allocated. Write a main function that tests all of your functions. use c++arrow_forwardCreate class Node in a file named Node.java. This class has the following properties: Public fields previous and next, pointing to the previous and next nodes in the list, respectively. Private field data, defined as a reference to an object of any type. Public constructor that takes the node’s data as an argument. Public function GetData() that returns the node’s data.arrow_forwardRetailItem ClassWrite a class named RetailItem that holds data about an item in a retail store. The class should store the following data in attributes: item description, units in inventory, and price. Once you have written the class, write a program that creates three RetailItem objects and stores the following data in them: Description Units in Inventory Price Item #1 Jacket 12 59.95 Item #2 Designer Jeans 40 34.95 Item #3 Shirt 20 24.95arrow_forward
- Using Classes Write a program that inputs, processes, and outputs a set of student records organized as a vector of class StudentRec objects. write a program where each student record is constructed using the class StudentRec. The variables in this case are "private" and the functions are "public." Note: only the first_name and last_name variables will require "getter" functions that return the name in all caps: get_first_name_upper() and get_last_name_upper() functions. Your class declaration section should look something like this: class StudentRec { private: string last_name = ""; // Last name string first_name = ""; // First name int year_grad = 0; // Year expected to graduate float gpa = 0.0; // Current gpa public: void set_last_name(string last_name_param); string get_last_name() const; string get_last_name_upper() const; // the rest of the "setter" and "getter" functions for each variable above go…arrow_forwardCreate a class Department with attributes DName, DID, a dynamic listDTeachers of type string.Write accessors and mutators for all data membersand show function to show all data members.Create nullaryand parameterized constructors to initialize the data members.Also write a copy constructor for Department class.In main() create a dynamic array of departments, Use loop to create four objects in the dynamic array. All the even indexed objects should be created with nullary constructors and thencall the accessors and mutators to initializethe objects while, all the odd indexed objects should be initialized using parameterized constructors. Create four copy objects from array using copy constructors.Call the show function to show the four objects.arrow_forward(Rectangle Class) Create class Rectangle. The class has attributes length and width, each of which defaults to 1. It has read-only properties that calculate the Perimeter and the Area of the rectangle. It has properties for both length and width. The set accessors should verify that length and width are each floating-point numbers greater than 0.0 and less than 20.0. Write an app to test class Rectangle. THIS IS C#arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,