What is stored in mylist after the following c++ code

Assignment Help C/C++ Programming
Reference no: EM13937597

1. Consider the following declaration:

double passwords[100];

In this declaration, identify the following:

a. The array name

b. The array size

c. The data type of each array component

d. The range of values for the index of the array

2. Determine whether the following array declarations are valid. If a declaration is invalid, explain why.

a. string employees[82];

b. int myArray[50];

c. int SIZE

double list[SIZE];

d. int X = 50;

double list[X - 60];

e. int ids [-30];

f. names string[10];

3. Write C++ statements to do the following.

a. Declare an array beta of 20 component of the type double.

b. Initialize each component of the array beta to 0.

c. Output the value of the fifth component of the array beta.

d. set the value of the ninth component of the array beta to 70.50.

e. Set the value of the twelfth component of beta to four times the value of the eighth component of beta minus 15.

f. Use a for loop to output the value of a component of beta if its index is a multiple of 3.

g. Output the value of the last component of beta.

h. Output the value of beta so that ten components per line are printed.

4. What is stored in list after the following C++ code executes?
int list[10];

for (int i=0; i <5; i++)
{
list[i[ - i * i - 5;
if (i % 3 == 0)
list[i] = list[i] + i;
else
list[i] = list[i] - i;
}

5. What is stored in myList after the following C++ code executes?
double myList[5];

myList[0] = 3.0;
myList[1] = 4.0;

for (int i=2; i < 5; i++)
{
myList[i] = myList[i - 1] * myList(i - 2);
if (i > 3)
myyList[i] = myList[i] / 4;

}
Attachment:- wk5C++.zip

Reference no: EM13937597

Questions Cloud

The annual effective interest rate : Cindy borrows 13,500 for 12 years at an annual effective interest rate of i. She accumulates the amount necessary to repay the loan by a sinking fund. Cindy makes 12 payments of P at the end of each year, which includes payment on the loan at an annu..
How can more innovation from suppliers be achieved : What are the four enablers of purchasing and supply chain excellence? Which is the most important according to you? Why? How can more innovation from suppliers be achieved
Set of non-negative integers : The draw for the next soccer season has just been released. There are 6 teams in the competition and in the first 3 rounds the following teams have been drawn to play each other.
What is the company expected growth rate : Kahn Inc. has a target capital structure of 50% common equity and 50% debt to fund its $10 billion in operating assets. Furthermore, Kahn Inc. has a WACC of 14%, a before-tax cost of debt of 11%, and a tax rate of 40%. What is the company's expected ..
What is stored in mylist after the following c++ code : Set the value of the twelfth component of beta to four times the value of the eighth component of beta minus 15.
Write c program to find the number of occurrences of a word : Write C program to find the number of occurrences of a word from a file given in a specified path. For this you need to give your text file path with some text, and specify the word for which you need to find the frequency.
Replaced to get the current ratio to the target level : Muscarella Inc. has the following balance sheet and income statement data: Cash $ 14,000 Accounts payable $ 42,000 Receivables 70,000 Other current liabilities 28,000 Inventories 210,000 Total CL $ 70,000 Total CA $294,000 Long-term debt 70,000. Assu..
Calculate the return on equity for mm : Mighty Motors has no preferred stock. Calculate the return on equity (ROE) for MM for 2008. Make sure you use average shareholders' eq­ uity in your calculation.
Find the size of the multiplier in this economy : Explain why a group of economist thinks that a common currency like Euro for the region is not a good idea. Restrict your answer to the concepts discussed in the class and the case study. Page limit is one page.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The keyboard and display on the screen

Use the readLn and writeStr functions to read from the keyboard and display on the screen. Your function to convert from a decimal text string to an int should be placed in a separate function. this problem cannot be solved by simply shifting bit pat..

  Write a program that calculatesand displays the distance

Distance per Tank of GasA car with a 20-gallon gas tank averages 21.5 miles per gallon when driven in townand 26.8 miles per gallon when driven on the highway.

  Write a program that obtains two integer numbers from users

Pseudo code is an informal high-level and compact description of a computer programming algorithm that uses structural conventions of a programming language. Write a program that obtains two integer numbers from the user

  Perform ticket bookings for various flights

The development team of SoftSols Inc. analyzes the source code of the existing software and notes the following observations: The software contains a private class, named bookTickets, that contains the methods used to perform ticket bookings for va..

  Questions about experimental designs

Jackson, even-numbered Chapter Exercises, pp. 335-337. Explain the difference between multiple independent variables and multiple levels of independent variables. Which is better? What is blocking and how does it reduce "noise"? What is a disadvantag..

  Analyze the nature and purpose of budgeting

Analyze the nature and purpose of budgeting, the stages involved in the preparation of budgets, identifying separately the roles of managers and the budget committee. *Please answer it according to the marks and make it at least 750 words and above.

  Write a function named fact

Write a function named "fact" that takes one integer arguments,call them "num" and returns as its values the factorial number

  What constructors do and when they are executed

Explain what constructors do and when they are executed. Explain the two types of constructors. Provide an example class that includes both types of constructor functions and demonstrate how an object would be instantiated using both types of constru..

  Write a c++ program which performs hexadecimal operands

Write a c++ program which performs +, -, *, / and $ on hexadecimal operands. The maximum length of any operand or a solution is 40 digits. The input will be in the following format

  Write an entire c++ program that reads a positive integer

Write an entire C++ program that reads a positive integer entered by an interactive user and then prints out all the positive divisors of that integer in a column and in decreasing order.

  Waiting time is the diff b/w the arrival time and simulation

The Server removes a customer from the queue then generates a random number between 1 and 5 to simulate a transaction type i.e. Open a checking account etc.

  Prepare program to check the syntax of the english language

Determine the form of the output dependent on the coefficients being input. Print and evaluate with peers in class."

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd