Rewrite your most recent high scores program in C++ so that each name/score pair is stored in a struct named Highscore. Except as noted below, this new program will continue to meet all of the requirements of your most recent high scores program. Your new program should meet the following additional requirements:
void readData(Highscore scores[], int size) void sortData(Highscore scores[], int size) void displayData(const Highscore scores[], int size)
Please help!! Heres my code below from the previous assignment that it asks for thank you!
#include
#include <iostream>
#include <cstdlib>
using namespace std;
void readData(int *scores, string *names, int n);
void sortData(int *scores, string *names, int n);
void displayData(int *scores, string *names, int n);
int main()
{
int n;
cout<<"How many scores will you enter?: ";
cin>>n;
int *scores = new int[n];
string *names = new string[n];
readData(scores, names, n);
sortData(scores, names, n);
displayData(scores, names, n);
delete [] scores;
delete [] names;
return 0;
}
void readData(int *scores, string *names,int n)
{
for (int i=0; i<n; i++)
{
cout<<"Enter the name for score #"<<(i+1)<<": ";
cin>>names[i];
cout<<"Enter the score for score #"<<(i+1)<<": ";
cin>>scores[i];
}
}
void sortData(int *scores, string *names, int n)
{
int i, j, size_t;
for (i = 0; i < n-1; i++)
{
size_t = i;
for (j = i+1; j < n; j++)
if (scores[j] > scores[size_t])
size_t = j;
string tempName = names[size_t];
names[size_t] = names[i];
names[i] = tempName;
int tempScore = scores[size_t];
scores[size_t] = scores[i];
scores[i] = tempScore;
}
}
void displayData(int *scores, string *names, int n){
cout<<"Top Scorers: "<<endl;
for(int i=0; i<n;i++){
cout<<names[i]<<" : "<<scores[i]<<endl;
}
}
In: Computer Science
For this week’s assignment, you will write a program class that has two subroutines and a main routine. The program should be a part of the ‘Firstsubroutines’ class and you should name your project Firstsubroutines if you are using Netbeans.
Your program must prompt the user to enter a string. The program must then test the string entered by the user to determine whether it is a palindrome. A palindrome is a string that reads the same backwards and forwards, such as "radar", "racecar", and "able was I ere I saw elba". It is customary to ignore spaces, punctuation, and capitalization when looking for palindromes. For example, "A man, a plan, a canal. Panama!" is considered to be a palindrome.
To determine whether a string is a palindrome, you can: convert the string to lower case; remove any non-letter characters from the string; and compare the resulting string with the reverse of the same string. If they are equal, then the original string is considered to be a palindrome.
Here’s the code for computing the reverse of str:
String reverse;
int i;
reverse = "";
for (i = str.length() - 1; i >= 0; i--) {
reverse = reverse + str.charAt(i);
}
As part of your assignment, you must write a static subroutine that finds the reverse of a string. The subroutine should have one parameter of type String and a return value of type String.
You must also write a second subroutine that takes a String as a parameter and returns a String. This subroutine should make a new string that is a copy of the parameter string, except that all the non-letters have been omitted. The new string should be returned as the value of the subroutine. You can tell that a character, ch is a lower-case letter by testing if (ch >= 'a' && ch <= 'z')
(Note that for the operation of converting str to lower case, you can simply use the built-in toLowerCase subroutine by saying: str = str.toLowerCase();)
You should write a descriptive comment before each subroutine, saying what it does.
Finally, write a main() routine that will read in a string from the user and determine whether or not it is a palindrome. The main routine should use The program should print the string converted to lower case and stripped of any non-letter characters. Then it should print the reverse string. Finally, it should say whether the string is a palindrome. (Use the two subroutines to process the user's string.) For example, if the user's input is "Hello World!", then the output might be:
stripped: helloworld
reversed: dlrowolleh
This is NOT a palindrome.
and if the input is "Campus motto: Bottoms up, Mac!", the output might be:
stripped: campusmottobottomsupmac
reversed: campusmottobottomsupmac
This IS a palindrome.
You must complete your program, test, debug, and execute it. You should test two different cases, one that is a palindrome and another one that is not a palindrome. You must submit your java code file (preferably by cut and paste the code into the assignment dialog box). The output of your program must be captured by either copying the content in the output window and pasting it into the assignment dialog box or by capturing the image of the screen which contains the output of your java program or the output and submitting this with your assignment as an attachment. In windows you can capture a screen shot with the Ctrl Alt and Print Screen key sequence. This image can then be pasted into a Word, WordPad, or OpenOffice document which can be submitted with your assignment.
In: Computer Science
Answer the following questions showing all work. Full credit will not be given to answers without work shown. If you use Minitab Express or StatKey include the appropriate output (copy + paste). If you do any hand calculations show your work using the Word equation editor. Clearly identify your final answers. Output without explanation will not receive full credit and answers with no output or explanation will not receive full credit. Round all answers to 3 decimal places. If you have any questions, post them to the course discussion board.
1. A team of researchers has developed a new weight loss supplement. They want to know if patients who use the new supplement for four weeks lose any weight. The supplement has some minor side effects including mild headaches and achiness. If the researchers obtain evidence of weight loss they will proceed to produce the supplement commercially and sell it for a large profit. If they do not obtain evidence of weight loss they will end the project. [70 points]
A. State the null and alternative hypotheses that the researchers should test. Use md to denote the mean weight loss computed as beginning weight minus final weight.
B. What does a Type I error mean in this situation? What are the consequences of making a Type I error here?
C. What does a Type II error mean in this situation? What are the consequences of making a Type II error here?
D. In this scenario, is a Type I or Type II error more serious? Or, are they equally serious? Explain your reasoning.
E. If you were working with this research team, what alpha level would you use? Explain your reasoning.
Assume that the research team completes this study with a sample size of 500 and finds a mean weight loss of 0.475 pound with a standard deviation of 3.978 pounds. Their p-value is 0.0039
F. Using the alpha level you selected in part E, are their results statistically significant? Explain why or why not.
G. Are their results practically significant? Explain why or why not.
2. The STAT 200 course coordinator wants to estimate the proportion of all online STAT 200 students who utilize Penn State Learning’s online tutoring services by either attending a live session or viewing recordings of sessions. In a survey of 80 students during the Fall 2018 semester, 29 had utilized their services. She used bootstrapping methods to construct a 95% confidence interval for the population proportion of [0.263, 0.475]. Use this information to address the following questions. [30 points]
A. Supposed the coordinator decides that she wanted to conduct a hypothesis test instead. She wants to know if the proportion who utilize Penn State Learning’s online tutoring services is different from 0.25. What would be the appropriate null and alternative hypotheses?
B. Based on the 95% bootstrap confidence interval, would you expect the coordinator to reject or fail to reject the null hypothesis from part A at the 0.05 alpha level? Do NOT conduct the hypothesis test; use the confidence interval given in the question. Explain your reasoning.
C. Using this scenario, compare and contrast confidence intervals and hypothesis testing. List at least one similarity and at least one difference.
In: Math
Writing Assignment #1 Set of Instructions for a Website Summary of the Assignment: • Task: In this assignment, you will write a set of instructions that explain how to accomplish a task on a website. • Length: There is no minimum or maximum word count. However, your instructions must have 6 or more steps. More information on the number of steps is provided below. • Graphics: You must include at least one graphic for each step. o at least 6 graphics should be integrated into your set of instructions o all graphics should be screen captures of the website you are demonstrating o all graphics should be labeled • The first step of the set of instructions should start at the url of the website. o Do not start the instructions by telling the user to turn on his or her computer or to open up a particular web browser. You should assume the user knows that he or she needs to have a computer, needs to turn it on, and needs to use a web browser. You should start by directing the user to start at the url of the website on which the task is going to take place. Brief Description and Strategies to Follow: Please keep in mind the following principles when writing this assignment: • You must provide instructions on how to accomplish a task on a website. Some examples of topics are the following. (Keep in mind that you may select your own topic. These are just examples to help you consider various topics.) o how to check your balance in your checking account online o how to perform a function in your class in LEO o how to find and borrow a book on your local public library’s website o how to pay a fee on the website for the Motor Vehicle Association in Maryland (or the equivalent for your state) o how to change your credit card information on Amazon’s website • You must have at least 6 steps. • Each step is to be numbered and is to begin with an imperative verb, as the resources in the class indicate. • Every step will include a picture or graphic to help the reader follow the instructions. Sections to Include in Your Set of Instructions: The set of instructions will include the following sections: • Title Page • Overview or Introduction with background information about why a user would want to accomplish the task you are describing. • Instructions o number all of the main steps, as the resources for the class indicate o provide a graphic for steps of the instructions that need a graphic ▪ all graphics will be screen captures of the website. ▪ all graphics should be labeled Helpful Guides and Resources: • Chapter 10 from Tebeaux and Dragga, which is available in the e-reserves section of the class, is a helpful document to review as you begin this assignment. • The Tech Writing Handbook by Dozuki, which is one of the resources listed in our class, has an appendix that provides tips in writing instructions and incorporating graphics into instructions. • The Mayfield Handbook, which is also one of the resources listed in our class, features excellent tips on writing instructions. o Section 2.8.3 of the handbook, Instructions and Procedures, will be particularly helpful. • Some sample sets of instructions written by previous students in WRTG 393 are provided
In: Computer Science
Question
Many theorists believe that people have an innate predisposition to learn language. Three of the following provide sources of evidence that these theorists use to support their belief. Which one is not used to support an inherited predisposition to learn language?
Group of answer choices
Children develop increasingly larger and more sophisticated vocabularies as they grow older.
Most languages have certain characteristics in common, such as similar ways of forming negatives.
Children sometimes learn a language more easily when they are exposed to it at a young age.
People in the same community learn the same language despite very different experiences with that language.
Question
Maureen vehemently denies that trees are plants. Her understanding of what a plant is reflects which of the following errors?
Group of answer choices
a pragmatic error
undergeneralization
overgeneralization
overregularization
Question
Knowing which word combinations are grammatically correct reflects knowledge of:
Group of answer choices
Semantics
Context
Generalization
Syntax
Question
Which one of the following sentences reflects overregularization in a child's speech? The words in question are underlined.
Group of answer choices
I ain't going to school today.
Are you gonna go on the field trip?
He don't know anything.
The sheeps are in the meadow.
Question
LaWanda understands that a single sentence can sometimes be interpreted in two or more ways. For example, she realizes that the sentence "I know more beautiful women than Miss America" has two possible interpretations: "I know women who are more beautiful than Miss America is" or "I know more beautiful women than Miss America knows." LaWanda's appreciation for the double meanings of some sentences reflects:
Group of answer choices
Expressive language
Overgeneralization
Pragmatics
Metalinguistic awareness
Question
Based on the textbook's discussion of bilingualism and bilingual children, three of the following statements are true. Which one of the statements is not necessarily true?
Group of answer choices
Bilingualism is sometimes the result of living in a household in which two languages are spoken regularly.
Learning a second language promotes greater metalinguistic awareness.
Children who learn a second language in addition to their native tongue tend to have a more positive attitude toward people who speak that second language.
Children who learn two languages before the age of four are likely to master less of each language than they would if they learned only one.
Question
Three of the following statements accurately describe the diversity we are likely to see in students' cognitive development. Which statement is inaccurate?
Group of answer choices
Rehearsal is more commonly observed in children who live in developing countries than in children who live in highly urbanized and industrialized ones.
When eighth graders are asked to separate and control variables in a problem about fishing, those who have often fished with family or friends will be more successful than students who have never fished.
Students with physical and sensory challenges may have less general knowledge of the world, limiting their ability to relate new experiences to things they already know.
Some children in a first-grade classroom may show concrete operational thought, whereas others may show signs of preoperational thought.
In: Psychology
Chapter 6: Normal Probability (These problems are like the problems in Section 6.2). Using a Normal Distribution to find probabilities: Use the table E.2 in your text. Draw a sketch and indicate what probabilities (E.g. P (X<3 and X>10) for what is required for each part of the problem. To make sketches copy and paste into Word for the areas under the bell-curve you have the NormalSketch.ppt powerpoint slide in the Resources Handout area on Laulima, The main point of providing a sketch is to give you a visual idea of what your solution will be. 2. Do problem (6 points) Remember, you need the sketches to get credit. You order and manage the medications in the Pharamacy for Queens hospital. The CEO is concerned because the hospital is ordering and stocking medicine with short shelf lives and its not being used and thrown away. There is a medicine called Harvoni that is used for Hepatitis the cost of a treatment is $95,000 and the shelf life for the medicine is 12 weeks. Last year s significant amount of this medicine was disposed because of the short shelf life: How many treatments should you order? For this question the mean (μ) was 20, the standard deviation (σ) was 5, skewness was .06 and kurtosis was - .27. a. You can find the probabilities for this problem assuming a normal (bell-shaped) curve. Why is it OK for this particular situation? b. What is the probability that you will use no more than10 treatments in a given week? c. What is the probability that will use more than 36 treatments in a given week? d. Would using more than 36 treatments in a week be an outlier for this data set? e. You expect touse μ harvoni each day. Because of the variability you will actually sell more or less each day. To understand this, find out how many less or more than μ you expect to sell 80% of the time. That is, find two values equal distance from the mean such that 80% of all values fall between them. Specifically find what number of x Harvoni where 80% of the values fall between μ-x and μ+x f. You can only have a fixed amount of amount of treatments on hand to sell every week. As in (e) you know you will surely use more or less than μ treatments each week. If you run out of treatments, your patients will die. But if you order too many treatments they will go bad and you will have to throw them out so you are willing to sell out occasionally. How many treatments must you have on hand to sell if you wanted to ensure you do not runl out more than 5% of the time? (This is called having a 95% service level) g. The z-value for having a given service level is called the safety-factor. Explain what this factor does in terms of μ and σ for the 95% service level you found in (f). What if you wanted to only have a 50% service level? What about 40% service level?
In: Math
A) Many test cases.
For each case, the first line is the number N that indicates the amount of the students in the database.
Next to several N lines are the information of each student, include student ID, name, gender, and age.
And then will receive a number M that indicates there will be M search.
For each search line is an ID number, you need to compare to the database if there is any student with that ID. If yes, print ID, name, gender, and age of this student (if the ID is repeated, just print the previous one); if not, print "No Answer!".
You need to do this question by defining the data structure otherwise you can't real get the points.
Note: need can accept Chinese word! (take care of your array size)
Sample Input
4
1 Anna G 22
2 Teddy B 19
3 Joseph B 21
4 Rita G 22
2
1
5
2
20 阿王 男 16
23 阿美 女 15
1
23
Sample Output
1 Anna G 22
No Answer!
23 阿美 女 15
B)
Use stack to implement postfix arithmetic operation.
Input
Many test cases until EOF.
Each line is a postfix arithmetic operation formula.
There is no blank between the numbers, and the number only is 0-9.
Output
The result of each line.
But if the postfix arithmetic operation formula is wrong (it means you can't get the correct answer), please output "Input Error".
Sample Input
35+
3+5
63/14-*3+8-
Sample Output
8
Input Error
-11
C) There are several block stacks. The number of blocks for each stack may not be same, so your task is to move the block to let them be the same and calculate the minimum moves.
Example,
1 2 3
move stack 3 one block to the stack 1, so it will be:
2 2 2
Input
Many test cases.
For each case, first line is the number N(N<=50) of block stacks.
Next several N numbers are the number of blocks for each stack.
When N=0, the test is end.
Output
The case number and the minimum moves of each case. All the test are legal.
Sample Input
5
1 2 3 4 5
3
9 4 2
0
Sample Output
Set #1
The minimum number of moves is 3.
Set #2
The minimum number of moves is 4.
D)
Naming is important in the code. We always choose the relational vocabulary to name a variable. When we have two or more vocabularies to name, we are used to let the first letter of each vocabulary to be capitalized and connect all the vocabulary.
Take example, room number => RoomNuber sky color => SkyColor
Input
Many test cases until EOF.
Each line is many vocabularies.
Output
Naming result of each vocabulary.
Sample Input
aaaa bbbb cccc
ABCD BCDF FGHRTH
Sample Output
AaaaBbbbCccc
AbcdBcdfFghrth
| Programming language: | C++ |
In: Computer Science
1.Conduct an analysis and hypothesis test of your choice on the data you collected. Write a 250-500 word research summary of the findings generated in the assignments for Topics 2 through 5. The research summary should address the following.
a. Explain what type of analysis and hypothesis test was conducted on the data collected.
b. Summarize the survey results based on the results of the data you analyzed.
c. Include the Excel analysis as part of the document.
Data available below: Time stamp 1. If given the opportunity to work from home would you? Yes/No/Maybe
2. Do you consider working from home more of a employee convenience or employer benefit?
3. Who benefits more from the "Work from Home" opportunity?
| 8/11/2019 11:21:21 | Yes | Employee Convenience | Employee |
| 8/11/2019 11:22:28 | Yes | Employer Benefit | Employer |
| 8/11/2019 11:24:03 | Maybe | Employee Convenience | Employee |
| 8/11/2019 11:26:37 | Maybe | Employee Convenience | Employee |
| 8/11/2019 11:29:04 | Yes | Employee Convenience | Employee |
| 8/11/2019 11:36:23 | Yes | Employer Benefit | Employee |
| 8/11/2019 11:36:55 | Yes | Employee Convenience | Employee |
| 8/11/2019 11:43:05 | Yes | Employee Convenience | Employee |
| 8/11/2019 11:59:13 | Yes | Employer Benefit | Employee |
| 8/11/2019 12:14:33 | Maybe | Employee Convenience | Employee |
| 8/11/2019 12:22:02 | Yes | Employer Benefit | Employer |
| 8/11/2019 12:39:02 | Yes | Employee Convenience | Employee |
| 8/11/2019 12:47:51 | Yes | Employee Convenience | Employee |
| 8/11/2019 13:12:20 | Yes | Employee Convenience | Employer |
| 8/11/2019 13:49:33 | Yes | Employer Benefit | Employer |
| 8/11/2019 14:07:45 | Maybe | Employee Convenience | Employer |
| 8/11/2019 15:16:18 | Yes | Employer Benefit | Employer |
| 8/11/2019 18:55:11 | Yes | Employer Benefit | Employer |
| 8/11/2019 19:07:52 | Yes | Employer Benefit | Employer |
| 8/11/2019 20:01:33 | Maybe | Employee Convenience | Employee |
| 8/11/2019 20:03:24 | Yes | Employer Benefit | Employer |
| 8/11/2019 20:06:52 | |||
| 8/11/2019 21:38:25 | Yes | Employer Benefit | Employer |
| 8/12/2019 5:52:13 | Yes | Employer Benefit | Employer |
| 8/12/2019 6:56:04 | Yes | Employee Convenience | Employee |
| 8/12/2019 12:16:08 | Yes | Employer Benefit | Employer |
In: Math
Motor-Dexterity Test Motor-dexterity tests are often used in psychological studies, especially in neuropsychology. For this task, we are going to test motor-dexterity while looking for signs of frustration. First, take a clean pair of rolled-up socks or some other soft item. Then, have the participants throw it into a hoop you make with your arms. The objective is not to see how well they do the task but to see which hand they use; you are trying to determine dominance. After doing this task, ask the participants which hand they prefer to use when writing. While most will prefer the right, some will prefer the left. If a person says both, ask that individual to write a sentence with both hands, one at a time and the two of you can decide which hand to call dominant. In most cases, people will report they use the right hand more, and they will also unintentionally pick the right hand to throw the object with. If they report left and use the right hand to throw, then record that as mixed, but select the hand they choose as dominant. In the end, you will go with what the participant decides. You are required to record all information on the data sheet. This study involved ten participants. The researcher timed how fast each person put fifteen toothpicks into a mug with each hand. To reduce a significant difference being caused by practice effects, five of the participants started with their dominant hand (DH) and the next set of five started with their nondominant hand (NDH). While they were doing the task, the researcher rated the level of frustration while performing with one hand and then the other one. The researcher was careful not to allow experimenter bias to influence what he or she recorded. Here is the scale used to rate frustration: Very Frustrated Not Very Frustrated 5 4 3 2 1 Look at the data sheet: Participant # Start with NDH (seconds) FL-NDH DH (seconds) FL-DH 1 Right 7 3 6 1 2 Right 10 4 8 2 3 Right 9 3 8 2 4 Left 6 2 7 3 5 Right 8 4 6 1 6 Left 12 5 9 1 7 Left 8 1 7 1 8 Right 11 3 10 2 9 Left 8 2 8 2 10 Left 13 5 9 3 The hypotheses for the study were: People will perform the motor-dexterity task faster with their DH as compared to their NDH. People will show more frustration while using the NDH. Determine the average time with the motor-dexterity test, along with the standard deviation, and then use Minitab to analyze the data with a paired t-test to see if there is a significant performance difference between the two hands. Run another paired t-test to see if there is a difference in frustration (FL) while using the DH versus the NDH. Obtain the results and decide if the hypotheses are supported. Write a summary of the findings. Submit the results and summary of the findings in a 3- to 4-page Microsoft Word document.
In: Math
Exotic Food Inc., Capital Budgeting Case
CASE SUMMARY
Exotic Food Inc., a food processing company located in Herndon, VA, is considering adding a new division to produce fresh ginger juice. Following the ongoing TV buzz about significant health benefits derived from ginger consumption, the managers believe this drink will be a hit. However, the CEO questions the profitability of the venture given the high costs involved. To address his concerns, you have been asked to evaluate the project using three capital budgeting techniques (i.e., NPV, IRR and Payback) and present your findings in a report.
CASE OVERVIEW
The main equipment required is a commercial food processor which costs $200,000. The shipping and installation cost of the processor from China is $50,000. The processor will be depreciated under the MACRS system using the applicable depreciation rates are 33%, 45%, 15%, and 7% respectively. Production is estimated to last for three years, and the company will exit the market before intense competition sets in and erodes profits. The market value of the processor is expected to be $100,000 after three years. Net working capital of $2,000 is required at the start, which will be recovered at the end of the project. The juice will be packaged in 20 oz. containers that sell for $3.00 each. The company expects to sell 150,000 units per year; cost of goods sold is expected to total 70% of dollar sales.
Weighted Average Cost of Capital (WACC):
Exotic Food’s common stock is currently listed at $75 per share; new preferred stock sells for $80 per share and pays a dividend of $5.00. Last year, the company paid dividends of $2.00 per share for common stock, which is expected to grow at a constant rate of 10%. The local bank is willing to finance the project at 10.5% annual interest. The company’s marginal tax rate is 35%, and the optimum target capital structure is:
| Common equity | 50% |
| Preferred | 20% |
| Debt | 30% |
Your main task is to compute and evaluate the cash flows using capital budgeting techniques, analyze the results, and present your recommendations whether the company should take on the project.
QUESTIONS
To help in the analysis, answer all the following questions. Present the analysis in one Excel file with the data, computations, formulas, and solutions. It is preferred that the Excel file be embedded inside the WORD document (question 8).
|
Years |
Free Cash Flows |
|
0 |
$ -252,000.00 |
|
1 |
$118,625.00 |
|
2 |
$127,125.00 |
|
3 |
$181,000.00 |
The four techniques are NPV, IRR, MIRR, and discounted Payback. Assume the reinvestment rate to be 8% for the MIRR. Also, assume that the business will only accept projects with a payback period of two and half years or less.
In: Finance