Questions
Homework Assignment 4 Instructions: Class name must be: HW4_yourName For example: Michael will name the class...

Homework Assignment 4 Instructions: Class name must be: HW4_yourName For example: Michael will name the class of homework assignment 4 as HW4_Michael Grading Rubric: Code running and as per the required conditions and giving expected output = 10 points File named as per instructions = 1 point Comments in code = 4 points Problem: Average calculation for a list Write a program that reads a text file named test_scores.txt to read the name of the student and his/her scores for 3 tests. The program should display class average for first test (average of scores of test 1) and average (average of 3 tests) for each student. Expected Output: ['John', '25', '26', '27'] ['Michael', '24', '28', '29'] ['Adelle', '23', '24', '20'] [['John', '25', '26', '27'], ['Michael', '24', '28', '29'], ['Adelle', '23', '24', '20']] Class average for test 1 is: 24.0 Average for student John is 26.00 Average for student Michael is 27.00 Average for student Adelle is 22.33

In: Computer Science

Specifications Create an abstract Employee class that provides private attributes for the first name, last name,...

Specifications

  • Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0.
  • Create a Manager class that inherits the Employee class. This class should add private attributes for years of experience and the annual salary. This class should also provide necessary set and get functions. It should add a bonus ($1,000/year of experience) to the annual salary. The income tax rate should be 30%. This class should override the get_net_income function of the Employee class. Note that the gross income is calculated as follows:
    • bonus = years of experience * 1000
    • gross income = annual salary + bonus
    • tax rate = 30%
    • income tax = gross income * tax rate
    • net income = gross income - income tax
  • Create a Representative class that inherits the Employee class. This class should add private attributes for the weekly hours of work and the pay rate. This class should also provide necessary set and get functions. The income tax rate should be 20%. This class should override the get_net_income function of the Employee class. Note that the gross income is calculated as follows:
    • gross income = weekly hours of work * 52 * pay rate
    • tax rate = 20%
    • income tax = gross income * tax rate
    • net income = gross income - income tax
  • In the main function, the program should create Manager or Representative objects from the data entered by the user and save them in a list named employees. After the user has terminated data entries, your program should display the information of all employees on the output with this format: last name, first name, email, social security number, net income.

Sample Output (Your output should be similar to the text in the following box)

Welcome to my app

EMPLOYEE DATA ENTRY

Manager or Representative? (m/r): d

Invalid selection.

Continue? (y/n): y

Manager or Representative? (m/r): m

First Name: Frank
Last Name: Wilson
Email Address: [email protected]
SSN: 111-22-3333
Years of Experience: 3
Annual Salary: 95000

Continue? (y/n): y

Manager or Representative? (m/r): r

First Name: John
Last Name: Atkins
SSN: 222-33-4444
Email Address: [email protected]
Weekly Hours of Work: 40
Pay Rate: 20

Continue? (y/n): n

EMPLOYEE INFORMATION
Wilson, Frank, [email protected], 111-22-3333, $68600.00
Atkins, John, [email protected], 222-33-4444, $33280.00

Thank you for using my app

In: Computer Science

7.Name two advantages to a floating rate exchange regime. 8.Name two disadvantages to a floating rate...

7.Name two advantages to a floating rate exchange regime.

8.Name two disadvantages to a floating rate exchange regime.

9.Name two advantages to a fixed rate exchange regime.

10.Name two disadvantages to a fixed rate exchange regime.

In: Economics

Consider the following XML file: <root> <students> <element> <ID>100345</ID> <Nationality>USA</Nationality> <Program>ICT</Program> <age>23</age> <name>John</name> </element

  1. Consider the following XML file:

<root>

<students>

<element>

<ID>100345</ID>

<Nationality>USA</Nationality>

<Program>ICT</Program>

<age>23</age>

<name>John</name>

</element>

<element>

<ID>100876</ID>

<Nationality>MALAYSIA</Nationality>

<Program>CS</Program>

<age>28</age>

<name>Awang</name>

</element>

<element>

<ID>100257</ID>

<Nationality>AUSTRALIA</Nationality>

<age>25</age>

<name>Alex</name>

</element>

</students>

</root

Write an XQUERY to display the information for all students who are not Malaysians or older than 25.

In: Computer Science

Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address,...

Given the following 7 relations:

MIScompany (name, address, phone, email, FedTaxId, StaTaxId)

branch (branchId, name, address, phone, email, FedTaxId, StaTaxId)

employee (empId, driverId, ssno, name, branchId)

customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId)

equipment (equipId, name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId )

manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email)

rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId)

1) Use relational algebra to list every manufacturer that only makes electric cleaning tool (type of equipment). The report should contain manufacturId and manufacturer name.

