First Person Discover Steganography Learned Different Techniques Steganalysis Q43840310

Who was the first person to discover Steganography and learned the different techniques of steganalysis?

Who was the first person to discover Steganography and learned the different techniques of steganalysis? Show transcribed image text Who was the first person to discover Steganography and learned the different techniques of steganalysis?

Expert Answer


Answer to Who was the first person to discover Steganography and learned the different techniques of steganalysis?…

First Picture Requirements Program Second Picture Details Requirements Third Forth Picture Q43881274

Youre responsible for writing two functions and testing them: fizzbuzz fizzbuzz2 Fizzbuzz is a function that will take a num

The first picture is the requirements for program.

For this assignment, you must log on to the server and go into the ~/fizzbuzz_tdd directory. You must implement 4 things for

The second picture is the details of therequirements.

chude <iostream> using namespace std; YOU: Write fiz buzz Return Fizz X 15 divisible by 3 Return Buzz 11x is divisible by

MADE your own tests to check bad inputs here SESS (Fizzbuzz, BadTests) YOU: Weite your own tests to check edge inputs here YO

The third and forth pictures are comments given byinstructor.
Using C++ please

You’re responsible for writing two functions and testing them: fizzbuzz fizzbuzz2 Fizzbuzz is a function that will take a number between 1 and 100, and will return a string containing one of four values based on which case it is: Case 1) “Fizz” if the number passed in is divisible by 3 (for example, 12). Case 2) “Buzz” if the number passed in is divisible by 5 (for example, 20). Case 3) “Fizzbuzz” if the number passed in is divisible by both 3 and 5 (for example 30). .. . . Case 4) “<The number>” otherwise., (for example, passing in 7 will return *7″). This is a string, not an int. To convert from an int to a string in C++, use the to_string() function. For example, to_string(2) returns “2”. Fizzbuzz2 is exactly the same, but with one additional check. Prior to Case 4, you must add the digits of the number together, and apply the same checks to the sum. In other words, if you pass in 41, you will return “Buzz” because even though 41 isn’t divisble by 3 or 5, 4+1 = 5. You will add this check after Case 3 and before Case 4. You must write a series of tests for your code to verify that your code is working properly. I recommend starting with the simplest tests possible, and writing as little code as possible to answer those tests, and continuing to go back and forth until you can’t think of anything else to test. Use “make” to compile this code, rather than trying to compile it manually. For this assignment, you must log on to the server and go into the ~/fizzbuzz_tdd directory. You must implement 4 things for 100% on this assignment: 1) You must write a fizzbuzz function that takes in an int and returns a string according to the rules for fizzbuzz (found in the README file). 2) You must write a fizzbuzz2 function that functions just like fizzbuzz, but between Case 3 and Case 4 adds another check where it adds the two digits of the number together, and if they are divisible by 3, returns “Fizz”, divisible by 5 returns “Buzz” and if it is divisible by both returns “Fizzbuzz”; 3) Write test cases for them, to guarantee your implementation is correct. 4) Inside of main, write a loop that prints the results of fizzbuzz() and fizzbuzz2() from 1 to 100. If you ever forget where you need to write code, I’ve helpfully put comments with “YOU:” in main.cc at each place you need to write code. chude <iostream> using namespace std; YOU: Write fiz buzz Return “Fizz” X 15 divisible by 3 Return “Buzz 11x is divisible by S // Return “Fizzbuzz” if x is divisible by both 3 and 5 // Return a string containing the number otherwise /Return “Error” 1 x is less than 1 or greater than 100 string fizzbuzz (int x) //This won’t compile, since it’s not returning anything 1/YOU: Write tests to test your fizzbuzz implementation TEST (Fizzbuzz, GoodTests) EXPECT EQ(fizzbuzz (33). “Fizz”); EXPECT_EQ(fizzbuzz (50), “Buzz”); EXPECT EQ(fizzbuzz (13). “13”): EXPECT EQ (fizzbuzz (45), “Fizzbuzz”); EXPECT_EQ(fizzbuzz (42). “Fizz”): //YOU: Write your own tests to check bad inputs here TEST (Fizzbuzz, BadTests) //YOU: Write your own tests to check edge inputs here J //YOU: Now write a function called fizzbuzz2, that is exactly the same as fizzbuzz, but with one important change, Before returning a number, add the digits of the number together, and use the result from that sum with the same ules. For example, 23 would return “Buzz” because 2+3 = 5. string fizzbuzz2(int x) return ; 1/YOU: Now write good, bad, and edge cases for fiz buzz2 as well. int main(int arge, char * argv) testing::InitGoogleTest (Gargc, argv); Sifndef Foo 1/Stop people from compiling this code using ‘compile’ static assert(false, “type make to build this, not compile fendit cout << “Welcome to Fizzbuzz 2000 ™. Choose one of the following options: n”: cout << “tizzbuzz – will run fizzbuzz from 1 to 100. In INSERT — her toch E MADE your own tests to check bad inputs here SESS (Fizzbuzz, BadTests) YOU: Weite your own tests to check edge inputs here YOU: Now write a function called the bus 22 that is exactly the same as fizzbuzz, but with one important change. Before returning a number, add the dirts of the number together, and use the result from that sum with the same tules. For example, 23 would return “BUER” because 2+3 5. string fizzbuzz2 (int x) return ; //YOU: Now write good, bad, and edge cases for fizzbuzz2 as well. int main(int argc, char** argv) testing :: InitGoogleTest (Gargc, argv); Findef FOO VISCOD people from compiling this code using compiler static assert(false, “type ‘make to build this, not compile’ fendit – cout << “Welcome to Fizzbuzz 2000 ™. Choose one of the following options: cout << “izzbuzz – will run fizzbuzz from 1 to 100.0 cout << “Fizzbuzz2 – will run fizzbuzz2 from 1 to 100. na cout << “(a number) – will run fizzbuzz and fizzbuzz2 on just that number. cout << “test – will run the test suite you’ve created. In strings: getline (cin, s); if (s = “test”) return RUN ALL TESTS(); else if (s == “fizzbuzz”) { //YOU: Weite code that will output the result of the fizzbuzz function from 1 to 100 here: else if(s == “fizzbuzz2”){ //YOU: Write code that will output the result of the fizzbuzz2 function from 1 to 100 here: else // Just a number, so feed it to each function and output the result nt x = stoi (s): cout << “Eizzbuzz (” << x << << tizzbuzz (x) << endl; cout << “Eizzbuzz2(” << X <<“) << tizzbuzz2(x) << endl; INSERT – Show transcribed image text You’re responsible for writing two functions and testing them: fizzbuzz fizzbuzz2 Fizzbuzz is a function that will take a number between 1 and 100, and will return a string containing one of four values based on which case it is: Case 1) “Fizz” if the number passed in is divisible by 3 (for example, 12). Case 2) “Buzz” if the number passed in is divisible by 5 (for example, 20). Case 3) “Fizzbuzz” if the number passed in is divisible by both 3 and 5 (for example 30). .. . . Case 4) “” otherwise., (for example, passing in 7 will return *7″). This is a string, not an int. To convert from an int to a string in C++, use the to_string() function. For example, to_string(2) returns “2”. Fizzbuzz2 is exactly the same, but with one additional check. Prior to Case 4, you must add the digits of the number together, and apply the same checks to the sum. In other words, if you pass in 41, you will return “Buzz” because even though 41 isn’t divisble by 3 or 5, 4+1 = 5. You will add this check after Case 3 and before Case 4. You must write a series of tests for your code to verify that your code is working properly. I recommend starting with the simplest tests possible, and writing as little code as possible to answer those tests, and continuing to go back and forth until you can’t think of anything else to test. Use “make” to compile this code, rather than trying to compile it manually.
For this assignment, you must log on to the server and go into the ~/fizzbuzz_tdd directory. You must implement 4 things for 100% on this assignment: 1) You must write a fizzbuzz function that takes in an int and returns a string according to the rules for fizzbuzz (found in the README file). 2) You must write a fizzbuzz2 function that functions just like fizzbuzz, but between Case 3 and Case 4 adds another check where it adds the two digits of the number together, and if they are divisible by 3, returns “Fizz”, divisible by 5 returns “Buzz” and if it is divisible by both returns “Fizzbuzz”; 3) Write test cases for them, to guarantee your implementation is correct. 4) Inside of main, write a loop that prints the results of fizzbuzz() and fizzbuzz2() from 1 to 100. If you ever forget where you need to write code, I’ve helpfully put comments with “YOU:” in main.cc at each place you need to write code.
chude using namespace std; YOU: Write fiz buzz Return “Fizz” X 15 divisible by 3 Return “Buzz 11x is divisible by S // Return “Fizzbuzz” if x is divisible by both 3 and 5 // Return a string containing the number otherwise /Return “Error” 1 x is less than 1 or greater than 100 string fizzbuzz (int x) //This won’t compile, since it’s not returning anything 1/YOU: Write tests to test your fizzbuzz implementation TEST (Fizzbuzz, GoodTests) EXPECT EQ(fizzbuzz (33). “Fizz”); EXPECT_EQ(fizzbuzz (50), “Buzz”); EXPECT EQ(fizzbuzz (13). “13”): EXPECT EQ (fizzbuzz (45), “Fizzbuzz”); EXPECT_EQ(fizzbuzz (42). “Fizz”): //YOU: Write your own tests to check bad inputs here TEST (Fizzbuzz, BadTests) //YOU: Write your own tests to check edge inputs here J //YOU: Now write a function called fizzbuzz2, that is exactly the same as fizzbuzz, but with one important change, Before returning a number, add the digits of the number together, and use the result from that sum with the same ules. For example, 23 would return “Buzz” because 2+3 = 5. string fizzbuzz2(int x) return ; 1/YOU: Now write good, bad, and edge cases for fiz buzz2 as well. int main(int arge, char * argv) testing::InitGoogleTest (Gargc, argv); Sifndef Foo 1/Stop people from compiling this code using ‘compile’ static assert(false, “type make to build this, not compile fendit cout

Expert Answer


Answer to The first picture is the requirements for program. The second picture is the details of the requirements. The third and…

First Picture Transposematrix Algorithm Ive Done Part 1 2 Cannot Figure Questions Second P Q43901350

The first picture is the transposeMatrix(A) algorithm. Ive donePart 1 and 2 but cannot figure out the questions in the secondpicture.

Consider the problem to compute the transpose AT of an n x n matrix A. Consider the pseudocode to compute the transpose of anC) (16 points) Swap Action In this case, we count the number of swaps A[i] [i] >A[] [i]. One swap is performed by the three a

Consider the problem to compute the transpose AT of an n x n matrix A. Consider the pseudocode to compute the transpose of an n x n matrix A transposeMatrix(A) for į = | ton for j = / to j-| Il swap A[i] [i] and buffer = A[i] Ali Gil. = A[i] [i. Al [i] = buffer C) (16 points) Swap Action In this case, we count the number of swaps A[i] [i] >A[] [i]. One swap is performed by the three assignments in Lines 4- 6. Answer the following questions to determine the total number of swaps performed by the algorithm transposeMatrix(A). a. Let us calls the number of swaps for a given value of j. Fill in this table: n-1 b. Express the function f(n) that represents the overall total number of swaps during the execution of transposeMatrix(A). c. The function f(n) grows like which function? D) (6 points) Compare the functions f.(n), fon), and f(n) and discuss their “growth”. IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII E) (6 points) Space complexity: answer the following questions. Is this algorithm is in-place? What is its space complexity? How does its space complexity “grow”? Show transcribed image text Consider the problem to compute the transpose AT of an n x n matrix A. Consider the pseudocode to compute the transpose of an n x n matrix A transposeMatrix(A) for į = | ton for j = / to j-| Il swap A[i] [i] and buffer = A[i] Ali Gil. = A[i] [i. Al [i] = buffer
C) (16 points) Swap Action In this case, we count the number of swaps A[i] [i] >A[] [i]. One swap is performed by the three assignments in Lines 4- 6. Answer the following questions to determine the total number of swaps performed by the algorithm transposeMatrix(A). a. Let us calls the number of swaps for a given value of j. Fill in this table: n-1 b. Express the function f(n) that represents the overall total number of swaps during the execution of transposeMatrix(A). c. The function f(n) grows like which function? D) (6 points) Compare the functions f.(n), fon), and f(n) and discuss their “growth”. IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII E) (6 points) Space complexity: answer the following questions. Is this algorithm is in-place? What is its space complexity? How does its space complexity “grow”?

