# Florida State College at Jack

In this project, you will develop algorithms that find road routes through the bridges to travel between islands in C++.

The input is a text file containing data about the given map. Each file begins with the number of rows and columns in the map considered as maximum latitudes and maximum longitudes respectively on the map. The character “X” in the file represents the water that means if a cell contains “X” then the traveler is not allowed to occupy that cell as this car is not drivable on water. The character “0” in the file represents the road connected island. That means if a cell contains “0” then the traveler is allowed to occupy that cell as this car can drive on roads.

The traveler starts at the island located at latitude = 0 and longitude = 0 (i.e., (0,0)) in the upper left corner, and the goal is to drive to the island located at (MaxLattitude-1, MaxLongitudes-1) in the lower right corner. A legal move from an island is to move left, right, up, or down to an immediately adjacent cell that has road connectivity which means a cell that contains “0”. Moving off any edge of the map is not allowed.

Input: The map files

Output: Print paths as explicitly specified for all the functions in Part A, Part B, and extra credit on the console.

You should have single main function that calls all the required functions for Part A, Part B, and extra credit for all the 3 given input map files one by one.

Coded graph.h file for your reference and provided it for you to refer to and download on canvas. You do not have to use this file mandatory, but if you are struggling to even start the project then this should definitely make your life much easier.

Part A

Consider the following class map,

{

public:

map(ifstream &fin);

void print(int,int,int,int);

bool isLegal(int i, int j);

void setMap(int i, int j, int n);

int getMap(int i, int j) const;

int getReverseMapI(int n) const;

int getReverseMapJ(int n) const;

void mapToGraph(graph &g);

bool findPathRecursive(graph &g, stack<int> &moves);

bool findPathNonRecursive1(graph &g, stack<int> &moves);

bool findPathNonRecursive2(graph &g, queue<int> &moves);

bool findShortestPath1(graph &g, stack<int> &bestMoves);

bool findShortestPath2(graph &, vector<int> &bestMoves);

void map::printPath(stack<int> &s);

int numRows(){return rows;};

int numCols(){return cols;};

private:

int rows; // number of latitudes/rows in the map

int cols; // number of longitudes/columns in the map

matrix<bool> value;

matrix<int> mapping; // Mapping from latitude and longitude co-ordinates (i,j) values to node index values

vector<int> reverseMapI; // Mapping from node index values to map latitude i value

vector<int> reverseMapJ; // Mapping from node index values to map longitude j value

};

1. Using the above class map, write function void map::mapToGraph(graph &g){…} to create a graph g that represents the legal moves in the map m. Each vertex should represent a cell, and each edge should represent a legal move between adjacent cells.

2. Write a recursive function findPathRecursive(graph &g, stack<int> &moves) that looks for a path from the start island to the destination island. If a path from the start to the destination exists, your function should call the map::printPath() function that should print a sequence of correct moves (Go left, Go right, Go down, Go up, etc.). If no path from the start to the destination exists, the program should print, “No path exists”. If a solution exists the solver should also simulate the solution to each map by calling the map::print() function. The map::print() function prints out a map visualization, with the goal and current position of the car in the map at each move, marked to show the progress. Hint: consider recursive-DFS.

3. Write a function findPathNonRecursive1(graph &g, stack<int> &moves) that does the same thing as in 2, but by using stack and without using recursion. If a path from the start to the destination exists, your function should call the map::printPath() function that should print a sequence of correct moves (Go left, Go right, Go down, Go up, etc.). If no path from the start to the destination exists, the program should print, “No path exists”. If a solution exists the solver should also simulate the solution to each map by calling the map::print() function. The map::print() function prints out a map visualization, with the goal and current position of the car in the map at each move, marked to show the progress. Hint: consider stack-based DFS.

4. Write a function findPathNonRecursive2(graph &g, queue<int> &moves) that does the same thing as in 2, but by using queue and without using recursion. If a path from the start to the destination exists, your function should call the map::printPath() function that should print a sequence of correct moves (Go left, Go right, Go down, Go up, etc.). If no path from the start to the destination exists, the program should print, “No path exists”. If a solution exists the solver should also simulate the solution to each map by calling the map::print() function. The map::print() function prints out a map visualization, with the goal and current position of the car in the map at each move, marked to show the progress. Hint: consider queue-based BFS.

