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
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 Continue? (y/n): y Manager or Representative? (m/r): r First Name: John Continue? (y/n): n EMPLOYEE INFORMATION 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 exchange regime.
9.Name two advantages to a fixed rate exchange regime.
10.Name two disadvantages to a fixed rate exchange regime.
In: Economics
<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, 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 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
// 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
In: Economics
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 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