In: Computer Science

An MNE from Asia that focuses on agriculture – name and describe the company in one...

An MNE from Asia that focuses on agriculture – name and describe the company in one or two sentences.

An MNE from Africa that focuses on transportation – name and describe the company in one or two sentences.

An MNE from Central America that focuses on financial services – name and describe the company in one or two sentences.

An MNE from South America that focuses on energy – name and describe the company in one or two sentences.

An MNE from Europe that focuses on textiles or clothing – name and describe the company in one or two sentences.

An MNE from North America that focuses on raw materials – name and describe the company in one or two sentences.

An MNE from Oceania that focuses on manufacturing – name and describe the company in one or two sentences.

An MNE that does work in Antarctica – any kind of company – name and describe the company in one or two sentences

In: Economics

please debug this by fixing all the mistakes in C#: // Creates a Breakfast class //...

please debug this by fixing all the mistakes in C#:

// Creates a Breakfast class
// and instantiates an object
// Displays Breakfast special information
using System;
public class DebugSeven2
{
   Breakfast special = new Breakfast("French toast", 4.99);
   //Display the info about breakfast
   Console.WriteLine(Breakfast.info);
   // then display today's special
   Console.WriteLine("Today we are having {0} for {1}",
      special.Name, special.Price.ToString("C2"));
}
class Breakfast
{
   // info is class field
   public static string info =
      "Breakfast is the most important meal of the day.";
   private string name;
   private double price;
   // Breakfast constructor requires a
   // name, e.g "French toast", and a price
   private Breakfast(string name, double price)
   {
       Name = Name;
       price = price;
   }
   public string Name
   {
      get
      {
          return Name;
      }
      set
      {
          value = name;
      }
    }
    public double Price
    {
       get
       {
          return price;
       }
       setUp
       {
          price = value;
       }
    }
}

In: Computer Science

An MNE from Asia that focuses on agriculture – name and describe the company in one...

  1. An MNE from Asia that focuses on agriculture – name and describe the company in one or two sentences.
  2. An MNE from Africa that focuses on transportation – name and describe the company in one or two sentences.
  3. An MNE from Central America that focuses on financial services – name and describe the company in one or two sentences.
  4. An MNE from South America that focuses on energy – name and describe the company in one or two sentences.
  5. An MNE from Europe that focuses on textiles or clothing – name and describe the company in one or two sentences.
  6. An MNE from North America that focuses on raw materials – name and describe the company in one or two sentences.
  7. An MNE from Oceania that focuses on manufacturing – name and describe the company in one or two sentences.
  8. An MNE that does work in Antarctica – any kind of company – name and describe the company in one or two sentences.

In: Economics

Using Python. A file exists on the disk named students.txt. The file contains several records, and...

Using Python.

A file exists on the disk named students.txt. The file contains several records, and each record contains two fields: (1) the student’s name, and (2) the student’s
score for the final exam. Write code that deletes the record containing “John Perz”as the student name.

This the code i have so far but it's not working:

import os

def main():

found=False

search='John Perz'

student_file = open('student.txt','r')

temp_file = open('temp_students.txt','w')

name=student_file.readline()

score=''

while name !='':

score=student_file.readline()

name=name.rstrip('/n')

score=score.rstrip('/n')

if name !=search:

temp_file.write(name+'/n')

temp_file.write(score+'/n')

else:

found=True

name=student_file.readline()

student_file.close()

temp_file.close()

os.rename('temp.text','student.text')

if found:

print("The record was deleted")

else:

print("Record not found")

main()

In: Computer Science

In a study women were identified who had been diagnosed with Cervical Cancer through the Cancer...

In a study women were identified who had been diagnosed with Cervical Cancer through the Cancer Registry. Women with skin cancer were used as controls. The study then received past medical histories on HPV status, which was collected through an outstanding health department. (And they somehow had access to these records and could link them.)
Calculation B
Cervical Cancer Cases   Controls (No Cervical Cancer)   Total
HPV 1200 9800 11,000
No HPV 400 7600 8,000
1,600 17,400 19,000

1. What type of study is this?
a. cross-sectional
b. case report/series
c. ecologic
d. case-control
e. cohort
f. clinical trial
g. community intervention

2. What is the most appropriate measure of association?
a. odd ratio
b. relative risk
c. Attributable risk
d. none of these

3. Calculate the measure of association (use two decimal places).

4. How would you best describe the relationship between the exposure and the outcome?
a. no relationship
b. positive relationship
c. negative relationship

5. If appropriate, calculate the attributable risk per 1000 people (use 2 decimal places).


In: Anatomy and Physiology