The code you submit should apply all three findPath functions to each map, one after the other.

The map input files named map1.txt, map2.txt, and map3.txt can be downloaded from the canvas. Example of a map input file:

7
10
Start – 0XXXXXXXXX
00000000XX
0X0X0X0XXX
0X0X0X0000
XX0XXX0XXX
X0000000XX
XXXXXXX000Z – Destination

Part B

The shortest path on a map is a path from the start to the destination with the smallest number of intermediate islands, that is the path with the least number of intermediate “0”.

1. Write two functions findShortestPath1(graph &g, stack<int> &bestMoves) and findShortestPath2(graph &g, stack<int> &bestMoves) that each finds the shortest path on a map if a path from the start to the destination exists. The first algorithm should use Dijkstra algorithm and the second algorithm should use Bellman-Ford algorithm to find the shortest paths. In each case, if a solution exists the solver should call the map::printPath() function that should print a sequence of correct moves (Go left, Go right, Go down, Go up, etc.). If no path from the start to the destination exists, the program should print, “No path exists”. If a solution exists the solver should also simulate the solution to each map by calling the map::print() function. The map::print() function prints out a map visualization, with the goal and current position of the car in the map at each move, marked to show the progress. Each function should return true if any paths are found, and false otherwise.

Note: The use of the additional functions of class map is optional but highly recommended.

Extra Credit

1. Optimize Bellman-Ford algorithm to reduce the number of iterations and compare the runtime of the unmodified and modified algorithm for three given input maps. Your optimized Bellman-Ford algorithm should call map::print() function. It should also print the runtime of the unoptimized and optimized versions.

Some header files you may need are following, that can be found in you header files zip folder available to you to download on Canvas.

#include <limits.h>

#include “d_except.h”

#include <list>

#include <fstream>

#include “d_matrix.h”

#include <queue>

#include <vector>

# Florida State College at Jack

## Lab 4 Directions

Write a C program called threadcircuit to run on ocelot which will provide a multithreaded solution to the circuit-satisfiability problem which will compute for what combinations of input values will the circuit output the value 1. This is the sequential solution, which is also attached. You should create 4 threads and divide the 65,536 test cases among them. For example, if p=4, each thread would be responsible for roughly 65,536/8 number of iterations (if it’s not divisible, some threads can end up with one more iteration than the others).

`#include <stdio.h>#include <sys/time.h>/* Return 1 if 'i'th bit of 'n' is 1; 0 otherwise */#define EXTRACT_BIT(n,i) ((n&(1<<i))?1:0)int check_circuit (int z) {  int v[16];        /* Each element is a bit of z */  int i;  for (i = 0; i < 16; i++) v[i] = EXTRACT_BIT(z,i);  if ((v[0] || v[1]) && (!v[1] || !v[3]) && (v[2] || v[3])      && (!v[3] || !v[4]) && (v[4] || !v[5])      && (v[5] || !v[6]) && (v[5] || v[6])      && (v[6] || !v[15]) && (v[7] || !v[8])      && (!v[7] || !v[13]) && (v[8] || v[9])      && (v[8] || !v[9]) && (!v[9] || !v[10])      && (v[9] || v[11]) && (v[10] || v[11])      && (v[12] || v[13]) && (v[13] || !v[14])      && (v[14] || v[15])) {    printf ("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d\n",        v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],        v[10],v[11],v[12],v[13],v[14],v[15]);    return 1;  } else return 0;}int main (int argc, char *argv[]){  int count, i;  count = 0;  for (i = 0; i < 65536; i++)    count += check_circuit (i);  printf ("There are %d solutions\n", count);  return 0;}`

If a thread finds a combination that satisfies the circuit, it should print out the combination (like in the given sequential version), along with the thread id (a number between 0 and 3 (p-1)). In the end, the main thread should print out the total number of combinations that satisfy this circuit (like in the given sequential program). Mutex should be used to update the total by each thread. An example output of the program is shown below:

`% threadcircuit0) 01101111100110010) 11101111110110012) 10101111100110011) 11101111100110011) 10101111110110011) 01101111101110010) 10101111101110012) 01101111110110012) 1110111110111001There are 9 solutions`

Code should be nicely indented and commented.

Create a simple Makefile to compile your program into an executable called threadcircuit.

# Florida State College at Jack

Main Question – In art and painting, especially, color is such an important element. The history of art, from the Impressionists to the Abstract Expressionists, used color to depict light, space and even emotions. For this discussion, you are required to explore color in an in-depth way, beyond just answering the common question, “What is your favorite color?”

For this, explore and choose a color around you, perhaps it’s color on a wall that you have painted or on a piece of clothing you wear. Maybe it’s a color out in the world somewhere, like on a billboard you see on your way to work. What does the color mean to you? What affects does it create? How does it make you feel? Does it invoke a memory? Does the color symbolize anything? How would you classify this color in terms of hue, value, and saturation (look these up if you are not sure what they mean)? Try to be as specific and detailed as you can when describing the color. Finally, give this color a name in the same way as paint manufacturers will name colors we see in stores.

Answer 1 – When discussing standout colors which paint the picture of your life, the setting sky is one that can evoke a plethora of emotions, memories, and ponderous moments throughout my life. Whether it be a full on sunset over the ocean when living in Costa Rica as a child, or a palette of light and darker colors, however the distinct orange hue which the sky takes before the day turns to night, is especially appealing to me. A color which would look red when put next to orange, like sunburst taken full form, an explosion of crimson meeting tangerine, with the vibrant scenes of a fire yet as calm as lapping tides on a summer day.

The value of the color would include the fact that since it is at the end of the day, there are more shades than tints with the color of the setting sun, as the center of light dissipates from the sky for the night, yet there are also defiant streaks of light through it, coloring it to appear striped or patterned in an abstract way. It’s saturation is more of the hues at medium strength, as it is not orange in it’s truest sense, but mixed in with reds and blues to provide a plethora of wonder for the eye to behold. The calming, cool colors do not hurt to look at, but rather relax you as you take them in.

If one were to attempt to contain this piece of natural wonder, a landscape painting from the Universe itself, the name would have to be one which evokes the same emotion as when you are sitting back at the tail end of the day and seeing the Moon make it’s first appearance of the day. I would name this brilliant color, “Sunburst”, for the sake of it being the last sunshine before night falls.

Answer 2 – When I think of a standout color in my personal life and the affect it creates on my feelings I think of beige. The neutral palette is everywhere from wall colors, clothes, nail colors, bed sheets, furniture etc. It is a calming feeling that beige puts forth, it reminds me of a nice day walking along a beach or a trip to the coffee shop to get a coffee Frappuccino. It also reminds me of trench coats in the winter and fresh hot Krispy Kreme donuts. For me beige symbolizes calmness, relaxing, refreshing and dependability. Beige is all around me, my walls, my pillow cases, my jewelry box, wardrobe etc. Each day traveling to campus many historic buildings like libraries, town halls, banks etc, beige is the staple color for many of these buildings. During the Renaissance, opera houses, cathedrals, royal housing, libraries were painted beige. The neutral color has a low-saturation because it neutralizes and it is a mixture of multiple colors like white and brown. It’s hue is low because of the neutralization. The value of beige is a light brown it sits in between brown and white and is apart of the brown and orange color family. If I had to name this color it would be Pastry because all the delicious pastries are in this neutral color; croissants, cake, pie crust, scones, cinnamon rolls, tart crust, Danishes and the list can go on.

Answer the main question. Then respond to the two answers with one paragraph or two separately from each other.

# Florida State College at Jack

Write a C program that runs on ocelot for a salary calculator using only the command line options. You must use getopt to parse the command line.

The calculator will only do bonuses and raises to a base salary as well as a veterans bump.

Usage: salary [-b bnum] [-r rnum] [-v] base