Expert Answer


Answer to The first picture is the transposeMatrix(A) algorithm. Ive done Part 1 and 2 but cannot figure out the questions in the …

First Program Create Program Calculates Derivative Polynomial Entered User User Receives D Q43898069

MATLAB ONLY!!! WRITE IN COMPUTER SO I CAN COPYPASTE

First program Create a program that calculates the derivative for any polynomial entered by a user and the user receives all

First program Create a program that calculates the derivative for any polynomial entered by a user and the user receives all the derivatives until it reaches zero. The program will work for any polynomial with the variable x. Ensure that your program provides the user the result in a complete sentence. Second program Create a program that graphs and calculates the area under the curve to: cos (x) S = 1+sin (x) Create the graph using the ezplot or fplot command Calculate the area under the curve by finding the integral 7 cos (x) dx Jo 1+sin (x) Print on the chart a sentence that reads how much is the area under the curve for the established limits (0, pi). Show transcribed image text First program Create a program that calculates the derivative for any polynomial entered by a user and the user receives all the derivatives until it reaches zero. The program will work for any polynomial with the variable x. Ensure that your program provides the user the result in a complete sentence. Second program Create a program that graphs and calculates the area under the curve to: cos (x) S = 1+sin (x) Create the graph using the ezplot or fplot command Calculate the area under the curve by finding the integral 7 cos (x) dx Jo 1+sin (x) Print on the chart a sentence that reads how much is the area under the curve for the established limits (0, pi).

