for the employee class program in the unit 3 finishing the employee class program tutorial, what if we need to update the display menu and selections to add in a way to change the id of an employee? what code segments would need to be added to the display menu() method and the command while loop respectively to implement this?

Answers

Answer 1
Answer:

To update the display menu and selections in the Employee class program tutorial to include the option to change an employee's ID, you would need to add code segments to the `display_menu()` method and the command `while` loop.

Here's a possible implementation:

```python

class Employee:

   def __init__(self, name, id):

       self.name = name

       self.id = id

   def display_menu(self):

       print("1. Change ID")

       print("2. Display Employee Details")

       print("3. Quit")

   def change_id(self):

       new_id = input("Enter new ID: ")

       self.id = new_id

       print("Employee ID changed successfully.")

   def run(self):

       choice = 0

       while choice != 3:

           self.display_menu()

           choice = int(input("Enter your choice: "))

           if choice == 1:

               self.change_id()

           elif choice == 2:

               self.display_details()

           elif choice == 3:

               print("Quitting...")

           else:

               print("Invalid choice. Try again.")

   def display_details(self):

       print("Employee Name:", self.name)

       print("Employee ID:", self.id)

```

In the updated code, the `display_menu()` method now includes the option "1. Change ID" to indicate the ability to change the employee's ID.

Inside the `run()` method, the `choice` variable is used to track the user's input. If the choice is 1, the `change_id()` method is called, which prompts the user to enter a new ID and updates the `id` attribute of the employee object accordingly.

With these additions, the updated Employee class program allows users to select the option to change the ID of an employee from the menu and executes the necessary code to facilitate the ID change.

Learn more about display menu:

brainly.com/question/31206277

#SPJ11


Related Questions

1. Technical writers adjust to format to adding or deleting information, using glossaries,adjusting use of technical language, and presenting information in graphics. Why is this false?
The __________ Web site can provide you with a list of registration sites. WAI W3C SSL ICANN
How do computers work
What political, cultural and economical impact did the telescope have during the renaissance era?​
The advantages of computerized design include all of the following, except which? a. architects can create a computerized image of any imaginable design. b. because of computer design software, architects are no longer needed in architecture. c. architects can create plans of older architecture to learn from past successes and errors. d. computerized design has increased the complexity of possible designs.

You are given a class named clock that has one int instance variable called hours. write a constructor with no parameters for the class clock. the constructor should set hours to 12.

Answers

in java it would be 

public clock()
{
     hours = 12;
}

For multicore processors to be used effectively, computers must understand how to divide tasks into parts that can be distributed across each core - an operation called:A. graphics coprocessing
B. multiplexer processing
C. arithmetic-logic processing
D. parallel processing

Answers

Answer: parallel processing

Explanation:

Parallel processing is the process by which the processor has the capacity to execute parallel instruction at the same time. This is possible only by assigning the different task to the different cores present in the cpu. So a cpu with multiple cores are able to process multiple task as the same time parallel.

Which best describes the relationship between hardware and software?

Answers

You're above my grade level, please review this thoroughly before submitting your answer.

Hardware is a solid object in a computer, or a computer itself. An example is that one type of hardware is like a hard drive, or the other kind is the computer.

Software is basically programs/downloadable OS.
Like Linux.

Answer:

Software instructs hardware how to perform.

Explanation:

*TCSS Career Preparedness Q2

edge 2021

Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)

Answers

Following are the program to convert height and weight values:

Program:

#include <iostream>//header file

using namespace std;

int main ()//main method

{

  double height, weight,h,w; //defining a doubale variable

  cout<<"Following are the converter of Weight and height: "<<endl;//print message

  cout<<"Enter the height in inches: ";//print message

  cin>>height;//input value

  cout<<"Enter the weight in stones: ";//print message

  cin>>weight;//input value

  h=height* 2.54;//converting height value into centimetres and holding its value in h variable

  w= weight* 6.364;//converting weight value into kilograms and holding its value in w variable

  cout<<"The converted height is "<<h<<" cm."<<endl;//printing the converted value

  cout<<"The converted weight is "<<w<<" kg."<<endl;//printing the converted value

  return 0;

}

Program Explanation:

  • Defining header file.
  • Defining the main method.
  • Inside the main method defining four double variables that are "height, weight, h, and w".
  • Inside this, the "height, weight" variable is used for input value is the from user-end, and "h, w" is used to convert height and weight value into centimeters and kilograms.
  • After converting the value using the print method that prints its values.

Output:

Please find the attached file.

Find out more information about the conversion here:

brainly.com/question/26240757

(Using python)

When running:

measure(the height you want to enter, the weight you want to enter)

When the input is printed you have to re-enter the data (couldn’t fix that)

It will print the conversions as a result

Word allows the user to view a document in different ways. What view would you choose to view a document like a book?a. View Mode
b. Print Layout
c. Read Mode
d. Web Layout

Answers

The answer would be C

Word, by default, places a tab stop at every ____ mark on the ruler. .25" .5" .75" 1"

Answers

Word, by default, places a tab stop at every .5, otherwise half an inch mark on the ruler.
Hope I helped ;)