Questions
Task CPP Some information on the Internet may be encrypted with a simple algorithm known as...

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.

  • rot13 is an example of symmetric key encryption.

For example, the string

    the bird was named squawk

might be scrambled to form

    cin vrjs otz ethns zxqtop

Details and Requirements

  1. The test driver file lab3.cpp contains an incomplete implementation of the cipher as defined as the class Rot13.

  2. 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.

  3. The input string may only contain Latin lowercase letters and spaces. Write the method valid that checks if the input satisfies the above condition.
    • If the input contains valid characters then the method returns true value, otherwise it returns false.
  4. Write the method encrypt that encodes the input string using rot13 cipher. The encryption procedure replaces every occurrence of the character with the character 13 steps forward in the alphabet (in a circular way) . For example, a with n , b with o , and x with k, and so on.
    • Spaces are not scrambled.
    • You can transform characters to numbers which would allow to perform rotation transformation using addition/subtraction operations.
    • You can find numerical codes for letters in ASCII Table
  5. To output encrypted text on the screen, you need to override the stream insertion operator << for the Rot13 class.

Instructions

  • Use the file lab3.cpp which contains the testing driver code.
  • Implement Rot13 missing methods, so the program can be executed.
  • Test your program with the provided test input cases.

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...

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...

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...

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

As stated in the chapter, many different factors affect the running time of an algorithm. Your...

As stated in the chapter, many different factors affect the running time of an algorithm. Your task is to conduct experiments to see how sorting algorithms perform in different environments.


To construct this experiment you must have a program or two programs that sorts sets of data. The program or programs should sort a set of number using a quick sort and using a merge sort. To expedite this, example code that performs a quick sort and a merge sort have been provided.


You should conduct sets of experiments. Categorize your data in two major sections, one for merge sort results, one for quick sort results. Each section can be sub divided into criteria that you used to bench mark the sort.


Conduct benchmarking of quicksort and merge sort several times on the same system - once with as much software turned off a possible, and then with other programs running - Word, Excel, videos, etc. See if you can determine how different software or combinations of software running at the same time slow down the sorting algorithms the most. You might want to include an Internet connection in this test. Just as with the different software, How does a live connection to a network affect the running time of the algorithms?


Use Data Sets Starting at at 10,000,000 randomly generated numbers


All programming projects must have an associated Professional Lab Report submitted with in. A Lab Report must contain the minimum Requirements List Below


Template Workbook for Bench Marking Data

benchmarking.xlsx




Document Formatting

A document header - The Header section should contain your name
A document footer - The footer should contain a page number

Paragraphs Formatting should be formatted

1.5 line spacing
12 points before and after the paragraph

Character Formatting

Body Text should be 12 points
Segment Headers should be boldface

Submit a Project containing the Quick Sort Tool program you created to conduct the research. If the project contains the features of both programs, then only submit one project.

Submit a Project containing the Merge Sort Tool program you created to conduct the research. If the project contains the features of both programs, then only submit one project.

Submit an Excel Workbook containing the Bench Marking Data.

Submit a Lab Report for building your project tool.
Submit an Essay Report describing your work, your results, and your conclusions.Essays should follow the same formatting requirements as Lab Reports

In: Computer Science

Submission Question 3: Polymorphism Problem You are writing software for a company’s human resources department. As...

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:

  • How to create an abstract class,
  • How to overload a method,
  • How to use polymorphism to call functions on similar objects.

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

The main method is where Java begins execution of your program. In this assignment, you will...


The main method is where Java begins execution of your program. In this assignment, you will coding other methods in addition to the main method. These additional methods will perform specific functions and, in most cases, return results. Write all your methods in a class named Homework6Methods.java
‹
1 Write a public static method named getMaxOf2Ints that takes in 2 int arguments and returns the Maximum of the 2 values

2Write a public static method named getMinOf2Ints that takes in 2 int arguments and returns the Maximum of the 2 values

3Write a public static method named getMaxOf3Ints that takes in 3 int arguments and returns the Maximum of the 3 values

4Write a public static method named getMedianOf3Ints that takes in 3 int arguments and returns the Median Value of the 3 values

5Write a public static method named printMinOf3Ints that takes in 3 int arguments of type int and prints the minimum value of those 3 ints
Example: “The min is “ + minVal

6Write a public static method named getProdOfAllPositiveInts that takes in 1 int argument and returns the product of all the values between 1 and that number.
If the argument is NON-positive return 0



7Write a public static method named getProdOfAllNegativeInts that takes in 1 int argument and returns the product of all the values between -1 and that number.
If the argument is NON-negative return 0

8Write a public static method named isProdOfAllNegativeIntsNegative that takes in 1 int argument and returns true if the product of all the values between -1 and that number is negative, and false otherwise.

9Write a public static method named getCharAtIndex that takes in 2 arguments, a String s, and an int index. The method should return the char found at the index location of the string or if not found return a ‘?’

10Write a public static method named getCountOfCharInString that takes in 2 arguments, a String s, and a char c. The method should return an int representing the number of times the char was found within the string.

11Write a public static method named getStringReversed that takes in 1 argument of type String and returns the String in reverse order.

12Write a public static method named getStringTitleCased that takes in 1 argument of type String and capitalizes the first letter of each word in the String, then returns the title cased string.
Example:
Input: “the dog ate my homework!” Returns: “The Dog Ate My Homework!”
Input: “tHe Dog atE My HOMEwoRk!” Returns: “The Dog Ate My Homework!”
Input: “THE DOG ATE MY HOMEWORK!” Returns: “The Dog Ate My Homework!”

In: Computer Science

13.1 Radical Rewrite: Rescuing a Slapdash Résumé (Obj. 4) The following poorly organized and written résumé...

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...

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...

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:

  • Le Chic is to be turned into a chain restaurant. A total of ÂŁ1.5 million is to be spent on the refurbishment of the existing site and on the set up of two new restaurants in different cities.

  • The chain restaurant will differentiate its offerings in the form of a revamped more upmarket menu, a sumptuous dĂ©cor and a new bar area, for which a select clientele would be more than willing to pay a premium.
  • Around 60 new employees are to be recruited and deployed across the three restaurants. While all members of staff will have to attend induction training to meet the new standards of service, some of the more experienced staff will be transferred to the newly opened restaurants to help out with on-the-job training for new recruits.
  • A new information system will be set up to link up Le Chic with its suppliers and standardize ordering, payment and accounting processes across restaurants. Also, a multimedia website will enable customers to access menus, make reservations, post feedback, download discount vouchers, benefit from promotional events or simply keep abreast of any development at Le Chic.
  • Le Chic will seek opportunities for joint promotional alliances with potential partners especially those operating in the same areas of the chosen cities. A good example might be cinemas and local bowling alleys.

  • Finally, Le Chic will demonstrate social responsibility by sponsoring community projects, which can contribute to the development of a strong brand image and a self-reinforcing cycle of social value, employee engagement, customer loyalty and enhanced return on investment.

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