Task CPP
Some information on the Internet may be encrypted with a simple algorithm known as rot13, which rotates each character by 13 positions in the alphabet. A rot13 cryptogram is a message or word in which each letter is replaced with another letter.
For example, the string
the bird was named squawk
might be scrambled to form
cin vrjs otz ethns zxqtop
Details and Requirements
The test driver file lab3.cpp contains an incomplete implementation of the cipher as defined as the class Rot13.
To allow user input a string, you need to override the stream extraction operator >> for the Rot13 class. The class contains the string field text that must be filled with the input text.
Instructions
lab3.cpp
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class Rot13 {
friend ostream& operator<<(ostream&, const
Rot13&);
friend istream& operator>>(istream&, Rot13&);
string text;
public:
Rot13();
bool valid();
void encrypt();
};
bool Rot13::valid() {
}
void Rot13::encrypt() {
}
ostream& operator<<(ostream& out, const Rot13&
c) {
}
istream& operator>>(istream& in, Rot13& c)
{
}
/*
Please enter the text: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Invalid input!
Please enter the text: slkgjskjg akjf Adkfjd fsdfj
Invalid input!
Please enter the text: abcdefghijkl mnopqrst uvwxyz
Encoded text: "nopqrstuvwxy zabcdefg hijklm"
*/
int main() {
Rot13 cipher;
cout << "Please enter the text: ";
cin >> cipher;
if (!cipher.valid()) {
cout << "Invalid input!" << endl;
return 1;
}
cipher.encrypt();
cout << "Encoded text: " << cipher << endl;
return 0;
}
In: Computer Science
Implement the following functions. Each function deals with null terminated C-strings. You can assume that any char array passed into the functions will contain valid, null-terminated data. Your functions must have the signatures listed below.
1. This function returns the last index where the target char can be found in the string. it returns -1 if the target char does not appear in the string. For example, if s is âGiantsâ and target is âaâ the function returns 2.
int lastIndexOf(char *s, char target)
2. This function alters any string that is passed in. It should reverse the string. If âflowerâ gets passed in it should be reversed in place to ârewolfâ. To be clear, just printing out the string in reverse order is insufficient to receive credit, you must change the actual string to be in reverse order.
void reverse(char *s)
3. This function finds all instances of the char âtargetâ in the string and replaces them with âreplacementCharâ. It also returns the number of replacements that it makes. If the target char does not appear in the string it returns 0 and does not change the string. For example, if s is âgo giantsâ, target is âgâ, and replacement is âGâ, the function should change s to âGo Giantsâ and return 2.
int replace(char *s, char target, char replacementChar)
4. This function returns the index in string s where the substring can first be found. For example if s is âSkyscraperâ and substring is âyscâ the function would return 2. It should return -1 if the substring does not appear in the string.
int findSubstring(char *s, char substring[])
5. This function returns true if the argument string is a palindrome. It returns false if it is not. A palindrome is a string that is spelled the same as its reverse. For example âabbaâ is a palindrome. So is âhannahâ, âabc cbaâ, and âradarâ.
bool isPalindrome(char *s)
Note: do not get confused by white space characters. They should not get any special treatment. âabc baâ is not a palindrome. It is not identical to its reverse.
6.This function should reverse the words in a string. Without using a second array. A word can be considered to be any characters, including punctuation, separated by spaces (only spaces, not tabs, \n etc.). So, for example, if s is âThe Giants won the Pennant!â the function should change s to âPennant! the won Giants Theâ.
void reverseWords(char *s)
Requirements
- You may use strlen(), strcmp(), and strncpy() if you wish, but you may not use any of the other C-string library functions such as strstr(), strncat(), etc.
- You will not receive credit for solutions which use C++ string objects, you must use C-Strings (null-terminated arrays of chars) for this assignment.
In: Computer Science
Use Workbench/Command Line to create the commands that will run the following queries/problem scenarios.
Use MySQL and the Colonial Adventure Tours database to complete the following exercises.
1. List the last name of each guide that does not live in Massachusetts (MA).
2. List the trip name of each trip that has the type Biking.
3. List the trip name of each trip that has the season Summer.
4. List the trip name of each trip that has the type Hiking and that has a distance longer than 10 miles.
5. List the customer number, customer last name, and customer first name of each customer that lives in New Jersey (NJ), New York (NY) or Pennsylvania (PA). Use the IN operator in your command.
6. Repeat Exercise 5 and sort the records by state in descending order and then by customer last name in ascending order.
7. How many trips are in the states of Maine (ME) or Massachusetts (MA)?
8. How many trips originate in each state?
9. How many reservations include a trip price that is greater than $20 but less than $75?
10. How many trips of each type are there?
11. Colonial Adventure Tours calculates the total price of a trip by adding the trip price plus other fees and multiplying the result by the number of persons included in the reservation. List the reservation ID, trip ID, customer number, and total price for all reservations where the number of persons is greater than four. Use the column name TOTAL_PRICE for the calculated field.
12. Find the name of each trip containing the word âPond.â
13. List the guideâs last name and guideâs first name for all guides that were hired before June 10, 2013.
14. What is the average distance and the average maximum group size for each type of trip?
15. Display the different seasons in which trips are offered. List each season only once.
16. List the reservation IDs for reservations that are for a paddling trip. (Hint: Use a subquery.)
17. What is the longest distance for a biking trip?
18. For each trip in the RESERVATION table that has more than one reservation, group by trip ID and sum the trip price. (Hint: Use the COUNT function and a HAVING clause.)
19. How many current reservations does Colonial Adventure Tours have and what is the total number of persons for all reservations?
In: Computer Science
ABC Golf Corporation Assignment:
ABC Golf Equipment Corporation has 500,000 shares outstanding and currently has no debt. The company has a marginal tax rate of 35% and the firmâs stock price is $27 per share. The firmâs unlevered beta is 1.5, the risk-free rate of return is 5%, and the expected market return is 10%.
The company is thinking of issuing bonds and simultaneously repurchasing a portion of its stock. Because the company is issuing bonds to repurchase the stock, there is no anticipated change to the stock price as a result of the stock buyback. The bonds can be issued with a 6% coupon, and under the new proposed structure the debt to capital ratio would be 7%. If the companyâs debt to capital ratio exceeds 25%, the cost of debt would increase to a max rate of 8%. Company mandates require that the companyâs debt to equity ratio remains at less than 3.0 at all times. The firmâs earnings are not expected to grow over time. All of its earnings will be paid out as dividends.
|
Probability |
EBIT ($) |
|
0.05 |
-$1 Million |
|
0.25 |
2.3 Million |
|
0.40 |
4 Million |
|
0.25 |
5.8 Million |
|
0.05 |
6.1 Million |
Use Excel for your calculations and answer the ten questions on the following pages. Your submission should consist of two files:
1) Submit a Word document clearly showing your solutions and how you achieved them
2) Also if possible please submit an Excel worksheet showing your spreadsheets that you used to calculate solutions.
Questions to answer:
1) Based on the given probabilities in the table above, what is the expected EBIT for ABC Golf Equipment Corporation?
2) If the market value equals the book value of the firmâs assets, what is the current market value of ABC Golf Equipment Corporationâs assets?
3) What is the current cost of equity to the firm?
4) Based on the current share price, what is the current dividend per share?
5) Based on the current share price, what is the current dividend yield?
6) If there is no change to the stock price as a result of the share repurchase, how much equity will shareholders own after the proposed capital restructuring?
7) After the proposed change in capital structure, how much debt will the company now carry?
8) Under these market conditions, what is the firmâs optimal debt to capital ratio for the firm?
9) What is the WACC at the optimal debt to capital ratio?
10) Under a new proposed tax cut, corporate tax rates would now be reduced to 21%. Explain how the new proposed tax plan affects the optimal capital structure. What would be the optimal capital structure under the new proposed tax plan?
In: Finance
In: Computer Science
Submission Question 3: Polymorphism
Problem
You are writing software for a companyâs human resources department. As part of the requirements, it would like to have a function that calculates the salary of an individual based on the position he or she holds, years of service, and hours worked.
This program will demonstrate the following:
Solving the Problem
Step 1
The first thing that you must determine is what attributes are common to all employees and what methods they can share. Can salary be easily calculated by the same method without some additional input from the user? By using polymorphism, you can make one method that calculates salaries for different groups. First, determine the base class and what method needs to be implemented by the child classes. By making the calcSalary() method abstract, it will be a required method of the child classes.
Step 2
You can then define the child classes that inherit the shared attributes from the base Employee class but also inherit the requirement that they implement from the calcSalary() method. Each employee type will have a different set of attributes and a different method of calculating the salary, but the same method call will be used to calculate it.
Step 3
You can now create a list to hold all employee types and populate it.
Step 4
Because you used polymorphism in the classes, you can now use one loop to calculate and output the salaries of the employees.
Documentation Guidelines:
Use Python Programming. Use good programming style (e.g., indentation for readability) and document each of your program parts with the following items (the items shown between the '<' and '>' angle brackets are only placeholders. You should replace the placeholders and the comments between them with your specific information). Your cover sheet should have some of the same information, but what follows should be at the top of each program's sheet of source code. Some lines of code should have an explanation of what is to be accomplished, this will allow someone supporting your code years later to comprehend your purpose. Be brief and to the point. Start your design by writing comment lines of pseudocode. Once that is complete, begin adding executable lines. Finally run and test your program.
Deliverable(s):
Your deliverable should be a Word document with screenshots showing the source code and running results, and discuss the issues that you had for this project related to AWS and/or Python IDE and how you solved them for all of the programs listed above as well as the inputs and outputs from running them. Submit a cover sheet with the hardcopy of your work.
In: Computer Science
In: Computer Science
13.1 Radical Rewrite: Rescuing a Slapdash Résumé (Obj. 4)
The following poorly organized and written résumé needs help to remedy its misspellings, typos, and inconsistent headings.
Your Task. By using the information in the resume, revise Isabellaâs resume into a correctly formatted one-page chronological resume. Please read the resume section of your textbook, review the grading rubric and the chronological resume samples that I uploaded into Blackboard under Ch12 Writing Assignment.
Résumé of Isabella R. Jimenez
1340 East Phillips Ave., Apt. D Littleton, CO 80126
Phone 455-5182 âą E-Mail: [email protected]
OBJECTIVE
Iâm dying to land a first job in the âreal worldâ with a big profitable company that will help me get ahead in the accounting field.
SKILLS
Word processing, Internet browsers (Explorer and Google), Powerpoint, Excel, type 40 wpm, databases, spreadsheets; great composure in stressful situations; 3 years as leader and supervisor and 4 years in customer service
EDUCATION
Arapahoe Community College, Littleton, Colorado. AA degree Fall 2013
Now I am pursuing a BA in Accounting at CSU-Pueblo, majoring in Accounting; my minor is Finance. My expected degree date is June 2015; I recieved a Certificate of Completion in Entry Level Accounting in December 2012.
I graduated East High School, Denver, CO in 2009.
Highlights:
· Named Line Manger of the Month at Target, 08/2009 and 09/2010
· Obtained a Certificate in Entry Level Accounting, June 2012
· Chair of Accounting Society, Spring and fall 2013
· Deanâs Honor List, Fall 2014
· Financial advisor training completed through Primerica (May 2014)
· Webmaster for M.E.Ch.A, Spring 2015
Part-Time Employment
Financial Consultant, 2014 to present
I worked only part-time (January 2014-present) for Primerica Financial Services, Pueblo, CO to assist clients in refinancing a mortgage or consolidating a current mortgage loan and also to advice clients in assessing their need for life insurance.
Target, Littleton, CO. As line manager, from September 2008-March 2012, I supervised 22 cashiers and front-end associates. I helped to write schedules, disciplinary action notices, and performance appraisals. I also kept track of change drawer and money exchanges; occasionally was manager on duty for entire store.
Mr. Kâs Floral Design of Denver. I taught flower design from August, 2008 to September, 2009. I supervised 5 florists, made floral arrangements for big events like weddings, send them to customers, and restocked flowers.
In: Operations Management
For the third time in the past 5 minutes, Jeremyâs fourth-grade teacher has had to tell him to sit in his seat and keep his hands to himself. It is as if Jeremyâs feet are attached to springs. He doesnât walk; he bounces. He doesnât sit; he squirms. Itâs not just the motor activity that sets him apart from the rest of the class: Jeremy also has a motor mouth. He talks incessantly. He canât resist sharing his ideas with the class, whether they are welcomed or not. As soon as he thinks about them, regardless of whether the time is right, Jeremy blurts out answers, disrupts the classroom, and adds considerable stress to his teacherâs already stressful job.
Jeremy is almost the polar opposite of his classmate Leonard. For Leonard, Jeremyâs antics just fade into the background of other classroom stuïŹ. Unlike Jeremy, Leonard is very quiet and rarely participates in classroom discussions, unless the discussions are about something that really interests him. Leonard spends most of his time staring out the window or oïŹ into space. The word daydreamer seems to ïŹt Leonard perfectly.
Leonard always seems to be at least one step behind everyone else. Leonard is rarely on task; he drifts oïŹ in the middle of assignments; often he has to be reminded to return toe arth. Leonard is doing poorly academically. He just doesnât seem to tune in to whatever channel the rest of the class is on. Initially, the teacher thought that Leonard was a slow learner, until the class began to discuss diïŹerent computer programs. The teacher was shocked at Leonardâs sophisticated knowledge base and expertise in the area. That was when his teacher began to think that there was something else getting in the way of Leonardâs academic success.
In this case study, Jeremy and Leonard share more than the same classroom and same teacher. As incredible as it might seem, they both probably share variations of the same disorder: attention-deïŹcit/hyperactivity disorder (ADHD). How can two children who seem so diïŹerent fall into the same diagnostic category?This is a question that has plagued theorists for the past 100 years. Although ADHD is among one of the most prevalent disorders in childhood, it continues to challenge professionals. It has been a topic for considerable discussion and controversy, especially regarding the over prescription of stimulant medications (Diller,1996).
In a 100 words or more:
Provide a discussion of the co-occurring clusters for childhood and adolescence symptoms and features.
In: Psychology
Case Study: Le Chic Restaurant
The Le Chic is a restaurant located on a busy street in the centre of a major city. It attracts a steady flow of customers who like its commitment to quick service with good food. As such the management pride themselves on offering a standard menu, which includes a good range of affordable yet delicious dishes â from starters and appetizers, through main courses and specials to pastries and desserts. While Le Chic seats around 80 customers, its layout is basic restaurant style and customers have often said that it has a âfast-foodâ feel to it which fits with its current business objectives but may not be ideal for the future. A major concern for management has always been to maximise efficiency and reduce turnaround times: orders must be swiftly relayed to the kitchen and the food brought to the table within 15 minutes, even during âpeak hoursâ â the intended outcomes being consistency in both customer service and daily sales targets.
Le Chic employs 35 people, 50% of whom have permanent contracts, working either day or evening shifts. The other half is split between part-timers and relief workers who are usually the ones to do double shifts over busy weekends. All terms and conditions of employment are negotiated on an individual basis.
Over the past few months staff have found it increasingly hard to maintain the desired levels of customer service. There seems to be a lack of coordination between waiting and kitchen staff. Once seated, customers often have to wait for as long as one and a half hours before being served while a large number of those queuing up outside usually just give up on the long waits and walk away in search of other eating options, which in the city centre are plentiful. More alarmingly, profit margins have remained âthinâ in the recent years and, for the first time in 10 years losses were registered on the restaurantâs balance sheet. Le Chicâs current manager attributes this particularly poor performance to the economic crisis and to the fact that the competition has all of a sudden tightened up with the opening of a pub and two new restaurants on the main street and a growing cluster of similar businesses within a mile radius.
Dispirited, the current manager has decided to step down to make way for a new manager, John, who has just completed his Masters in Business Administration but also has experience of working in another similar type of restaurant. Johnâs remit is to deliver a new business strategy that can effectively reverse Le Chicâs current performance and ensure its survival and growth in the longer term. Whilst recognizing that these are indeed difficult times, John believes that there is need, more than ever, for businesses demonstrate an âentrepreneurial spiritâ if they are to have any chance of success. He has therefore formulated a proactive and quite aggressive change strategy containing the following key components, which are to come on stream almost at the same time:
All the owners of Le Chic think that Johnâs business strategy is very creative and the promise of bringing profit margins to 15% within 5 years. However, some have expressed their concerns with regards to the considerable capital outlay that Johnâs new strategy will require, which, if unsuccessful, will leave the business potentially bankrupt. To allay these concerns, John has asked to hire the services of a consultant to help him out with the execution of his new business strategy.
Coursework Assignment
You are required to step into the shoes of the consultant hired by Le Chic. Your task is to write a report addressing the key change issues that can have a significant impact on the implementation of its new business strategy. While practically oriented, your report should draw on appropriate change theories and models to include the following:
1. An analysis of the change context taking into account both the internal and external drivers for change. This should include both a PEST and SWOT analysis (please note that the word count contained within these tables will not be included in the overall word count, so please be as detailed as necessary). (500)
In: Operations Management