Write a function cube_all_lc(values) that takes as input a list of numbers called values, and that uses a list comprehension to create and return a list containing the cubes of the numbers in values (i.e., the numbers raised to the third power). This version of the function may not use recursion.
In: Computer Science
Write a python program to create a list of integers using random function. Use map function to process the list on the series: x + x2/2! + x3/3! + ….n and store the mapped elements in another list. Assume the value of n as 10
In: Computer Science
Assignment Description:
Write a C++ program for keeping a course list for each student in a college. Information about each student should be kept in an object that contains the student id (four digit integer), name (string), and a list of courses completed by the student.
The course taken by a student are stored as a linked list in which each node contain course name (string such as CS41, MATH10), course unit (1 to 4) and the course grade (A,B,C,D,F).
The program provides a MENU with choices that include adding a student record, deleting a student record, adding a single course record to a student’s record, deleting a single course record from a student’s record, and print a student’s record to a screen.
A student record should include a GPA (Grade Point Average) when display on the screen. The GPA is calculated by following formula:
When the user is through with the program, the program should store the records in a file. The next time the program is run, the records should be read back out of the file and the list should be reconstructed
You will need to implement a List container to hold a list of student records, each of which has a List container as its member. Note that no duplicate items should be permitted in either (student and course) List container.
Develop a test driver program that allow options to add, remove, and display student records and the course list of each student.
Use the class template technique (in C++) to implement a List ADT that could be used for both student list and the course list..
To calculate G.P.A. for one term:
Multiply the point value of the letter grade (A=4, B=3, C=2, D=1, F=0) by the number of credit hours. The result is the grade points (quality points) earned.
Total the credit hours for the student; total the quality points for the student.
Divide the total quality points by the total credit hours.
In: Computer Science
// If you modify any of the given code, the return types, or the
parameters, you risk getting compile error.
// You are not allowed to modify main ().
// You can use string library functions.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma warning(disable: 4996) // for Visual Studio
#define MAX_NAME 30
// global linked list 'list' contains the list of
employees
struct employeeList {
struct employee* employee;
struct employeeList* next;
} *list = NULL;
// currently empty list
// structure "employee" contains the employee's name, room
number and linked list of supervisors
struct employee {
char name[MAX_NAME];
unsigned int roomNumber;
struct supervisor* supervisors;
// linked list 'supervisors' contains names of
supervisors
};
// structure 'supervisor' contains supervisor's name
struct supervisor {
char name[MAX_NAME];
struct supervisor* next;
};
// forward declaration of functions (already implmented)
void flushStdIn();
void executeAction(char);
// functions that need implementation:
// HW 7
void addEmployee(char* employeeNameInput, unsigned int
roomNumInput); // 20 points
void displayEmployeeList(struct employeeList*
tempList); // 15 points
struct employee* searchEmployee(char*
employeeNameInput); // 15 points
//HW 8
void addSupervisor(char* employeeNameInput, char*
supervisorNameInput); // 15 points
void displayEmployeeSupervisorList(struct employeeList*
tempList); // 15 points
void removeEmployee(char* employeeNameInput);
// 20 points
int main()
{
char selection = 'a';
// initialized to a dummy value
do
{
printf("\nCSE240 HW 7,8\n");
printf("Please enter your
selection:\n");
printf("HW7:\n");
printf("\t a: add a new employee to
the list\n");
printf("\t d: display employee list
(no supervisors)\n");
printf("\t b: search for an
employee on the list\n");
printf("\t q: quit\n");
printf("HW8:\n");
printf("\t c: add a supervisor of a
employee\n");
printf("\t l: display employees who
report to a specific supervisor\n");
printf("\t r: remove an
employee\n");
printf("\t q: quit\n");
selection = getchar();
flushStdIn();
executeAction(selection);
} while (selection != 'q');
return 0;
}
// flush out leftover '\n' characters
void flushStdIn()
{
char c;
do c = getchar();
while (c != '\n' && c != EOF);
}
// Ask for details from user for the given selection and perform
that action
// Read the function case by case
void executeAction(char c)
{
char employeeNameInput[MAX_NAME],
supervisorNameInput[MAX_NAME];
unsigned int roomNumInput;
struct employee* searchResult = NULL;
switch (c)
{
case 'a': // add employee
// input employee details from user
printf("\nPlease enter employee's
name: ");
fgets(employeeNameInput,
sizeof(employeeNameInput), stdin);
employeeNameInput[strlen(employeeNameInput) - 1] =
'\0'; // discard the trailing '\n' char
printf("Please enter room number:
");
scanf("%d",
&roomNumInput);
flushStdIn();
if
(searchEmployee(employeeNameInput) == NULL) //
un-comment this line after implementing
searchEmployee()
//if (1)
// comment out this line
after implementing searchEmployee()
{
addEmployee(employeeNameInput, roomNumInput);
printf("\nEmployee successfully added to the list!\n");
}
else
printf("\nThat
employee is already on the list!\n");
break;
case 'd': // display
the list
displayEmployeeList(list);
break;
case 'b': // search
for an employee on the list
printf("\nPlease enter employee's
name: ");
fgets(employeeNameInput,
sizeof(employeeNameInput), stdin);
employeeNameInput[strlen(employeeNameInput) - 1] =
'\0'; // discard the trailing '\n' char
if
(searchEmployee(employeeNameInput) == NULL) //
un-comment this line after implementing
searchEmployee()
//if (0)
// comment out this line
after implementing searchEmployee()
printf("\nEmployee name does not exist or the list is empty!
\n\n");
else
{
printf("\nEmployee name exists on the list! \n\n");
}
break;
case 'r': // remove
employee
printf("\nPlease enter employee's
name: ");
fgets(employeeNameInput,
sizeof(employeeNameInput), stdin);
employeeNameInput[strlen(employeeNameInput) - 1] =
'\0'; // discard the trailing '\n' char
if
(searchEmployee(employeeNameInput) == NULL) //
un-comment this line after implementing
searchEmployee()
//if (0)
// comment out this line
after implementing searchEmployee()
printf("\nEmployee name does not exist or the list is empty!
\n\n");
else
{
removeEmployee(employeeNameInput);
printf("\nEmployee successfully removed from the list!
\n\n");
}
break;
case 'c': // add
supervisor
printf("\nPlease enter employee's
name: ");
fgets(employeeNameInput,
sizeof(employeeNameInput), stdin);
employeeNameInput[strlen(employeeNameInput) - 1] =
'\0'; // discard the trailing '\n' char
if
(searchEmployee(employeeNameInput) == NULL) //
un-comment this line after implementing
searchEmployee()
//if (0)
// comment
out this line after implementing searchEmployee()
printf("\nEmployee name does not exist or the list is empty!
\n\n");
else
{
printf("\nPlease
enter supervisor's name: ");
fgets(supervisorNameInput, sizeof(supervisorNameInput),
stdin);
supervisorNameInput[strlen(supervisorNameInput) - 1] =
'\0'; // discard the trailing '\n' char
addSupervisor(employeeNameInput, supervisorNameInput);
printf("\nSupervisor added! \n\n");
}
break;
case 'l': // list
supervisor's employees
displayEmployeeSupervisorList(list);
break;
case 'q': //
quit
break;
default: printf("%c is invalid input!\n", c);
}
}
// HW7 Q1: addEmployee (20 points)
// This function is used to insert a new employee in the linked
list.
// You must insert the new employee to the head of linked list
'list'.
// You need NOT check if the employee already exists in the list
because that is taken care by searchEmployee() called in
executeAction(). Look at how this function is used in
executeAction().
// Don't bother to check how to implement searchEmployee() while
implementing this function. Simply assume that employee does not
exist in the list while implementing this function.
// NOTE: The function needs to add the employee to the head of the
list.
// NOTE: This function does not add supervisors to the employee
info. There is another function addSupervisor() in HW8 for
that.
// Hint: In this question, no supervisors means NULL
supervisors.
void addEmployee(char* employeeNameInput, unsigned int
roomNumInput)
{
}
// HW8 Q1: addSupervisor (15 points)
// This function adds supervisor's name to a employee node.
// Parse the list to locate the employee and add the supervisor to
that employee's 'supervisors' linked list. No need to check if the
employee name exists on the list. That is done in
executeAction().
// If the 'supervisors' list is empty, then add the supervisor. If
the employee has existing supervisors, then you may add the new
supervisor to the head or the tail of the 'supervisors' list.
// You can assume that the same supervisor name does not exist. So
no need to check for existing supervisor names, like we do when we
add new employee.
// NOTE: Make note of whether you add the supervisor to the head or
tail of 'supervisors' list. You will need that info when you
implement lastSupervisor()
// (Sample solution has supervisor added to the tail of
'supervisors' list. You are free to add new supervisor to head or
tail of 'supervisors' list.)
void addSupervisor(char* employeeNameInput, char*
supervisorNameInput)
{
struct employeeList* tempList = list;
// work on a copy of 'list'
// YOUR CODE HERE
}
// HW8 Q2: displayEmployeeSupervisorList (15 points)
// This function prompts the user to enter a supervisor name. This
function then searches for employees with this supervisor.
// Parse through the linked list passed as parameter and print the
matching employee details ( name and room number) one after the
other. See expected output screenshots in homework question
file.
// HINT: Use inputs gathered in executeAction() as a model for
getting the supervisor name input.
// NOTE: You may re-use some HW7 Q2 displayEmployeeList(list) code
here.
void displayEmployeeSupervisorList(struct employeeList*
tempList)
{
// YOUR CODE HERE
}
// HW8 Q3: removeEmployee (20 points)
// This function removes an employee from the list.
// Parse the list to locate the employee and delete that 'employee'
node.
// You need not check if the employee exists because that is done
in executeAction()
//removeEmployee() is supposed to remove employee details like name
and room number.
// The function will remove supervisors of the employee too.
// When the employee is located in the 'list', after removing the
employee name and room number, parse the 'supervisors' list of that
employee
// and remove the supervisors.
void removeEmployee(char* employeeNameInput)
{
struct employeeList* tempList = list;
// work on a copy of 'list'
// YOUR CODE HERE
}
I just need help for the HW 8 portion
In: Computer Science
1/The heights of adult men in America are normally distributed,
with a mean of 69.2 inches and a standard deviation of 2.65 inches.
The heights of adult women in America are also normally
distributed, but with a mean of 64.5 inches and a standard
deviation of 2.51 inches.
a) If a man is 6 feet 3 inches tall, what is his z-score (to two
decimal places)?
z =
b) What percentage of men are SHORTER than 6 feet 3 inches? Round
to nearest tenth of a percent.
%
c) If a woman is 5 feet 11 inches tall, what is her z-score (to two
decimal places)?
z =
d) What percentage of women are TALLER than 5 feet 11 inches? Round
to nearest tenth of a percent.
e) Who is relatively taller: a 6'3" American man or a 5'11"
American woman? Defend your choice in a meaningful sentence.
Suppose that about 84% of graduating students attend their graduation. A group of 35 students is randomly chosen, and let X be the number of students who attended their graduation.
Please show the following answers to 4 decimal places.
X=X=the number of CT residents that have Type B blood, of the 20
sampled.
What is the expected value of the random variable XX?
2.28 2.26 2.04 2.2 1.9 2.08
4/The owner of a small deli is trying to decide whether to discontinue selling magazines. He suspects that only 10.7% of his customers buy a magazine and he thinks that he might be able to use the display space to sell something more profitable. Before making a final decision, he decides that for one day he will keep track of the number of customers that buy a magazine. Assuming his suspicion that 10.7% of his customers buy a magazine is correct, what is the probability that exactly 6 out of the first 12 customers buy a magazine?
In: Statistics and Probability
Math & Music: There is a lot of interest in the relationship between studying music and studying math. We will look at some sample data that investigates this relationship. Below are the Math SAT scores from 8 students who studied music through high school and 11 students who did not. Test the claim that students who study music in high school have a higher average Math SAT score than those who do not. Test this claim at the 0.05 significance level.
| Studied Music | No Music | ||
| count | Math SAT Scores (x1) | Math SAT Scores (x2) | |
| 1 | 516 | 480 | |
| 2 | 571 | 535 | |
| 3 | 594 | 553 | |
| 4 | 578 | 537 | |
| 5 | 521 | 480 | |
| 6 | 564 | 513 | |
| 7 | 541 | 495 | |
| 8 | 607 | 556 | |
| 9 | 554 | ||
| 10 | 493 | ||
| 11 | 557 | ||
| x | 561.50 | 523.00 | |
| s2 | 1089.43 | 992.80 | |
| s | 33.01 | 31.51 | |
If you are using software, you should be able copy and paste the
data directly into your software program.
(a) The claim is that the difference in population means is positive (μ1 − μ2 > 0). What type of test is this?
This is a left-tailed test.
This is a two-tailed test.
This is a right-tailed test.
(b) Use software to calculate the test statistic or use the
formulat =
| (x1 − x2) − δ | ||||||
|
where δ is the hypothesized difference in means from the null hypothesis. Round your answer to 2 decimal places.
t =
To account for hand calculations -vs- software, your answer
must be within 0.01 of the true answer.
(c) Use software to get the P-value of the test statistic.
Round to 4 decimal places.
P-value =
(d) What is the conclusion regarding the null hypothesis?
reject H0
fail to reject H0
(e) Choose the appropriate concluding statement.
The data supports the claim that students who study music in high school have a higher average Math SAT score than those who do not.
There is not enough data to support the claim that students who study music in high school have a higher average Math SAT score than those who do not.
We reject the claim that students who study music in high school have a higher average Math SAT score than those who do not.
We have proven that students who study music in high school have a higher average Math SAT score than those who do not.
In: Statistics and Probability
Apple Academy is a profit-oriented education business. Apple
provides remedial training for high school students who have fallen
behind in their classroom studies. It charges its students $750 per
course. During the previous year, Apple provided instruction for
1,000 students. The income statement for the company
follows:
| Revenue | $ | 750,000 | |
| Cost of instructors | (340,000 | ) | |
| Overhead costs | (230,000 | ) | |
| Net income | $ | 180,000 | |
The company president, Andria Rossi, indicated in a discussion with
the accountant, Sam Trent, that she was extremely pleased with the
growth in the area of computer-assisted instruction. She observed
that this department served 200 students using only two part-time
instructors. In contrast, the classroom-based instructional
department required 32 instructors to teach 800 students. Ms. Rossi
noted that the per-student cost of instruction was dramatically
lower for the computer-assisted department. She based her
conclusion on the following information:
Apple pays its part-time instructors an average of $10,000 per
year. The total cost of instruction and the cost per student are
computed as follows:
| Type of Instruction | Computer-Assisted | Classroom | |||||
| Number of instructors (a) | 2 | 32 | |||||
| Number of students (b) | 200 | 800 | |||||
| Total cost (c = a × $10,000) | $ | 20,000 | $ | 320,000 | |||
| Cost per student (c ÷ b) | $ | 100 | $ | 400 | |||
Assuming that overhead costs were distributed equally across the
student population, Ms. Rossi concluded that the cost of
instructors was the critical variable in the company’s capacity to
generate profits. Based on her analysis, her strategic plan called
for heavily increased use of computer-assisted instruction.
Mr. Trent was not so sure that computer-assisted instruction should
be stressed. After attending a seminar on activity-based costing
(ABC), he believed that the allocation of overhead cost could be
more closely traced to the different types of learning activities.
To facilitate an activity-based analysis, he developed the
following information about the costs associated with
computer-assisted versus classroom instructional activities. He
identified $160,000 of overhead costs that were directly traceable
to computer-assisted activities, including the costs of computer
hardware, software, and technical assistance. He believed the
remaining $70,000 of overhead costs should be allocated to the two
instructional activities based on the number of students enrolled
in each program.
Required
Based on the preceding information, determine the total cost and the cost per student to provide courses through computer-assisted instruction versus classroom instruction.
In: Accounting
What is the probability that a randomly selected CMSU student
will be male?
The Student News Service at Clear Mountain State University (CMSU)
has decided to gather data about the undergraduate students that
attend CMSU. CMSU creates and distributes a survey of 14 questions
and receives responses from 62 undergraduates
What is the probability that a randomly selected CMSU student
will be female?
Find the conditional probability of different majors among the male
students in CMSU.
Find the conditional probability of different majors among the
female students of CMSU.
Find the conditional probability of intent to graduate, given that
the student is a male.
Find the conditional probability of intent to graduate, given that
the student is a female.
Find the conditional probability of employment status for the male
students as well as for the female students.
Find the conditional probability of laptop preference among the
male students as well as among the female students.
| ID | Gender | Age | Class | Major | Grad Intention | GPA | Employment | Salary | Social Networking | Satisfaction | Spending | Computer | Text Messages |
| 1 | Female | 20 | Junior | Other | Yes | 2.9 | Full-Time | 50 | 1 | 3 | 350 | Laptop | 200 |
| 2 | Male | 23 | Senior | Management | Yes | 3.6 | Part-Time | 25 | 1 | 4 | 360 | Laptop | 50 |
| 3 | Male | 21 | Junior | Other | Yes | 2.5 | Part-Time | 45 | 2 | 4 | 600 | Laptop | 200 |
| 4 | Male | 21 | Junior | CIS | Yes | 2.5 | Full-Time | 40 | 4 | 6 | 600 | Laptop | 250 |
| 5 | Male | 23 | Senior | Other | Undecided | 2.8 | Unemployed | 40 | 2 | 4 | 500 | Laptop | 100 |
| 6 | Female | 22 | Senior | Economics/Finance | Undecided | 2.3 | Unemployed | 78 | 3 | 2 | 700 | Laptop | 30 |
| 7 | Female | 21 | Junior | Other | Undecided | 3 | Part-Time | 50 | 1 | 3 | 500 | Laptop | 50 |
| 8 | Female | 22 | Senior | Other | Undecided | 3.1 | Full-Time | 80 | 1 | 2 | 200 | Tablet | 300 |
| 9 | Female | 20 | Junior | Management | Yes | 3.6 | Unemployed | 30 | 0 | 4 | 500 | Laptop | 400 |
| 10 | Female | 21 | Senior | Economics/Finance | Undecided | 3.3 | Part-Time | 37.5 | 1 | 4 | 200 | Laptop | 100 |
| 11 | Female | 23 | Senior | Economics/Finance | Yes | 2.8 | Full-Time | 50 | 2 | 5 | 400 | Laptop | 200 |
| 12 | Male | 21 | Senior | Undecided | No | 3.5 | Full-Time | 37 | 2 | 3 | 500 | Laptop | 100 |
In: Statistics and Probability
An education researcher is interested in students’
performance on a mathematics test for a novel---and generally
unfamiliar---concept. The researcher believes that if students
participate in an extracurricular training session, then they will
be more likely to perform better on the mathematics test.
This researcher is testing two hypotheses. The first is that the
training session provides specific instruction and has an effect on
students’ mathematics test scores. The second is that this
treatment effect is moderated by gender. Past research has
suggested that there should not be a main effect for gender.
However, to control for this possibility, a 2-way (2x2) factorial
ANOVA is being conducted to account for any influence from gender,
the treatment, and the interaction of the two main effects.
To test the hypotheses, the research has obtained 28 participants:
14 boys and 14 girls. From each group of 14, 7 students were
randomly chosen for the treatment group. After the treatment, all
students were given the same test. This test has been used in
previous research, has a range of 0 to 100, and measures students’
ability to correctly perform the novel mathematics exercise. (The
higher the test score, the more positive the result.)
Use a 2x2 ANOVA with α=0.02α=0.02 to test the the data and evaluate
the hypotheses. Results are provided below for each group of
students.
| Factor B: Treatment | |||
| Control: No Training |
Treatment: Attend Training |
||
| Factor A: Gender |
Male | 67.6 60.0 65.4 67.3 57.6 43.1 61.3 |
61.6 69.3 70.5 56.6 64.2 60.5 62.6 |
| Female | 52.8 51.5 66.5 62.7 55.8 48.1 58.6 |
71.0 73.6 76.4 62.4 74.4 86.9 71.2 |
|
( 1a ) What is the F value for the
treatment effect?
(Report answer accurate to 2 decimal place.)
( 1b ) What is the p-value for the
F value for the treatment effect?
(Report answer accurate to 4 decimal places.)
( 1c ) Does this support the researcher's
hypothesis that the treatment has an effect on ability to solve the
mathematics exercise?
( 2a ) What is the F value for the gender
effect?
(Report answer accurate to 2 decimal place.)
( 2b ) What is the p-value for the
F value for the gender effect?
(Report answer accurate to 4 decimal places.)
( 2c ) Does this support the researcher's
assumption that gender does NOT have an effect on
ability to solve the mathematics exercise?
( 3a ) What is the F value for the
interaction effect?
(Report answer accurate to 2 decimal place.)
( 3b ) What is the p-value for the
F value for the interaction effect?
(Report answer accurate to 4 decimal places.)
( 3c ) Does this support the researcher's
hypothesis that the treatment effect is moderated by gender?
In: Statistics and Probability
Thornton Academy is a profit-oriented education business. Thornton provides remedial training for high school students who have fallen behind in their classroom studies. It charges its students $1,895 per course. During the previous year, Thornton provided instruction for 1,000 students. The income statement for the company follows:
| Revenue | $ | 1,895,000 | |
| Cost of instructors | (1,292,000 | ) | |
| Overhead costs | (370,000 | ) | |
| Net income | $ | 233,000 | |
The company president, Andria Rossi, indicated in a discussion with
the accountant, Sam Trent, that she was extremely pleased with the
growth in the area of computer-assisted instruction. She observed
that this department served 200 students using only two part-time
instructors. In contrast, the classroom-based instructional
department required 32 instructors to teach 800 students. Ms. Rossi
noted that the per-student cost of instruction was dramatically
lower for the computer-assisted department. She based her
conclusion on the following information:
Thornton pays its part-time instructors an average of $38,000 per
year. The total cost of instruction and the cost per student are
computed as follows:
| Type of Instruction | Computer-Assisted | Classroom | |||||
| Number of instructors (a) | 2 | 32 | |||||
| Number of students (b) | 200 | 800 | |||||
| Total cost (c = a × $38,000) | $ | 76,000 | $ | 1,216,000 | |||
| Cost per student (c ÷ b) | $ | 380 | $ | 1,520 | |||
Assuming that overhead costs were distributed equally across the
student population, Ms. Rossi concluded that the cost of
instructors was the critical variable in the company’s capacity to
generate profits. Based on her analysis, her strategic plan called
for heavily increased use of computer-assisted instruction.
Mr. Trent was not so sure that computer-assisted instruction should
be stressed. After attending a seminar on activity-based costing
(ABC), he believed that the allocation of overhead cost could be
more closely traced to the different types of learning activities.
To facilitate an activity-based analysis, he developed the
following information about the costs associated with
computer-assisted versus classroom instructional activities. He
identified $288,000 of overhead costs that were directly traceable
to computer-assisted activities, including the costs of computer
hardware, software, and technical assistance. He believed the
remaining $82,000 of overhead costs should be allocated to the two
instructional activities based on the number of students enrolled
in each program.
Required
Based on the preceding information, determine the total cost and the cost per student to provide courses through computer-assisted instruction versus classroom instruction. (Do not round intermediate calculations. Round "Cost per student" to 2 decimal places.)
|
In: Accounting