Expert Answer


Answer to First program Create a program that calculates the derivative for any polynomial entered by a user and the user receives…

First Programming Project Involves Writing Program Computes Minimum Maximum Average Weight Q43881443

The first programming project involves writing a program thatcomputes the minimum, the maximum and the average weight of acollection of weights represented in pounds and ounces that areread from an input file. This program consists of two classes. Thefirst class is the Weight class, which is specified in integerpounds and ounces stored as a double precision floating pointnumber. It should have five public methods and two privatemethods:

  1. A public constructor that allows the pounds and ounces to beinitialized to the values supplied as parameters.
  2. A public instance method named lessThan that accepts one weightas a parameter and returns whether the weight object on which it isinvoked is less than the weight supplied as a parameter.
  3. A public instance method named addTo that accepts one weight asa parameter and adds the weight supplied as a parameter to theweight object on which it is invoked. It should normalize theresult.
  4. A public instance method named divide that accepts an integerdivisor as a parameter. It should divide the weight object on whichthe method is invoked by the supplied divisor and normalize theresult.
  5. A public instance toString method that returns a string thatlooks as follows: x lbs y oz, where x isthe number of pounds and y the number of ounces. Thenumber of ounces should be displayed with three places to the rightof the decimal.
  6. A private instance method toOunces that returns the totalnumber of ounces in the weight object on which is was invoked.
  7. A private instance method normalize that normalizes the weighton which it was invoked by ensuring that the number of ounces isless than the number of ounces in a pound.

Both instance variable must be private. In addition the classshould contain a private named constant that defines the number ofounces in a pound, which is 16. The must not contain any otherpublic methods.