• The variable base is the starting salary where the base should be validated to be an integer between 50000 and 100000 inclusive. It would represent a salary. Error message and usage shown if not valid.
• For the -b option bnum should be a positive integer between 1 and 10 inclusive. It would represent the multiplier for a bonus on top of the salary. Error message and usage shown if not valid.
• For the -r option rnum should be a positive integer between 5 and 10 inclusive. It would represent a percentage raise based on the salary. Error message and usage shown if not valid.
• -b adds (bnum times 1000) to the base.
• -r multiplies the base by the percentage given and adds it to the base.
• -v adds an 8000 bump to the base.
• Output should have exactly 2 decimal places no matter what the starting values are as we are talking about money.
• If -v is included, it is executed first. If -r is included it would be executed next. The -b would be executed last.
• There will be at most one of each option, if there are more than one you can use either of the options in the calculation.

Create a simple Makefile to compile your program into an executable called salary.

Test your program with the following command lines and take a screenshot after running the three lines. The command prompt should be viewable.

• salary -b 2 -r 5 90000
• result: 96500.00
• salary -v -r 7 50000
• result: 62060.00
• salary 40000
• result: 40000.00

# Florida State College at Jack

Read the Sustainable Lawn Care Case Study at the end of Chapter 3 and answer the following questions

Sustainable Lawn Care Case Study “Chris, we make the highest-quality grass seed and fertilizer in the world. Our brands are known everywhere!” stated Caroline Ebelhar, the vice president of manufacturing for The Lawn Care Company. “Yeah! But the customer doesn’t have a Ph.D. in organic chemistry to understand the difference between our grass seed and fertilizer compared to those of our competitors! We need to also be in the lawn-care application service business, and not just the manufacturer of super-perfect products,” responded Chris Kilbourne, the vice president of marketing, as he walked out of Caroline’s office. This ongoing debate among Lawn Care’s senior management team had not been resolved, but the chief executive officer, Mr. Steven Marion, had been listening very closely. Soon they would have to make a major strategic decision. The Lawn Care Company, a fertilizer and grass seed manufacturer with sales of almost \$1 billion, sold some of its products directly to parks and golf courses. Customer service in this goods-producing company was historically very narrowly defined as providing “the right product to the right customer at the right time.” Once these goods were delivered to the customer’s premises and the customer signed the shipping documents, Lawn Care’s job was done. For many park and golf course customers, a local subcontractor or the customers themselves applied the fertilizer and seed. These application personnel often did the job incorrectly, using inappropriate equipment and methods. The relationship among these non–Lawn Care application service personnel, The Lawn Care Company, and the customer also was not always ideal. When claims were made against The Lawn Care Company because of damaged lawns or polluted lakes and streams, the question then became one of who was at fault. Did the quality of the physical product or the way it was applied cause the damage? Either way, the customers’ lawns or waterways were in poor shape, and in some cases the golf courses lost substantial revenue if a green or hole was severely damaged or not playable. One claim filed by a green advocacy group focused on a fish kill in a stream near a golf course. One of Lawn Care’s competitors began an application service for parks and golf courses that routinely applied the fertilizer and grass seed for its primary customers. This competitor bundled the application service to the primary goods, fertilizer and grass seed, and charged a higher price for this service. The competitor delivered and applied the fertilizer on the same day to avoid the liability of storing toxic fertilizer outside on the golf course or park grounds. The competitor learned the application business in the parks and golf course target market segment and was beginning to explore expanding into the residential lawn-care application service target market. The Lawn Care Company sold the “highest-quality physical products” in the industry, but it was not currently in either the professional park and golf course or the residential “application service” lawn-care market segments. The Lawn Care Company considered its value chain to end once it delivered its products to the job site or non–Lawn Care application service. The competitor sold the customer “a beautiful lawn with a promise of no hassles.” To the competitor, this included an application service bundled to grass seed and fertilizer.

1. Define Lawn Care’s current strategic mission, strategy, competitive priorities, value chain, and how it wins customers. What are the order qualifiers and winners? Draw the major stages in its value chain without an application server.
2. What problems, if any, do you see with Lawn Care’s current strategy, vision, customer benefit package, value chain design, and pre-and-post -services?
3. Redo questions (1) and (2) and provide a new or revised strategy and associated customer benefit package and value chain that is more appropriate for today’s marketplace.
4. What do operations have to be good at to successfully execute your revised strategy?
5. What are your final recommendations? Provide two external references to support your response and cite using APA format.

