Write a program that reads an initial investment balance

Assignment Help Programming Languages
Reference no: EM131142573

R7.1 Carry out the following tasks with an array:

a. Allocate an array a of ten integers.
b. Put the number 17 as the initial element of the array.
c. Put the number 29 as the last element of the array.
d. Fill the remaining elements with -1.
e. Add 1 to each element of the array.
f. Print all elements of the array, one per line.
g. Print all elements of the array in a single line, separated by commas.

R7.2 What is an index of an array? What are the legal index values? What is a bounds error?

R7.4 Write a loop that reads ten numbers and a second loop that displays them in the opposite order from which they were entered.

P7.1 A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses in an array and that prints the die values, marking the runs by including them in parentheses, like this:

12 (5 5) 3 1 2 4 3 (2 2 2 2) 36 (5 5) 631

Use the following pseudocode:

Set a boolean variable inRun to false.
for each valid index i in the array
If inRun
If values[i] is different from the preceding value
Print ).
inRun = false.
If not inRun
If values[i] is the same as the following value
Print
inRun = true.
Print values[i].
If inRun, print ).

1. For a given number, print a pyramid of that many levels. We've covered how to print out half of the pyramid similar to the following:
*
**
***
****
*****

Now we want to print (notice the spacing)

     **
   ****
  ******
 ********
**********

2. Write a program that lists the first 400 multiples of 13. List that number, followed by whether it is even or odd.

3. Write a program that adds a letter to a string until the user wants to quit.

4. Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.

Reference no: EM131142573

Questions Cloud

Determine the grade of the road : Assuming standard perception/reaction time and practical stopping distance, determine the grade of the road.
Why do you suppose 131 53 i is used for this treatment : The radiation emitted by the source can destroy cancerous cells. Why do you suppose 131 53 I is used for this treatment?
Determine the drivers perception : Determine the drivers perception/reaction time before and after drinking - the driver fails to stop in time and strikes the object at a speed of 30 mi/h.
Which has the greatest penetration into tissue : Of the three basic types of radioaction-alpha, beta, and gamma-which has the greatest penetration into tissue? Explain the rationale behind your answer.
Write a program that reads an initial investment balance : Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.
Find the decay constant and half-life of the isotope : A freshly prepared sample of a certain radioactive isotope has an activity of 10 mCi. After 4 h, the activity is 8 mCi.
What is the maximum acceleration from rest : What is the maximum acceleration from rest of this car on this test track?
Discuss how some tax systems place a double tax on saving : 1. Discuss the way that saving is taxed under an income tax and a consumption tax. Which is more efficient? Why? Which is more equitable? Why? In your explanation, be sure to discuss how some tax systems place a double tax on saving.
Which treatments are proving to be successful and why : What are the primary challenges of sex offender treatment programs? Which treatments are proving to be successful and why

Reviews

Write a Review

Programming Languages Questions & Answers

  What is the average number of records they have

Which employees (by name) do not have degrees? (the "answer" is Jones, Green, Reagan, Washington)

  The best video gaming monitor

Research online sources (e.g., Amazon, eBay, ect.), for video display monitor and card combinations to satisfy a rich gaming experience in your home. Select the combination that your believe is of greatest value when considering the cost of each ..

  Write program using while loop to output squares of integers

Write a program that uses while loop to perform the following steps:Output the sum of all the even numbers between firstnum and secondnum inclusive. Output all the numbers and their squares between firstnum and secondnum inclusive.

  Create and link the tables for the inventory model

create and link the tables for the inventory model from inventory systems below:

  Learn redirecting standard output

Learn redirecting standard output (stdout) to a file using the output redirection operator

  Statement to assig nnew value to first element of array

Suppose that array of integers named a has been declared and initialized. Write single statement which assigns a new value to first element of the array.

  C# application that creates an animal using basic graphics

Write a C# application that creates an animal, plant or building of your design, using basic graphics methods such as DrawRectangle(), DrawLine(), DrawEllipse(), DrawArc() and DrawPie().

  Consider monthly demand for the abc corporation as shown in

consider monthly demand for the abc corporation as shown in the table below. with these demand values estimate a static

  Program to compute grade point average

Write a program that uses such a file to calculate your grade point average(GPA). A GPA is based on a scale from 5, where A is 4, B is 3, C is 2, D is 1 and F is 0.

  Provide support for object orientation of data types

Provide support for object orientation / abstraction of data types, Provide memory management or allow the developer fine-grained control over heap-allocation and recycling.

  Binary search algorithm to search an array

The binary search algorithm that follows may be used to search array when elements are in order. This algorithm is analogous to following approach for finding name in telephone book.

  Program to display only unique values which user entered

Program to display only the unique values which the user entered. Give for the "worst case" in which all 20 numbers are different. use smallest possible array to solve this problem.

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