Question

In: Computer Science

Apex Computing is preparing for a Secret Santa gift exchange. Certain information will be gathered from...

Apex Computing is preparing for a Secret Santa gift exchange. Certain information will be gathered from each employee. Although it would be more realistic to write a program that asks a user for input, this program will just be a practice for using structures and functions so we will create the information by assigning values to the variables.

Write a program that uses a structure named EmpInfo to store the following about each employee:

Name

Age

Favorite Food

Favorite Color

The program should create three EmpInfo variables, store values in their members, and pass each one, in turn, to a function that displays the information in a clear and easy-to-read format. (Remember that you will choose the information for the variables.)

Here is an example of the output:

Name………………………………Mary Smith

Age ……………………………….. 25

Favorite food ………………… Pizza

Favorite color ……………….. Green

Solutions

Expert Solution

class EmpInfo:
def __init__(self, name, age,food,color):
self.name = name
self.age = age
self.food = food
self.color = color
  
def printInfo(empData):
print("\n\nName........................"+empData.name)
print("Age........................."+empData.age)
print("Favorite food..............."+empData.food)
print("Favorite color.............."+empData.color)
  
empList = []
for i in range(3):
print("Enter employee "+str(i+1)+" details")
name=input("Name:")
age=input("Age:")
food=input("Favorite food:")
color=input("Favorite color:")
empList.append(EmpInfo(name,age,food,color))


for i in range(len(empList)):
printInfo(empList[i])


Related Solutions

Santa Toy Shop produces toys. During November, the following information was gathered: Dart Board Lego Sets...
Santa Toy Shop produces toys. During November, the following information was gathered: Dart Board Lego Sets Dolls Breyer Horses Golf Sets Stuffed Toys Budgeted units sold 175 500 400 125 600 300 Actual units sold 200 400 250 140 500 350 Budgeted selling price $5 $30 $11 $40 $80 $18 Actual selling price $8 $25 $12 $45 $75 $28 Budgeted variable cost $2 $18 $5 $20 $35 $10 Actual variable cost $3 $15 $4 $25 $30 $11 Actual market size...
Required information Problem 3-5A Preparing financial statements from the adjusted trial balance and computing profit margin...
Required information Problem 3-5A Preparing financial statements from the adjusted trial balance and computing profit margin LO P3, A1 [The following information applies to the questions displayed below.] The adjusted trial balance for Chiara Company as of December 31, 2018, follows. Debit Credit Cash $ 30,000 Accounts receivable 52,000 Interest receivable 18,000 Notes receivable (due in 90 days) 168,000 Office supplies 16,000 Automobiles 168,000 Accumulated depreciation—Automobiles $ 50,000 Equipment 138,000 Accumulated depreciation—Equipment 18,000 Land 78,000 Accounts payable 96,000 Interest payable...
Required information Problem 3-5A Preparing financial statements from the adjusted trial balance and computing profit margin...
Required information Problem 3-5A Preparing financial statements from the adjusted trial balance and computing profit margin LO P6, A1 [The following information applies to the questions displayed below.]    The adjusted trial balance for Chiara Company as of December 31 follows. Debit Credit Cash $ 30,000 Accounts receivable 52,000 Interest receivable 18,000 Notes receivable (due in 90 days) 168,000 Office supplies 16,000 Automobiles 168,000 Accumulated depreciation—Automobiles $ 50,000 Equipment 138,000 Accumulated depreciation—Equipment 18,000 Land 78,000 Accounts payable 96,000 Interest payable...
Q.1 The budget department of ABC Ltd., gathered the following information for preparing its budgets for...
Q.1 The budget department of ABC Ltd., gathered the following information for preparing its budgets for forthcoming period. 1. Sales forecast. Product Sales Quantity Selling price Inventories 01-01-2019 31-12-2019 Product-A 30,000 units Rs. 30 per unit. 5,000 units 10,000 units Product-B 40,000 units Rs. 40 per unit. 10,000 units 15,000 units Materials Purchase budget. 2. Material Product Inventories A B 01-01-2019 31-12-2019 Price per kg Materials-X 2kg 1kg 25,000kg 30,000kg Rs.2.0 Materials-Y 1kg 3kg 10,000 kg 15,000 kg Rs.1.0 3....
Gunnar Company gathered the following reconciling information in preparing its September bank reconciliation. Calculate the adjusted...
Gunnar Company gathered the following reconciling information in preparing its September bank reconciliation. Calculate the adjusted cash balance per books on September 30. Cash balance per books, September 30 $ 3,181 Deposits in transit 421 Notes receivable and interest collected by bank 888 Bank charge for check printing 29 Outstanding checks 1,347 NSF check 144 a.$2,970 b.$3,896 c.$2,255 d.$3,114 Bank Reconciliation The following data were accumulated for use in reconciling the bank account of Mathers Co. for July: Cash balance...
12) Grant is fairly certain that his partner Jenny is keeping things secret from him in...
12) Grant is fairly certain that his partner Jenny is keeping things secret from him in their art deco design firm. Grant asks Jenny to see the books. She agrees but doesn't allow him to make copies. Grant said he has the right and Jenny said he does not because she is responsible for the books. Which is correct? A) Grant, a partner has a right to copy partnership records. B) Jenny, a partner does not have a right to...
Derek Company gathered the following reconciling information in preparing its September bank reconciliation: Cash balance per...
Derek Company gathered the following reconciling information in preparing its September bank reconciliation: Cash balance per books, 9/30 $2,190 Deposits in transit 572 Notes receivable and interstate's collected by bank. 879 Bank charge for check printing   29 Outstanding checks 1,322 NSF 178 Find the adjusted cash balance per books on September 30. Select the correct answer. $2,862 $2,112 $1,440 $2,290
The following information was gathered from the records of Cooper Molecular Models Inc. for the month...
The following information was gathered from the records of Cooper Molecular Models Inc. for the month ended December 31, 2019. Balance December 1, 2019 Balance December 31, 2019 Raw Materials Inventory $4,800 $3,960 Work In Process Inventory 1,980 1,860 Finished Goods Inventory 9,600 7,590 Direct Labour $13,925 Accounts Receivable 2,700 Insurance on the factory 460 Depreciation on factory machines 1,600 Sales 53,400 Plant Manager’s salary 5,800 Raw material purchases 9,640 Factory property taxes 960 Cash 3,200 Required: Prepare a schedule...
1. A researcher has gathered information from a survey of 25 randomly selected university campuses. From...
1. A researcher has gathered information from a survey of 25 randomly selected university campuses. From this data, it was reported that the average number of reported sexual assaults on these campuses in the last year was 12 with a standard deviation of 3. Calculate a 95% confidence interval to estimate the average number of sexual assaults on Canadian university campuses as a whole. Remember to report your confidence interval in a complete sentence and describe what it means. (15%)...
Computing and Recording Proceeds from the Sale of PPE The following information was provided in the...
Computing and Recording Proceeds from the Sale of PPE The following information was provided in the 2018 10-K of Hilton Worldwide Holdings, Inc. Note 7: Property and Equipment ($ millions) 2018 2017 Property and equipment, gross $1,102 $1,044 Accumulated depreciation (625) (585) Property and equipment, net 477 459 Note 7 also revealed that depreciation expense on property and equipment totaled $70 million in 2018. The cash flow statement reported that expenditures for property and equipment totaled $94 million in 2018...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT