Please answer the following question in 175 word response:
Can you explain the gross profit ratio and why it is so important to organizations?
In: Accounting
In: Computer Science
In a recent survey conducted, a random sample of adults 18 years of age or older living in a certain country were asked their reaction to the word socialism. In addition, the individuals were asked to disclose which political party they most associate with. Results of the survey are given in the table. Complete parts (a) through (c) below.
| _ | Democrats | Independents | Republicans |
| Positive | 216 | 64 | 158 |
| Negative | 270 | 370 | 411 |
(a) Does the evidence suggest individuals within each political affiliation react differently to the word "socialism"? Use the
alpha equals 0.05
level of significance.
State the hypotheses.
A.Upper H 0: pSubscript Upper DequalspSubscript Upper RequalspSubscript Upper I
Upper H 1:At least one of the proportions is different from the others.
B.Upper H 0: Political party and reaction are independent.
Upper H 1:Political party and reaction are dependent.
C.Upper H 0:Political party and reaction are dependent.
Upper H 1:Political party and reaction are independent.
D.Upper H 0: OSubscript Upper D equalsESubscript Upper Dand OSubscript Upper R equalsESubscript Upper Rand OSubscript Upper I equalsESubscript Upper I
Upper H 1: At least one mean is different from what is expected.
Compute the P-value.
The P-value=?
Make the proper conclusion. Choose the correct answer below.
A.Yes, there is evidence because the P-value is greater than alpha.
B.Yes, there is evidence because the P-value is less than alpha.
C.No, there is no evidence because the P-value is greater than alpha.
D.No, there is no evidence because the P-value is less than alpha.
(b) Construct a conditional distribution of reaction by political party.
| Democrats | Independents | Republicans | |
| Positive | |||
| Negative |
(c) Write a summary about the "partisan divide" regarding the reaction to the word "socialism."
A.Democrats, Independents, and Republicans all had a majority negative reaction. The proportions are likely to be equal.
B.Republicans and Independents are far more likely to react negatively to the word "socialism" than Democrats are. All groups had a majority negative reaction.
C.Democrats are far more likely to react negatively to the word"socialism" than Independents and Republicans are. All groups had a majority negative reaction.
D.Republicans and Democrats are far more likely to react negatively to the word "socialism" than Independentsare. All groups had a majority negative reaction.
In: Statistics and Probability
2. Single step the instructions.s program through at least two exceptions. Make sure that you see how the flow of control is changed by comparing the source code with PCSpim windows, pay particular attention to all registers.
Question 2 (0.4): how do you recognise that the normal program flow has been interrupted?
Question 3 (0.5): how can you find out what exception condition has occurred and what caused it?
#--------------------instruction.s---------------------
# This program implements:
# sum = 0;
# i = 9;
# do {
# sum = sum + A[9-i]
# B[9-i] = sum;
# i--;
# }
# until (i = 0)
.globl main
main:
add $t2, $0, $0 # sum = 0 (sum is in $t2)
add $t1, $0, $0 # Set $t1 to point to beginning of data
lw $t4, 84($t1) # Constant 4 stored in $t4
lw $t0, 88($t1) # Constant 9 stored in $t0 (i)
lw $t5, 92($t1) # Constant -1 stored in $t5
add $t1, $t1,$t4 # A starts at 4 (move $t1 to point to A)
loop:
lw $t3, 0($t1) # $t3 has A[k]
add $t2, $t2, $t3 # sum = sum + A[k]
sw $t2, 40($t1) # B[k] = sum
add $t1, $t1, $t4 # update address pointer
add $t0, $t0, $t5 # i--
beq $t0, $0, done # if i = 0 go to done
j loop # if i > 0 go to loop
done:
add $t1, $0, $0 # Set $t1 to point to beginning of data
sw $t2, 0($t1) # sum is stored
li $v0, 4 # print_str
la $a0, message # load address of string
syscall #
li $v0, 1 # print_int
lw $a0, sum # load integer value
syscall #
jr $ra # return to the main program
add $0, $0, $0 # nop
.data
sum: .word 0
A: .word 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
B: .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Four: .word 4
Nine: .word 9
Minus1: .word -1
message: .asciiz "\nThe value of sum is: In: Computer Science
c++
/////////////////////////////////////////////////////////////////////////
need to be named Subsequences.h and pass test cpp file SubsequenceTester.cpp at the end of this question.
This assignment will help you solve a problem using recursion
Description
A subsequence is when all the letters of a word appear in the relative order of another word.
This assignment you will create a Subsequence class to do the following:
Hints
Think about the following questions to help you set up the recursion...
Submission
To get you thinking of data good test cases, only the example test cases have been provided for you in the SubsequenceTester.cpp. It is your responsibility to come up with several other test cases. Think of good ones
////////////////////////////////////////////////////
SubsequenceTester.cpp
#include <iostream>
#include "Subsequences.h"
using namespace std;
void checkCase(string, string, string, bool);
int main()
{
/**
Add several more test
cases to thoroughly test your data
checkCase takes the
following parameters (name, word, possible subsequence, true/false
it would be a subsequence)
**/
checkCase("Case 1: First Letter", "pin",
"programming", true);
checkCase("Case 2: Skipping Letters", "ace",
"abcde", true);
checkCase("Case 3: Out of order", "bad",
"abcde", false);
return 0;
}
void checkCase(string testCaseName, string sub, string sentence,
bool correctResponse){
Subsequences s(sentence);
if(s.isSubsequence(sub) ==
correctResponse){
cout << "Passed "
<< testCaseName << endl;
}
else{
cout << "Failed "
<< testCaseName << ": " << sub << " is "
<< (correctResponse? "": "not ") << "a subsequence of "
<< sentence << endl;
}
}
In: Computer Science
c++
/////////////////////////////////////////////////////////////////////////
need to be named Subsequences.h and pass test cpp file SubsequenceTester.cpp at the end of this question.
This assignment will help you solve a problem using recursion
Description
A subsequence is when all the letters of a word appear in the relative order of another word.
This assignment you will create a Subsequence class to do the following:
Hints
Think about the following questions to help you set up the recursion...
Submission
To get you thinking of data good test cases, only the example test cases have been provided for you in the SubsequenceTester.cpp. It is your responsibility to come up with several other test cases. Think of good ones
////////////////////////////////////////////////////
SubsequenceTester.cpp
#include <iostream>
#include "Subsequences.h"
using namespace std;
void checkCase(string, string, string, bool);
int main()
{
/**
Add several more test
cases to thoroughly test your data
checkCase takes the
following parameters (name, word, possible subsequence, true/false
it would be a subsequence)
**/
checkCase("Case 1: First Letter", "pin",
"programming", true);
checkCase("Case 2: Skipping Letters", "ace",
"abcde", true);
checkCase("Case 3: Out of order", "bad",
"abcde", false);
return 0;
}
void checkCase(string testCaseName, string sub, string sentence,
bool correctResponse){
Subsequences s(sentence);
if(s.isSubsequence(sub) ==
correctResponse){
cout << "Passed "
<< testCaseName << endl;
}
else{
cout << "Failed "
<< testCaseName << ": " << sub << " is "
<< (correctResponse? "": "not ") << "a subsequence of "
<< sentence << endl;
}
}
In: Computer Science
Hello I need a small fix in my program. I need to display the youngest student and the average age of all of the students. It is not working Thanks.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
struct Student {
string firstName;
char middleName;
string lastName;
char collegeCode;
int locCode;
int seqCode;
int age;
};
struct sort_by_age {
inline bool operator() (const Student& s1, const Student& s2)
{
return (s1.age < s2.age); // sort according to age of student
}
};
// main function to run program
int main() {
//CHANGE: vector students; TO vector students;
vector<Student> students; // create vector object to hold students data
ifstream Myfile; // create input file stream object
Myfile.open("a2data.txt"); // open file
// check if file is open
if (!Myfile.is_open()) {
// display error message if file could not be opened
cout << "Could not open the file!";
return 0; //terminate
}
//CHANGE: vector words; TO vector words;
vector<string> words; // create vector object to store words from input file
//read input from file line by line
string line;
while (!Myfile.eof()) {
getline(Myfile, line); // readline from input file stream
line.c_str(); // convert string in to char array
// file given in eample does not contain one record each line
// but it hase some patern for reading
// each word is seprated by space
//read the liine till space is encountered and get the word
int i = 0; // iterator to iterate over line
string word = "";
while (line[i] != '\0') {
// loop till end of line
if (line[i] != ' ') {
word = word + line[i]; // build word with char
i++;
}
else {
if(word!="")
words.push_back(word); // add word to vector
word = ""; //reset word to empty string
i++; //ignore white space
}
}//end of line
words.push_back(word); // add word to vector
}//end of file
//when done reading input from file close the file stream
Myfile.close();
int count = 0; // counts the words proceesed from vector object words
string fname = words.at(count); // variable to store first name of student
count++; //move to next element in the vector
//CHANGE: count < words.size() TO count < words.size() - 2
// at least two words are read in an iteration, so at least two should remain to be read - last name + student id
while (count < words.size() - 2) {
// loop till end of vector words
// create student object
Student s;
//assign first name to student
s.firstName = fname;
//next element in words is middle name
//assign first char to middle name
string mname = words.at(count);
s.middleName = mname[0];
count++;
//next element is last name of student
//assign next word to student
s.lastName = words.at(count);
//CHANGE: start
//If there was no middle name, this is the student id + first name of next student
if(words.at(count).size() >= 12) // college code + locCode + seq + age
{
if(words.at(count)[1] >= '0' && words.at(count)[1] <= '9') // if second character is a digit
{
// this is the student id field, and there is no middle name
count --; // move one step back for next iteration
s.middleName = ' '; //blank middle name
s.lastName = words.at(count);
}
}
//CHANGE: end
count++;
//next element is student id + first name of next student
//id contains college code at first latter
string id = words.at(count);
count++;
//assign college code to the student
s.collegeCode = id[0];
//next 2 char in id contain location
string loc = "";
loc = loc + id[1];
loc = loc + id[2];
// assign location to student
s.locCode = stoi(loc); // convert string to integer
//next 6 char in id contain seqcode
string seq = "";
for (int j = 3; j < 9; j++) {
seq = seq + id[j];
}
// assign seqcode to student
s.seqCode = stoi(seq); //convert string to int
//next 3 char in id contains age
string age = "";
age = age + id[9];
age = age + id[10];
age = age + id[11];
//assign age to student
s.age = stoi(age); // convert string to int
//remainig latters in id contains next student's first name
// delete id of previous student to get name of next student
fname = id.erase(0, 12); // delete first 12 char from id and assign remaining to fname
// add student to student
students.push_back(s);
}
// clear the vector as done working with words
words.clear();
//sort vector according to age of students
sort(students.begin(), students.end(), sort_by_age());
// formating output
cout << setw(15) << left << "Last Name";
cout << setw(15) << left << "Midlle Name";
cout << setw(15) << left << "First Name";
cout << setw(15) << left << "College Code";
cout << setw(12) << left << "Location";
cout << setw(12) << left << "Sequence";
cout << setw(12) << left << "Age" << endl;
cout << "=======================================================================================" << endl;
// print all students
for (int i = 0; i < students.size(); i++) {
cout << setw(15) << left << students.at(i).lastName;
cout << setw(15) << left << students.at(i).middleName;
cout << setw(20) << left << students.at(i).firstName;
cout << setw(13) << left << students.at(i).collegeCode;
cout << setw(10) << left << students.at(i).locCode;
cout << setw(12) << left << students.at(i).seqCode;
cout << students.at(i).age << endl;
}
//print average age
cout << endl;
int avg_age = ageCalc(arry, youngest);
cout<<"Average age is: "<<avg_age<<endl;
cout<<"Youngest student is "<<youngest->firstName<<" "<<youngest->MiddleN<<" "<<youngest->LastN<<endl;
for(int i=0; i<index; i++){
delete arry[i];
}
return 0;
}
int ageCalc(Student *studs[], Student *&youngest){
youngest = studs[0];
int i = 0;
int avg_age = 0;
while(studs[i]!=NULL){
avg_age += studs[i]->age;
if(youngest->age>studs[i]->age)
youngest = studs[i];
i++;
}
return avg_age/i;
}
File needed:
https://drive.google.com/file/d/15_CxuGnFdnyIj6zhSC11oSgKEYrosHck/view?usp=sharing
In: Computer Science
explain why liquidity risk and credit in the financial crisis
In: Operations Management
1. Page 1 of report:
Prepare a title page for this Annual Report (in Word). The name of this report is:
Annual Report of the Cancer Program, 2018
Hospital Name (make one up)
Your City, State
Prepared by: student name
2. Page 2 of report:
Include an Introduction, explaining the purpose of the report.
Prepare an alphabetical listing of the Cancer Committee members. They include:
A. F. Catherson, M.D.
C. P. Tomeko, M.D.
A. B. Nichols, M.D.
L. E. Smith, D.O.
C. D. Seagram, D.O.
B.W. Ye, M.D.
Include also the Cancer Program Components in alphabetical order:
Home Health
Hospice
Multidisciplinary Cancer Committee
Cancer Registry
Radiation Oncology
Chemotherapy
Tumor Conference
Surgery
Diagnostic Radiology
Respite Care
Oncology Nursing Unit
Social Service
Chaplain Services
Nutrition Services
Laboratory and Histology
Pharmacy
Patient Support Group
American Cancer Society Support Group
3. Page 3 of report and Subsequent pages: develop graphs and charts based upon the data provided on pages 4 & 5 of this instructions document.
Page 3: Prepare a pie graph of total cases by site in 2017
Page 4: Prepare a column graph indicating the age distribution
Page 5: Prepare a pie chart indicating the stage at diagnosis.
Pages 6 and 7: Prepare a bar graph of males by site and females by site
Page 8: Prepare a line graph indicating the incidence of lung cancer cases over a five year period.
Page 9: Prepare a graph (choose an appropriate one) for age at diagnosis for lung cancer.
Page 10: Prepare a graph (choose an appropriate one) of how the diagnosis of lung cancer was made.
Page 11: Prepare a graph (choose an appropriate one) of the histology of lung cancer.
Page 12: Prepare a bar graph of lung cancer treatment
In: Statistics and Probability
In: Economics