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...
-
Belt Bottoms, Inc. is considering a five-year project with an initial investment of $20,000. What annual free cash flow (FCF) would be required for this project to have an NPV of $0 if the...
-
In 2012-13, the NHL owners and players could not reach an agreement and the owners declared a lockout which meant the NHL didn't play the first 40% of the season. The owners wanted a better revenue...
-
Williams & Associates, Inc., completed the following transactions during October 2010, its first month of operations: Requirement 1. Using the steps outlined in the five-step transaction analysis,...
-
Contrast the arguments concerning union membership that are likely to be presented by a union with those likely to be presented by an employer.
-
A city advertised to purchase $2 million in bonds. The bonds will be delivered on April 1, 2017, and interest will be paid on April 1 of the following years. the bonds mature as follows: Maturity...
-
The 'estimating trumpet' illustrates tolerances and expectations around levels of estimating accuracy across the life cycle. How do the tolerances resonate with your organisation's expectations...
-
Which characteristic/s of a partnership strike you the most? In what way? If you will set-up your own company to practice your profession as a certified public accountant (CPA) in the future, which...
-
Consider the simplified quarter-car model of an automobile suspension given below where the stiffness and damping of the tire have been neglected. m b (a) Recall that the equation of motion for the...
-
You hear about proposed legislation to provide zero-interest loans to students who maintain a B+ or better average grades in school. Write to your member of the legislative assembly and request he or...
-
Tamar owns a condominium near Cocoa Beach in Florida. In 2023, she incurs the following expenses in connection with her condo: Insurance Advertising expense $ 650 Mortgage interest Property taxes...
-
In 2023, Unlimited Tech had net operating income of $5,300,708. In addition to their operating income, they received $4,061,343 in dividend income from their shares in United Corporation. Unlimited...
-
Suppose you structured a bond deal for Kanye West that paid him $20 million upfront, with future royalties and streaming revenues from his past albums going towards payments to bondholders. Each bond...
-
Question 1 How to Attempt? ALT-TAB Window While using a computer, a user uses the ALT-TAB key to switch between applications. The ALT-TAB window works on the principle of holding the ALT key for MRU...
-
What are the four types of poultry production systems? Explain each type.
-
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....
-
Explain what the following terms mean a. Accounts receivable f. Accounts payable b. Supplies g. Unearned service revenue c. Prepaid rent h. Service revenue d. Furniture i. Rent expense e. Accumulated...
-
Which columns of the accounting work sheet show unadjusted amounts? a. Trial balance b. Adjustments c. Income Statement d. Balance Sheet
-
Riley Insurance Agency reported the following items at May 31: Make Riley's closing entries, as needed, for these accounts. Sales and marketing expense Other assets Depreciation expense Long-term...
Study smarter with the SolutionInn App