# Florida State College at Jack

In Module 7, you will be asked to turn in a term paper on a Quality Management topic covered in this course. In this module, you will submit a rough draft of your final paper for instructor feedback. The Term Paper Draft is a graded assignment.

## Final Term Paper

Prepare a term paper on one of the quality management tools from the course and show examples of how it is currently being used by businesses. Highlight any benefits or detriments as a result of the tools. Plan on using at least one book from a library, a personal interview, and any additional sources (minimum of 4 resources).

## Submission

Your term paper draft will be 3-4 pages in length, not including the title or reference pages, and include an introduction with a thesis statement and a conclusion that summarizes the main ideas. Each paragraph should have a topic sentence supported by 3-5 sentences that offer additional details, explanation, and examples. The paper should be free of errors in grammar, sentence structure, and other mechanics. In addition, the paper should be in APA format, which includes Times New Roman, 12 point font with double line spacing and one-inch margins.

TOPIC: CUSTOMER FOCUS
One of the most important principles of quality management is customer focus. Customers are the driving force behind business. The first step for an organization to become customer focused is to understand who the customers are. In order for an organization to experience long-term competitive success, the organization has to develop & implement strategies that will satisfy customers and appreciate loyal customers. This module will focus on customer service; the part customer service plays in organizational success, and customer satisfaction.

• Explain how quality is significant in determining the long-run success of an organization.
• Discuss key customer service practices.
• Describe how customer satisfaction, customer engagement, and customer dissatisfaction can be measured.

# Florida State College at Jack

Directions: In Module 8 we have been learning about the family, marriage, the culturally defined roles of men and women in the family, and how the family has changed over the years in both the United States and the global community. But, does the mass media impact our views of family? Let’s have some fun and explore mass media and the family in this critical thinking assignment by looking at cultivation theory.

Cultivation theory, which was developed by media researchers, suggests that there are consistent images, themes, and stereotypes that cut across programming genres. As a whole, these different media images cultivate a view of the family and gender roles that is consistent. Thus, viewers who watch comedies, soap operas, reality shows, news stories and weekly news programs, sporting events, dramas, and late-night television programs will develop similar and consistent views.

Unfortunately, these media views of the family and gender roles are oftentimes partially or completely incorrect and widespread. Males are generally viewed as more ambitious and successful than women, and women are more nurturing and emotional than men. Similarly, the view of the family presented in Leave it to Beaver, The Brady Bunch, Roseanne, The Crosby Show, The Simpsons, and Modern Family has influenced generations of viewers’ thoughts about the typical family system in the United States. The family has never been as perfect as we were led to believe by the Cleaver family of Leave it to Beaver, and it is generally not as dysfunctional as is presented in The Simpsons.

Your task in this assignment is to look at one of your favorite network or cable shows and discuss the view of the family and gender roles that may be created from the show. After you have read Chapter 13 and learn about the family, complete this assignment:

• Describe and discuss your favorite show and how it depicts the family, marriage, and gender roles. Be sure to give specific examples from the show and the characters so that anyone who has never seen the show can fully understand your views and comments.
• Is the family depicted as what is considered “traditional”, why or why not? Single parent household? Nuclear or extended? Stepfamilies or blended families? Is it a patriarchal, matriarchal, or egalitarian family?
• What roles do men and women play in the family? What roles do children play? What roles do men and women play in the household chores and income earning? Who takes the responsibility for child rearing? Who does inside chores and who does outside chores?
• What about Marriage? Is marriage or divorce depicted? What about cohabitation? Are there heterosexual or homosexual relationships? Are the relationships depicted as monogamy, serial monogamy, polygamy or polyandry?
• Write your answer as one 3-5 paragraph essay. Your essay should be at least 500 words and appropriately have an introduction, body, and conclusion.

Note: It is ok if you don’t normally watch TV. You can use a Netflix show, a movie, a YouTube channel…just as long as there is a family depicted and you can relate it to the concepts learned in this module.