The second class should be named Project1. It should consist ofthe following four class (static) methods.

  1. The main method that reads in the file of weights and storesthem in an array of type Weight. It should then display thesmallest, largest and average weight by calling the remaining threemethods. The user should be able to select the input file from thedefault directory by using the JFileChooser class. The input fileshould contain one weight per line. If the number of weights in thefile exceeds 25, an error message should be displayed and theprogram should terminate.
  2. A private class method named findMinimum that accepts the arrayof weights as a parameter together with the number of valid weightsit contains. It should return the smallest weight in thatarray.
  3. A private class method named findMaximum that accepts the arrayof weights as a parameter together with the number of valid weightsit contains. It should return the largest weight in thatarray.
  4. A private class method named findAverage that accepts the arrayof weights as a parameter together with the number of valid weightsit contains. It should return the average of all the weights inthat array.

Be sure to follow good programming style, which means making allinstance variables private, naming all constants and avoiding theduplication of code. Furthermore you must select enough differentinput files to completely test the program.

Java programming

The text file could not be attached but it looks like this:

Year,Weight in Lbs,Weight Loss Rate
1994,713.6,9
1995,684.5,8.2
1996,636.6,7.4
1997,611,6.8
1998,567.6,6.3
1999,523,5.7
2000,506.5,5.5
2001,504.5,5.6
2002,494.4,5.6
2003,475.8,5.7
2004,463.2,5.5
2005,469,5.6
2006,479.3,5.8
2007,471.8,5.7
2008,458.6,5.4
2009,431.9,5
2010,404.5,4.8
2011,387.1,4.7
2012,387.8,4.7
2013,367.9,4.5

please tell me what to do? How to get the problemdone. Please help!

Expert Answer


Answer to The first programming project involves writing a program that computes the minimum, the maximum and the average weight o…

Fitting Resistors Import Numpy Np Import Matplotlibpyplot Plt First Store Measurements Arr Q43821512

- Fitting the resistors [] import numpy as np import matplotlib.pyplot as plt First, store all of the measurements in arraysOnce you have your fit, plot your data with the fit. Label each line with the resistence of each resistor. #Do linear fits uswhat does it mean by plot the fits andprint out parameters? please help PYTHON

– Fitting the resistors [] import numpy as np import matplotlib.pyplot as plt First, store all of the measurements in arrays such as: voltages_resistor_x_ohms = np.array([voltage_1, voltage_2, voltage_3, …]) currents_resister_x_ohms = np.array([current_1, current_2, current_3…]) [] # Make an array of voltage and current values for resistor 1 voltage = np.array([22.2, 39.8, 50., 59., 74.0, 94.7, 107.1]) current = np.array([0.89, 0.18, 0.23, 0.27, 0.33, 0.43, 0.49]) Use the numpy polyfit function to fit an order = 1 function. The syntax for this is as follows: params = np.polyfit(x_data, y_data, order) where fit will be an array y=x” * params[0]+…+x* params[n – 1] + params[n] In the linear fit order = 1, this looks like $y = mx + b = params[0] * x + params[1] Once you have your fit, plot your data with the fit. Label each line with the resistence of each resistor. #Do linear fits using polyfit params = np.polyfit(voltage, current, 1) #Plot the data plt.plot(voltage, current) plt.scatter(voltage, current) #Plot the fits <matplotlib.collections.Pathcollection at Ox7fb9be6a2e8> 406 80 100 Print out each set of parameters and put them in your lab assignment. [] # Print out parameters Show transcribed image text – Fitting the resistors [] import numpy as np import matplotlib.pyplot as plt First, store all of the measurements in arrays such as: voltages_resistor_x_ohms = np.array([voltage_1, voltage_2, voltage_3, …]) currents_resister_x_ohms = np.array([current_1, current_2, current_3…]) [] # Make an array of voltage and current values for resistor 1 voltage = np.array([22.2, 39.8, 50., 59., 74.0, 94.7, 107.1]) current = np.array([0.89, 0.18, 0.23, 0.27, 0.33, 0.43, 0.49]) Use the numpy polyfit function to fit an order = 1 function. The syntax for this is as follows: params = np.polyfit(x_data, y_data, order) where fit will be an array y=x” * params[0]+…+x* params[n – 1] + params[n] In the linear fit order = 1, this looks like $y = mx + b = params[0] * x + params[1]
Once you have your fit, plot your data with the fit. Label each line with the resistence of each resistor. #Do linear fits using polyfit params = np.polyfit(voltage, current, 1) #Plot the data plt.plot(voltage, current) plt.scatter(voltage, current) #Plot the fits 406 80 100 Print out each set of parameters and put them in your lab assignment. [] # Print out parameters

