Arrays Implement The Specified Program From Homework 3
Arraysimplement The Specified Program From Homework 3 With Functions
Arraysimplement The Specified Program From Homework 3 With Functions The reading in the values should be in a function. The calculation and the printing all should be in separate functions. Strings Implement the specified program from homework 3 with functions. The reading in the values should be in a function. The calculation and the printing all should be in separate functions. In this assignment you will be constructing a historical argument about a topic/theme of your choice and articulating the change/continuity over time and its historical significance. For your evidence, you will be using popular music. This assignment requires that you choose five songs as evidence for your historical argument. After identifying a historical change or continuity, you will write an introductory paragraph that outlines the historical context, change/continuity, significance, and your argument.
Then, you will put the five songs you have chosen in chronological order, with a paragraph of textual and contextual analysis for each. For your textual analysis, you may want to quote a line or two from the song as evidence of your interpretation. After you have written a paragraph for each song, you will need to write a concluding paragraph that summarizes your historical continuity or change, thesis, and significance. You will need to choose an appropriate periodization, explaining why the time period you chose is crucial to understanding the continuity/change you are exploring. The time period and songs should come after 1877 (this is, after all, U.S. history since 1877) and be connected to U.S. history, broadly or transnationally. Please see the example for what your Music as History Assignment should look like when finished. Arrays 1. Write a program, which will read in integer numbers into a 10-element vector. After this calculate the average of the values. Finally determine the largest element of this vector. Print these results. 2. Write a program, which will read in integer numbers into a 10-element vector. After this determine the number of positive, negative and zero elements in the vector. Print the results. 3. Write a program, which will read in integer numbers into a 10-element vector. After this read in another integer number and store it in a separate variable. The program must determine, whether the last read number is equal to the product of any pair of numbers in the vector. 4. Write a program, which will read in real numbers into two 10-element vectors. The program must calculate the scalar product of these two vectors and print the results. 5. Write a program, which fills a 5x5 integer matrix. The user must specify the values in the matrix. After this, determine the largest and smallest elements in every row of the matrix. Print all results. 6. Write a program, which fills a 5x5 integer matrix. The user must specify the values in the matrix. After this, lets determine the index of the column, which has the fewest number of positive integer numbers. Print the column index out. 7. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, determine the sum of the elements of rows, one-by-one, and the sum of the elements of columns as well. Print all results. 8. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, determine the maximal and minimal values of the main diagonal of the matrix. 9. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this determine the index of the column, which has the largest element in the whole matrix. Print the result. 10. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, add together the elements above the main diagonal and write this value into the main diagonal. Print the matrix out. 11. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, add together the elements below the main diagonal and write this value into the main diagonal. Print the matrix out. 12. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, read in two integer numbers between 0 and 4. The program must exchange the specified rows in the matrix. Print the matrix out. 13. Write a program, which fills a 5x5 matrix with real numbers. The user must specify the values in the matrix. After this, read in two integer numbers between 0 and 4. The program must exchange the specified columns in the matrix. Print the matrix out. 14. Write a program, which will read in integer numbers into a 10-element vector. Also define a 2x5 integer matrix. The program must copy the values from the vector into the matrix. First fill up the rows. Print out the matrix. Strings 1. Write a program, which reads in a string. The string can have maximum 20 characters. After this the programu must count the number of letter ’e’ in the string. Print the result. 2. Write a program, which reads in a string. The string can have maximum 70 characters. Count how many numbers (’0’, ’1’, ’2’, …, ’9’) are in the string. Print the results. 3. Write a program, which reads in 5 pieces of 10-character long family names. The program should also read in 3 pieces of 10-character long first names. Print out all combinations of possible names. 4. Write a program, which reads in a string. The string can have maximum 70 characters. After this, replace every non-letter characters to a space. Print the result. 5. Write a program, which reads in a string. The string can have maximum 70 characters. After this, determin how many letters and non-letters are in the string. Print out the result. 6. Write a program, which reads in two strings. Determine whether the two strings are anagramma. They are anagramma, if they have the same number of same type of characters. 7. Write a program, which reads in a string. The string can have maximum 70 characters. After this, the program reprint thr string in a way, that after every vowel print a letter ’v’ and the vowel again. For example: apple avappleve 8. Write a program, which reads in a string. The string can have maximum 10 characters. After this, the program must store the string three times in another string, one after another one. Print the result. For example: apple appleappleapple 9. Write a program, which reads in a string. The string can have maximum 30 characters. After this, the program should remove any numbers from the beginning and from the end of the string. Print the result. 10. Write a program, which reads in a string. The string can have maximum 70 characters. After this, the program should count how many times it happens, that a vowel is followed by another vowel. Print the result.