C++ please This problem tests your ability to perform basic operations on a 1 dimensional array. Create
Fantastic news! We've Found the answer you've been seeking!
Question:
C++ please
Transcribed Image Text:
This problem tests your ability to perform basic operations on a 1 dimensional array. Create a program that reads 10 integers from the keyboard (you do not need to prompt for them). Store these integers in a one dimensional array of ints. Next check each integer to see if it is divisible by 2; if it is then change the value to 1, if it isn't change it to 0. Finally print out the array in reverse order. As an example, if the input values were: 1, 3, 4, 6, 7, 8, 9, 10, 12, 14 your program should convert the values in the array to 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 and then print the sequence in reverse: 1, 1, 1, 0, 1, 0, 1, 1, 0, 0. Here is some example input and output that shows formatting... Sample Input 1 2 3 4 5 6 7 8 9 10 Sample Output 1 0 1 0 1 0 1 0 1 0 Additional Assumptions • You may assume the user enters valid integers. This problem tests your ability to perform basic operations on a 1 dimensional array. Create a program that reads 10 integers from the keyboard (you do not need to prompt for them). Store these integers in a one dimensional array of ints. Next check each integer to see if it is divisible by 2; if it is then change the value to 1, if it isn't change it to 0. Finally print out the array in reverse order. As an example, if the input values were: 1, 3, 4, 6, 7, 8, 9, 10, 12, 14 your program should convert the values in the array to 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 and then print the sequence in reverse: 1, 1, 1, 0, 1, 0, 1, 1, 0, 0. Here is some example input and output that shows formatting... Sample Input 1 2 3 4 5 6 7 8 9 10 Sample Output 1 0 1 0 1 0 1 0 1 0 Additional Assumptions • You may assume the user enters valid integers.
Expert Answer:
Answer rating: 100% (QA)
Question CODE 1 include 2 using namespace std 3 4 main function 5 int main 6 7 8 9 ... View the full answer
Related Book For
Research Methods for Business A Skill Building Approach
ISBN: 978-1119942252
6th edition
Authors: Uma Sekaran, Roger Bougie
Posted Date:
Students also viewed these marketing questions
-
In an applied research context you do not need to explain the relationships between the variables in your conceptual model. Discuss this statement.
-
In an applied research context you do not need to explain the relationships between the variables in your conceptual model. Discuss this statement. (2-3 paragraphs).
-
If a number is divisible by 2 and 3, then the number is divisible by 6. Determine whether the statement is true or false. Modify each false statement to make it a true statement.
-
In recent years, Avery Transportation purchased three used buses. Because of frequent turnover in the accounting department, a different accountant was in charge of selecting the depreciation method...
-
You and a classmate (let's call him Dave) discover that your economics teacher has been secretly talking about notions such as "love," "fairness," and "decency." Desperate to preserve his reputation...
-
A straight wire caries a 10.0-A current (Fig) ABCD is a rectangle with point D the middle of a 1.10-mm segment of the wire and point C in the wire. Find the magnitude and direction of the magnetic...
-
The numbers of weeks the 33 leading movies remained at number 1 as of March 2018. Find the mean, the median, and the mode of the data, if possible. If any measure cannot be found or does not...
-
Four transactions for Automotive Maintenance and Repair Shop that took place in November 2019 appear below, along with the general ledger accounts used by the company. INSTRUCTIONS Record the...
-
As a health coach dealing with obese individuals, Give one example of a time you deferred to your group or family culture to make a moral decision.?
-
The Wilson Company's marketing manager has determined that the price elasticity of demand for its product equals - 2.2. According to studies she carried out, the relationship between the amount spent...
-
Projected financial results for the university's cafeteria for next year are shown. Answer each of the following independent questions. Sales (a) How much is the contribution margin and the...
-
Factorize: 2 6x11x10
-
A sample of gas occupies a volume of 5 5 . 1 mL . As it expands, it does 1 2 5 . 2 J of work on its surroundings at a constant pressure of 7 8 3 Torr. What is the final volume of the gas?
-
Below is the complete list of accounts of Cobras Incorporated and the related balance at the end of March. All accounts have their normal debit or credit balance. Supplies, $ 1 , 50 0 ; Buildings, $...
-
5. Complete a short Accounts Payable Report to the Senior Accountant to identify any discrepancies and seek authorisation for payment of invoices attracting the 5% discount payable in June 2022 (i.e....
-
Suppose A = 7.362 - 9.223. Its magnitude is A and its direction is measured in degrees counterclockwise (CCW) from the +x-axis. Calculate 0. 0 = = O
-
-15x+10 divided by 5 6x2+10 DIVIDED BY 2 14X3+28X2-70 DIVIDED BY 7 USE DIVISION AND DISTRIBUTIVE PROPERTY TO SIMPLIFY
-
You are thinking of investing in one of two companies. In one annual report, the auditors opinion states that the financial statements were prepared in accordance with generally accepted accounting...
-
Compare your service quality measure to the measure of Zeithaml, Parasuraman, and Berry (1988) presented in Journal of Retailing. a. How does your measure differ from this measure in terms of...
-
One way to deal with discrepancies found in the data obtained from multiple sources is to average the figures and take the mean as the value on the variable. What is your reaction to this?
-
What activities are involved in getting the data ready for analysis?
-
In the previous example, suppose that these are all of the entries in Freedonias BOP table. Calculate the value of errors and omissions. TABLE 11.2 Balance-of-Payments Example Merchandise exports...
-
Consider the demand and supply curves in Exercise 13. DATA FROM EXERCISE13 Suppose that the domestic demand and supply for shoes in a small open economy are given by. where P denotes price and Q...
-
Repeat Exercise 6 under the assumption that instead of a fall in demand for foreign exchange, there is an increase in supply. data from exercise 6 Credit entries in a countrys balance of payments...
Study smarter with the SolutionInn App