Expert Answer


Answer to – Fitting the resistors [] import numpy as np import matplotlib.pyplot as plt First, store all of the measurements in ar…

Five Batch Jobs D J K Arrive Computer Time Time 0 Quantum Size System 2 Units Time Schedu Q43778444

Five batch jobs (A,D,I,J,K) arrive at a computer at the sametime(at time=0). The quantum size of this system is 2 units oftime. For each of the scheduling methods given below, calculate theaverage waiting time for the 5 jobs. Show (use timing diagrams) andexplain your steps. You can prepare it by hand or on acomputer.

The following jobs and the estimated running times aredefined:

A

2

B

6

C

4

D

8

E

2

F

10

G

4

H

8

I

4

J

12

K

4

L

6

M

10

N

14

Note: Whenever needed, assume processing order as A, B, C, D,…

Hint: For example, job A requires 10 units of time of CPU timeand arrives at the system at time=0. If it leaves the system attime=30, the waiting time for this job is (30-0)-10=20 units oftime.

  1. a) Round robin scheduling

  2. b) First-come first-served (FIFO) scheduling

  3. c) Shortest-Remaining-Job-First(SRJB) scheduling

Expert Answer


Answer to Five batch jobs (A,D,I,J,K) arrive at a computer at the same time(at time=0). The quantum size of this system is 2 units…

Five Red 3 Overrun 100 First Lost Shortage Change Millionaire Excess Found None Dollars 1 Q43812373

Five Red 3 Overrun 100 First Lost Shortage Change Millionaire Excess Found None Dollars 1 4 2 Cents Profit Blue Green $ Men WFive Red 3 Overrun 100 First Lost Shortage Change Millionaire Excess Found None Dollars 1 4 2 Cents Profit Blue Green $ Men Women Figures 7 % Second Loss Overload 9 Pennies Black Stock 4 Children Last 0 Millions Some Few 25 Data to Information Organize the data above as information. Combine any of the raw facts/data above to create meaningful information. You can reuse facts. Meaningful information can include any of the following – create a graph, chart, picture to tell the story. For this assignment only, the meaningful information does not need to be true. Show transcribed image text Five Red 3 Overrun 100 First Lost Shortage Change Millionaire Excess Found None Dollars 1 4 2 Cents Profit Blue Green $ Men Women Figures 7 % Second Loss Overload 9 Pennies Black Stock 4 Children Last 0 Millions Some Few 25 Data to Information Organize the data above as information. Combine any of the raw facts/data above to create meaningful information. You can reuse facts. Meaningful information can include any of the following – create a graph, chart, picture to tell the story. For this assignment only, the meaningful information does not need to be true.

Expert Answer


Answer to Five Red 3 Overrun 100 First Lost Shortage Change Millionaire Excess Found None Dollars 1 4 2 Cents Profit Blue Green $ …

Fix Code Processing 353 Processing Lab 9 Example 2a Bounce Circle Border Global Variables Q43807536

How can I fix this code? Processing 3.5.3
Image Processing – Pixels If done properly, then everytime you run the program a randomly sized and colored circle should sta

// ====================================================
// Processing Lab 9 example 2A – bounce circle off border
// ====================================================
// global variables for circle attributes
int xFactor, yFactor;
// ——————————————–
// x,y coordinate of center and radius
int circleX, circleY, circleRadius;
// amount to change the x and y coordinates
int speedX, speedY;
// global variables for circle colors
color circleFillColor; // fill color
color circleBorderColor; // border color
// ============================================
// other global variables
// ——————————————–
// screen background color
color bgColor;
// wall color
color wallColor;
// to keep track of where walls were
boolean rightWallNow, leftWallNow, topWallNow, bottomWallNow;
boolean rightWallNext, leftWallNext, topWallNext,bottomWallNext;

