NOTE: All programs that you write must have comments at the top with the program name,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
NOTE: All programs that you write must have comments at the top with the program name, your name, and a sentence describing what the program will do. 1. Write a new program called Lab13A a. Write a void function that receives an array of 10 integers as a parameter and reads a text file (Lab13A.txt) for the values to place in it. It should also print the values of the array all on the same line, separated by spaces. b. Write an int function that receives an array of 10 integers as a parameter and returns the last even number in the array. c. Write an int function that receives an array of 10 integers as a parameter and returns the smallest number in the array. d. In your main method i. Declare an array of 10 integers ii. Call the first function to fill in the array.. iii. Call the other two functions and print their results with labels. 2. Write a new program called Lab13B a. Declare an array of 10 integers and set each array value equal to 5 times its index. b. Print the array all on one line, separated by spaces. c. Add up all the values in the array and print the total. 3. Write a program called Lab13C a. Write a void function with an int array as a parameter that reads the values from a text file (Lab13C.txt) and places the values in the array. b. Write a bool function that receives 3 parameters: an int array, the array length, and an int number. Return true if the number is in the array and false otherwise. c. In the main function, declare an array of 20 integers. Call the function to populate the array, and then print the array (on one line separated by spaces). Ask the user for a number to search for in the array and call the function to search for it. Using the returned value print a statement to say if the number is found or not. 4. Write a program called Lab13D a. Write a void function that receives an array of 20 integers as a parameter. It should read the values from a text file (Lab13D.txt) and fill the array. b. Write a void function that receives 2 arrays of 20 integers as parameters. This function should read through the first array and place any odd values into the second array. Any zeros in the second array should be at the end, so you will need a separate index variable for it. c. In the main function: i. Declare 2 arrays of 20 integers and call the function to fill in the array, sending the first array as the parameter. ii. Fill the second array with 0's. iii. Call the function from step #b sending the two arrays. iv. Print each array with a label to show which it is. Each array should have all its values on one line separated by spaces. Your output should look like this example (although the numbers will be different.) First array: 53 52 45 77 2 32 57 25 4 50 17 42 51 86 81 50 54 14 94 80 Second array: 53 45 77 57 25 17 51 81 000000000000 NOTE: All programs that you write must have comments at the top with the program name, your name, and a sentence describing what the program will do. 1. Write a new program called Lab13A a. Write a void function that receives an array of 10 integers as a parameter and reads a text file (Lab13A.txt) for the values to place in it. It should also print the values of the array all on the same line, separated by spaces. b. Write an int function that receives an array of 10 integers as a parameter and returns the last even number in the array. c. Write an int function that receives an array of 10 integers as a parameter and returns the smallest number in the array. d. In your main method i. Declare an array of 10 integers ii. Call the first function to fill in the array.. iii. Call the other two functions and print their results with labels. 2. Write a new program called Lab13B a. Declare an array of 10 integers and set each array value equal to 5 times its index. b. Print the array all on one line, separated by spaces. c. Add up all the values in the array and print the total. 3. Write a program called Lab13C a. Write a void function with an int array as a parameter that reads the values from a text file (Lab13C.txt) and places the values in the array. b. Write a bool function that receives 3 parameters: an int array, the array length, and an int number. Return true if the number is in the array and false otherwise. c. In the main function, declare an array of 20 integers. Call the function to populate the array, and then print the array (on one line separated by spaces). Ask the user for a number to search for in the array and call the function to search for it. Using the returned value print a statement to say if the number is found or not. 4. Write a program called Lab13D a. Write a void function that receives an array of 20 integers as a parameter. It should read the values from a text file (Lab13D.txt) and fill the array. b. Write a void function that receives 2 arrays of 20 integers as parameters. This function should read through the first array and place any odd values into the second array. Any zeros in the second array should be at the end, so you will need a separate index variable for it. c. In the main function: i. Declare 2 arrays of 20 integers and call the function to fill in the array, sending the first array as the parameter. ii. Fill the second array with 0's. iii. Call the function from step #b sending the two arrays. iv. Print each array with a label to show which it is. Each array should have all its values on one line separated by spaces. Your output should look like this example (although the numbers will be different.) First array: 53 52 45 77 2 32 57 25 4 50 17 42 51 86 81 50 54 14 94 80 Second array: 53 45 77 57 25 17 51 81 000000000000
Expert Answer:
Answer rating: 100% (QA)
Lab13A This program should have three functions readarray This function should read 10 integers from a text file called Lab13Atxt and store them in an array It should then print the values of the arra... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Kaspar Corporation makes a commercial-grade cooking griddle. The following information is available for Kaspar Corporation's anticipated annual volume of 25,600 units. Per Unit Total Direct materials...
-
A student working on a summer internship in the economic research office of a large corporation studied the relation between sales of a product (Y, in million dollars) and population (X, in million...
-
In October, Seville Chemicals produced 22,500 barrels of the additive. Manufacturing overhead was $285,000 and the cost per barrel was $16.30. Materials costs were four times greater than labor...
-
What is the plain-meaning rule?
-
a. Create a spreadsheet model for this problem and solve it. What is the optimal solution? b. If Rick wanted to improve this solution, what additional resources would be needed and where would they...
-
Explain how the Pakistan crisis will affect the following companies: a) MEIR Commodities India Pvt. Ltd., an agri commodity trading house exporting sugar, molasses, organics, etc. b) Honda, Toyota,...
-
An engineer has a DAQ with a 14-bit A/D converter and a voltage range of 0 to 10 V. They are measuring vibrations around 20 Hz, so they sample at f= 100 Hz to avoid aliasing. They add a DC offset of...
-
Yet Again Company's recycled paper towels sell for $9.95 per unit and have a contribution margin of $3.14. The company is financed with 40% debt at a cost of 9% before tax, and a tax rate of 33%. If...
-
LMNO is a parallelogram. If NM = x + 15 and OL=3x+5, find the value of x, then find NM and OL.
-
Right now, one of the major things going on in the world is the war in Ukraine. There have been multiple attempts to get Russia to stand down but those have all failed. When the West put sanctions on...
-
The Water Rocket with length of 2 . 8 5 m , a volume of 6 . 7 7 L , weight of 1 . 5 5 kg . Before launching, the rocket is filled with water and pressurized at 6 4 0 psi ( 4 4 . 1 bar ) , the...
-
A stated a practice research topic (A practice research topic could be examining how social media affects political participation) for which the exploration of archival secondary data sources from...
-
Bill and Ana were married on June 10, 1997. They have lived in California all their married life. Ana filed for divorce on December 1, 2019. Bill moved out of the house they owned jointly on May 10,...
-
Find and classify the three stationary points which lie on the surface f(x, y) = 4x +10xy + 4y -x'y.
-
Bonus shares can be issued out of revenue reserves. True/False?
-
To find out the top traits that women want in a man, more than 1,000 American women ages 21 to 54 were surveyed. The table below shows the results regarding the five most desired personality traits....
-
The 2014-15 Consumer Expenditure Survey for the Baltimore Metropolitan area provided information on average annual expenditures. Use a sample size of 100 for each of the following problems. a. Mean...
-
The completed ANOVA summary table for Exercise 2 is shown below. 1. Using Table C in your textbook, identify the critical F value for a significance level of .05. 2. Present a statistical decision....
-
A blender does 5000 J of work on the food in its bowl. During the time the blender runs, 2000 J of heat is transferred from the warm food to the cooler environment. What is the change in the thermal...
-
Which system contains more atoms: 5 mol of helium (A = 4) or 1 mol of neon (A = 20)? A. Helium B. Neon C. They have the same number of atoms.
-
A sample of ideal gas is in a sealed container. The temperature of the gas and the volume of the container are both increased. What other properties of the gas necessarily change? (More than one...
Study smarter with the SolutionInn App