1.Purpose This assignment represents the applicative part of the concepts regarding algorithms you have learned from both textbooks. On this occasion, you will be able to solve problems building algorithms, and representing them using either pseudocode, or flowcharts. This assignment addresses the learning objectives regarding solving problems using algorithms, as well as designing algorithms using pseudocode or flowchart.
2.Directions: Consider the problems and design the algorithms that would solve them, Project 2 Building Algorithm Problems [.In the File]. You are free to choose between writing pseudocode or drawing flowcharts. As you start your journey on this road, I suggest you try both and see which one better fits your learning style so you will use it in the future. You may draw a structured flowchart or write pseudocode that describes all the steps using MS Word, or you can use a free online tool, such as,(http://www.draw.io/) which allows you to create a flowchart and export it as a PDF. Add your algorithm under each problem. If you use other tool to draw the algorithms, such as, draw.io (http://www.draw.io/,)make sure to copy a problem first and then draw the algorithm under it.
3. Please read all the instructions which is on above. Then you will get idea what to do. Also I did Add one file please see that file too.
4.First read all the instructions then see which is i did upload it in the File then you will get idea what to do. 5.In the( Directions) there is one Links please open that link.
Problem 1
Read an integer number from the user. If the number is not positive, change its sign. Create the algorithms for the following tasks
1 Count the digits of the number
2 Count the odd digits of the number
3 Calculate the sum of the digit values of the number
Problem 2
Using the knowledge acquired in Unit 1, regarding Binary numbers, create an algorithm that reads a 4-bit binary number from the keyboard as a string and then converts it into a decimal number. For example, if the input is 1100, the output should be 12. (Hint: Break the string into substrings and then convert each substring to a value for a single bit. If the bits are b0, b1, b2, and b3, the decimal equivalent is 8b0+ 4b1+ 2b2+ b3.)
Problem 3
Suppose you attend a party. To be sociable, you will shake hands with everyone else. Write the algorithm that will compute the total number of handshakes that occur. (Hint: Upon arrival, each person shakes hands with everyone who is already there. Use the loop to find the total number of handshakes as each person arrives.)
Problem 4
Imagine yourself in the middle of Manhattan, where the streets are perpendicular on avenues. You are in a grid of streets, somewhat lost, and you randomly pick one of four directions and walk to the next intersection. Not knowing where you really want to go, you again randomly pick one of the four directions, and so on. After repeating the same movement for a number of times, you may want to know how far you got from the original point. Represent locations as integer pairs(x,y). Create an algorithm that implements your movement through New York City, over 100 intersections, starting at (0,0) and print the ending location, taking into consideration that each movement, from one intersection to another will be one mile.
Problem 5
Design an algorithm that, given two strings of characters, tests whether the first string appears as a substring somewhere in the second.