// ============================================
// setup method to initialize global variables
// ============================================
void setup()
{
size(450,450);
speedX=1; speedY=1; xFactor=1; yFactor=1;
// use white for background color
bgColor=color(255,255,255);
// initialize the minimum and maximum values
// used to get random values for the global variables
int minRadius=10;
int maxRadius=30;
// value of coordinates of circle
// should account for radius
// to make sure it is all within the screen
int minX=maxRadius+ 2;
int minY=maxRadius+2;
int maxX=width-maxRadius-2;
int maxY=height -maxRadius-2;
// minimum and maximum values for circle fill colors
// to prevent being the same as the background (255,255,255)
// or being the same as the rectangle border (0,0,0)

int minCV=1;
int maxCV=254;
//initialize the global variables
//by using random methods
circleX=(int) random(minX, maxX);
circleY=(int) random(minX, maxX);
circleRadius=(int) random(minRadius, maxRadius);
int redV= (int) random(minCV,maxCV);
int greenV= (int) random(minCV,maxCV);
int blueV= (int) random(minCV,maxCV);
circleFillColor=color(redV,greenV,blueV);
circleBorderColor=circleFillColor;
// ==================================
// display the circle and walls and
// get location of walls relative to circle
background(bgColor);
drawWalls();
drawCircle();
getWalls();
} // end of setup method

// method to use global variables   
// to display rectangle for walls
void drawWalls()
{
stroke(wallColor);
strokeWeight(10);
fill(bgColor);
rect(25,25,width-50,height-50);
noStroke();
noFill();
} // end of drawWalls method

// method to use global variables
// to display circle
void drawCircle()
{
stroke(circleBorderColor);
fill(circleFillColor);
ellipse(circleX, circleY, circleRadius*2, circleRadius*2);
noFill();
noStroke();
} // end of drawCircle method

// method to determine if walls are next to circle (1 pixelaway)
// or will be after circle is moved after adding speedX tocircleX
// and speedY to circleY
void getWalls()
{
// determine if walls exist to top, bottom, left, right ofcircle
color cTopColor, cBottomColor, cLeftColor, cRightColor;
cTopColor = get(circleX, circleY-circleRadius+1); // top
cBottomColor = get(circleX, circleY+circleRadius+1); //bottom
cLeftColor = get(circleX-circleRadius-1, circleY); // left
cRightColor = get(circleX+circleRadius+1, circleY); // right
if(cTopColor != bgColor) {
topWallNow = true;
} else {
topWallNow = false;
}
if(cBottomColor != bgColor) {
bottomWallNow = true;
} else {
bottomWallNow = false;
}
if(cLeftColor != bgColor) {
leftWallNow = true;
} else {
leftWallNow = false;
}
if(cRightColor != bgColor) {
rightWallNow = true;
} else {
rightWallNow = false;
}
// determine if walls exist to top, bottom, left, right of circleafter move
color cNextTopColor, cNextBottomColor, cNextLeftColor,cNextRightColor;
cNextTopColor = get(circleX+speedX, circleY+speedY-circleRadius-1);// top
cNextBottomColor = get(circleX+speedX,circleY+speedY+circleRadius+1); // bottom
cNextLeftColor = get(circleX+speedX-circleRadius-1,circleY+speedY); // left
cNextRightColor = get(circleX+speedX+circleRadius+1,circleY+speedY); // right
if(cNextTopColor != bgColor) {
topWallNext = true;
} else {
topWallNext = false;
}
if(cNextBottomColor != bgColor) {
bottomWallNext = true;
} else {
bottomWallNext = false;
}
if(cNextLeftColor != bgColor) {
leftWallNext = true;
} else {
leftWallNext = false;
}
if(cNextRightColor != bgColor) {
rightWallNext = true;
} else {
rightWallNext = false;
}
} // end of getWalls method

// main draw method
void draw()
{
background(bgColor);
drawWalls();
getWalls();
if(onWall())
{
println(“On wall, circle at(” +
circleX + “,” +
circleY + “)”);
}
moveCircle(); // update circleX and circleY values
drawCircle(); // display the circle
} // end of draw method

// method to determine if circle is on wall, and
// change direction of circle by modifying the values
// of speedX and speedY global variables
// Returns true if circle touching or about to touch wall
boolean onWall()
{
// next move down is new wall
if(bottomWallNow || bottomWallNext && speedY > 0){
// reverse y direction
speedY = -1;
return true;
}
// next move right is new wall
if(rightWallNow || rightWallNext && speedX > 0){
// reverse x direction
speedX = -1;
return true;
}
// next move left is new wall
if(leftWallNow || leftWallNext && speedX < 0){
// reverse x direction
speedX = 1;
return true;
}
// next move up is new wall
if(topWallNow || topWallNext && speedY < 0){
// reverse y direction
speedY = 1;
return true;
}
return false;
} // end of onWall method

// method to update the center of the
// circle (circleX, circleY) based
// on any modifications to speedX and speedY
// made in the onWall method
void moveCircle(){
circleX=circleX+ (speedX* xFactor);
circleY=circleY+ (speedY* yFactor);
} // end of moveCircle method
void keyPressed() {
if(key == CODED) {
if (keyCode== UP) {
yFactor= yFactor-1;
} else if (keyCode== DOWN) {
yFactor= yFactor+ 1;
} else if (keyCode== LEFT) {
xFactor= xFactor-1;
} else if(keyCode== RIGHT) {
xFactor= xFactor+ 1;
}
} else {
xFactor=1;
yFactor=1;
}
}//end of keyPressed method

coding language: java

Image Processing – Pixels If done properly, then everytime you run the program a randomly sized and colored circle should start at a random spot, going in a random direction at a random speed; and correctly bounce off a randomly colored wall. The arrow keys should have the following behaviors: • Pressing the up arrow key should subtract 1 from a factor that is used to multiply the speed going up. Pressing the down arrow key should add 1 to a factor that is used to multiply the speed going down. Pressing the left arrow key should subtract 1 from a factor that is used to multiply the speed going left. Pressing the right arrow key should add 1 to a factor that is used to multiply the speed going right. Lesson Objective: students will analyze problems, use structured programming techniques to implement algorithms. Show transcribed image text Image Processing – Pixels If done properly, then everytime you run the program a randomly sized and colored circle should start at a random spot, going in a random direction at a random speed; and correctly bounce off a randomly colored wall. The arrow keys should have the following behaviors: • Pressing the up arrow key should subtract 1 from a factor that is used to multiply the speed going up. Pressing the down arrow key should add 1 to a factor that is used to multiply the speed going down. Pressing the left arrow key should subtract 1 from a factor that is used to multiply the speed going left. Pressing the right arrow key should add 1 to a factor that is used to multiply the speed going right. Lesson Objective: students will analyze problems, use structured programming techniques to implement algorithms.

Expert Answer


Answer to How can I fix this code? Processing 3.5.3 // ==================================================== // Processing Lab 9 ex…

Fix Error Message Function Definition Read Found Typedef Struct Employee Char First 8 Char Q43896068

How to fix this error message?

function definition for read not found

typedef struct Employee

{
char first[8];
char initial[2];
char last[10];
char street[17];
char city[12];
char state[3];
char zip[6];
int age;
char sex[2];
int tenure;
float salary;
}Employee;

// function prototypes
void strsub(char buf[], char sub[], int start, int end);
int read(FILE* infile, struct Employee workers[MAX]);   //this is where I get the error message
void write(FILE* outfile, struct Employee workers[MAX], intcount);

Expert Answer


Answer to How to fix this error message? function definition for read not found typedef struct Employee { char first[8]; char init…